From 04276d1d18d379248cc02b17c15a28760a5adb41 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 22 May 2021 13:36:56 -0400 Subject: 2.0.0 alpha.predev release --- .../cshift/transit/basic/AbstractAcceptorNode.java | 51 ---------------------- .../net/cshift/transit/basic/AbstractNode.java | 45 ------------------- .../cshift/transit/basic/AbstractProviderNode.java | 47 -------------------- .../cshift/transit/basic/AbstractTwoWayNode.java | 47 -------------------- 4 files changed, 190 deletions(-) delete mode 100644 src/main/java/net/cshift/transit/basic/AbstractAcceptorNode.java delete mode 100644 src/main/java/net/cshift/transit/basic/AbstractNode.java delete mode 100644 src/main/java/net/cshift/transit/basic/AbstractProviderNode.java delete mode 100644 src/main/java/net/cshift/transit/basic/AbstractTwoWayNode.java (limited to 'src/main/java/net/cshift/transit/basic') diff --git a/src/main/java/net/cshift/transit/basic/AbstractAcceptorNode.java b/src/main/java/net/cshift/transit/basic/AbstractAcceptorNode.java deleted file mode 100644 index e2e6711..0000000 --- a/src/main/java/net/cshift/transit/basic/AbstractAcceptorNode.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.cshift.transit.basic; - -import net.cshift.transit.network.packet.*; -import net.cshift.transit.network.system.*; -import net.cshift.transit.network.system.swap.*; -import net.minecraft.block.entity.*; - -public abstract class AbstractAcceptorNode extends AbstractNode implements IAcceptorNode { - - public AbstractAcceptorNode(BlockEntityType type) { - super(type); - } - - @Override - public abstract boolean accept(IStaticPacket packet, String group); - - @Override - public boolean linkProvider(IProviderNode requestor, String group) { - if(this.hasGroup(group)) - { - for (Connection c : connections) { - if(c.getNode() == requestor) - return false; - } - - connections.add(new Connection(requestor, (short) 2)); - - return true; - } - - return false; - } - - @Override - public boolean unlinkProvider(IProviderNode requestor) { - for (Connection c : connections) { - if(c.getNode() == requestor) - { - if(c.isAccepting()) - c.setProviding(false); - else - connections.remove(c); - - return true; - } - } - - return false; - } - -} diff --git a/src/main/java/net/cshift/transit/basic/AbstractNode.java b/src/main/java/net/cshift/transit/basic/AbstractNode.java deleted file mode 100644 index a87fba4..0000000 --- a/src/main/java/net/cshift/transit/basic/AbstractNode.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.cshift.transit.basic; - -import java.util.*; - -import net.cshift.transit.network.system.*; -import net.minecraft.block.entity.*; - -public abstract class AbstractNode extends BlockEntity implements INode { - - public AbstractNode(BlockEntityType type) { - super(type); - } - - HashMap data = new HashMap(); - ArrayList connections = new ArrayList(0); - - @Override - public abstract boolean hasGroup(String groupID); - - @Override - public ISystem getSystem() { - return null; - } - - @Override - public Object getData(String groupID) { - return data.get(groupID); - } - - @Override - public void setData(Object dat, String groupID) { - data.put(groupID, dat); - } - - @Override - public Connection[] getConnections() { - return (Connection[]) connections.toArray(); - } - - @Override - public int connectionCount() { - return connections.size(); - } - -} diff --git a/src/main/java/net/cshift/transit/basic/AbstractProviderNode.java b/src/main/java/net/cshift/transit/basic/AbstractProviderNode.java deleted file mode 100644 index cc81544..0000000 --- a/src/main/java/net/cshift/transit/basic/AbstractProviderNode.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.cshift.transit.basic; - -import net.cshift.transit.network.system.*; -import net.cshift.transit.network.system.swap.*; -import net.minecraft.block.entity.*; - -public abstract class AbstractProviderNode extends AbstractNode implements IProviderNode { - - public AbstractProviderNode(BlockEntityType type) { - super(type); - } - - @Override - public boolean linkAcceptor(IAcceptorNode requestor, String group) { - if(this.hasGroup(group)) - { - for (Connection c : connections) { - if(c.getNode() == requestor) - return false; - } - - connections.add(new Connection(requestor, (short) 1)); - - return true; - } - - return false; - } - - @Override - public boolean unlinkAcceptor(IAcceptorNode requestor) { - for (Connection c : connections) { - if(c.getNode() == requestor) - { - if(c.isProviding()) - c.setAccepting(false); - else - connections.remove(c); - - return true; - } - } - - return false; - } - -} diff --git a/src/main/java/net/cshift/transit/basic/AbstractTwoWayNode.java b/src/main/java/net/cshift/transit/basic/AbstractTwoWayNode.java deleted file mode 100644 index cc06eeb..0000000 --- a/src/main/java/net/cshift/transit/basic/AbstractTwoWayNode.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.cshift.transit.basic; - -import net.cshift.transit.network.system.*; -import net.cshift.transit.network.system.swap.*; -import net.minecraft.block.entity.*; - -public abstract class AbstractTwoWayNode extends AbstractAcceptorNode implements IProviderNode { - - public AbstractTwoWayNode(BlockEntityType type) { - super(type); - } - - @Override - public boolean linkAcceptor(IAcceptorNode requestor, String group) { - if(this.hasGroup(group)) - { - for (Connection c : connections) { - if(c.getNode() == requestor) - return false; - } - - connections.add(new Connection(requestor, (short) 1)); - - return true; - } - - return false; - } - - @Override - public boolean unlinkAcceptor(IAcceptorNode requestor) { - for (Connection c : connections) { - if(c.getNode() == requestor) - { - if(c.isProviding()) - c.setAccepting(false); - else - connections.remove(c); - - return true; - } - } - - return false; - } - -} -- cgit v1.2.3