Increased the max number of items transferable by the Master Routing Node in its system to 64 per second.

This commit is contained in:
WayofTime 2018-03-04 19:11:46 -05:00
parent 2b86e5c8ad
commit 3a83b4ca8a
2 changed files with 172 additions and 86 deletions

View file

@ -5,6 +5,7 @@ Version 2.2.8
- It's a bright idea to fix this as soon as I can. - It's a bright idea to fix this as soon as I can.
- Changed the recipe of the Teleport Array: - Changed the recipe of the Teleport Array:
- Note from Scotty: Captain, I'll remind ya what happened last time you put an apple in her array! Use an Enderpearl and redstone dust next time! - Note from Scotty: Captain, I'll remind ya what happened last time you put an apple in her array! Use an Enderpearl and redstone dust next time!
- Increased the max number of items transferable by the Master Routing Node in its system to 64 per second. Will revisit this limit if I figure out a less silly upgrade system.
------------------------------------------------------ ------------------------------------------------------
Version 2.2.7 Version 2.2.7

View file

@ -16,7 +16,8 @@ import net.minecraft.world.World;
import java.util.*; import java.util.*;
import java.util.Map.Entry; import java.util.Map.Entry;
public class TileMasterRoutingNode extends TileInventory implements IMasterRoutingNode, ITickable { public class TileMasterRoutingNode extends TileInventory implements IMasterRoutingNode, ITickable
{
public static final int tickRate = 20; public static final int tickRate = 20;
private int currentInput; private int currentInput;
// A list of connections // A list of connections
@ -25,13 +26,16 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
private List<BlockPos> outputNodeList = new LinkedList<>(); private List<BlockPos> outputNodeList = new LinkedList<>();
private List<BlockPos> inputNodeList = new LinkedList<>(); private List<BlockPos> inputNodeList = new LinkedList<>();
public TileMasterRoutingNode() { public TileMasterRoutingNode()
{
super(0, "masterRoutingNode"); super(0, "masterRoutingNode");
} }
@Override @Override
public void update() { public void update()
if (!getWorld().isRemote) { {
if (!getWorld().isRemote)
{
// currentInput = getWorld().isBlockIndirectlyGettingPowered(pos); // currentInput = getWorld().isBlockIndirectlyGettingPowered(pos);
currentInput = getWorld().getStrongPower(pos); currentInput = getWorld().getStrongPower(pos);
@ -46,23 +50,31 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
Map<Integer, List<IItemFilter>> outputMap = new TreeMap<>(); Map<Integer, List<IItemFilter>> outputMap = new TreeMap<>();
Map<Integer, List<IFluidFilter>> outputFluidMap = new TreeMap<>(); Map<Integer, List<IFluidFilter>> outputFluidMap = new TreeMap<>();
for (BlockPos outputPos : outputNodeList) { for (BlockPos outputPos : outputNodeList)
{
TileEntity outputTile = getWorld().getTileEntity(outputPos); TileEntity outputTile = getWorld().getTileEntity(outputPos);
if (this.isConnected(new LinkedList<>(), outputPos)) { if (this.isConnected(new LinkedList<>(), outputPos))
if (outputTile instanceof IOutputItemRoutingNode) { {
if (outputTile instanceof IOutputItemRoutingNode)
{
IOutputItemRoutingNode outputNode = (IOutputItemRoutingNode) outputTile; IOutputItemRoutingNode outputNode = (IOutputItemRoutingNode) outputTile;
for (EnumFacing facing : EnumFacing.VALUES) { for (EnumFacing facing : EnumFacing.VALUES)
if (!outputNode.isInventoryConnectedToSide(facing) || !outputNode.isOutput(facing)) { {
if (!outputNode.isInventoryConnectedToSide(facing) || !outputNode.isOutput(facing))
{
continue; continue;
} }
IItemFilter filter = outputNode.getOutputFilterForSide(facing); IItemFilter filter = outputNode.getOutputFilterForSide(facing);
if (filter != null) { if (filter != null)
{
int priority = outputNode.getPriority(facing); int priority = outputNode.getPriority(facing);
if (outputMap.containsKey(priority)) { if (outputMap.containsKey(priority))
{
outputMap.get(priority).add(filter); outputMap.get(priority).add(filter);
} else { } else
{
List<IItemFilter> filterList = new LinkedList<>(); List<IItemFilter> filterList = new LinkedList<>();
filterList.add(filter); filterList.add(filter);
outputMap.put(priority, filterList); outputMap.put(priority, filterList);
@ -71,20 +83,26 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
} }
} }
if (outputTile instanceof IOutputFluidRoutingNode) { if (outputTile instanceof IOutputFluidRoutingNode)
{
IOutputFluidRoutingNode outputNode = (IOutputFluidRoutingNode) outputTile; IOutputFluidRoutingNode outputNode = (IOutputFluidRoutingNode) outputTile;
for (EnumFacing facing : EnumFacing.VALUES) { for (EnumFacing facing : EnumFacing.VALUES)
if (!outputNode.isTankConnectedToSide(facing) || !outputNode.isFluidOutput(facing)) { {
if (!outputNode.isTankConnectedToSide(facing) || !outputNode.isFluidOutput(facing))
{
continue; continue;
} }
IFluidFilter filter = outputNode.getOutputFluidFilterForSide(facing); IFluidFilter filter = outputNode.getOutputFluidFilterForSide(facing);
if (filter != null) { if (filter != null)
{
int priority = outputNode.getPriority(facing); int priority = outputNode.getPriority(facing);
if (outputMap.containsKey(priority)) { if (outputMap.containsKey(priority))
{
outputFluidMap.get(priority).add(filter); outputFluidMap.get(priority).add(filter);
} else { } else
{
List<IFluidFilter> filterList = new LinkedList<>(); List<IFluidFilter> filterList = new LinkedList<>();
filterList.add(filter); filterList.add(filter);
outputFluidMap.put(priority, filterList); outputFluidMap.put(priority, filterList);
@ -98,23 +116,31 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
Map<Integer, List<IItemFilter>> inputMap = new TreeMap<>(); Map<Integer, List<IItemFilter>> inputMap = new TreeMap<>();
Map<Integer, List<IFluidFilter>> inputFluidMap = new TreeMap<>(); Map<Integer, List<IFluidFilter>> inputFluidMap = new TreeMap<>();
for (BlockPos inputPos : inputNodeList) { for (BlockPos inputPos : inputNodeList)
{
TileEntity inputTile = getWorld().getTileEntity(inputPos); TileEntity inputTile = getWorld().getTileEntity(inputPos);
if (this.isConnected(new LinkedList<>(), inputPos)) { if (this.isConnected(new LinkedList<>(), inputPos))
if (inputTile instanceof IInputItemRoutingNode) { {
if (inputTile instanceof IInputItemRoutingNode)
{
IInputItemRoutingNode inputNode = (IInputItemRoutingNode) inputTile; IInputItemRoutingNode inputNode = (IInputItemRoutingNode) inputTile;
for (EnumFacing facing : EnumFacing.VALUES) { for (EnumFacing facing : EnumFacing.VALUES)
if (!inputNode.isInventoryConnectedToSide(facing) || !inputNode.isInput(facing)) { {
if (!inputNode.isInventoryConnectedToSide(facing) || !inputNode.isInput(facing))
{
continue; continue;
} }
IItemFilter filter = inputNode.getInputFilterForSide(facing); IItemFilter filter = inputNode.getInputFilterForSide(facing);
if (filter != null) { if (filter != null)
{
int priority = inputNode.getPriority(facing); int priority = inputNode.getPriority(facing);
if (inputMap.containsKey(priority)) { if (inputMap.containsKey(priority))
{
inputMap.get(priority).add(filter); inputMap.get(priority).add(filter);
} else { } else
{
List<IItemFilter> filterList = new LinkedList<>(); List<IItemFilter> filterList = new LinkedList<>();
filterList.add(filter); filterList.add(filter);
inputMap.put(priority, filterList); inputMap.put(priority, filterList);
@ -123,20 +149,26 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
} }
} }
if (inputTile instanceof IInputFluidRoutingNode) { if (inputTile instanceof IInputFluidRoutingNode)
{
IInputFluidRoutingNode inputNode = (IInputFluidRoutingNode) inputTile; IInputFluidRoutingNode inputNode = (IInputFluidRoutingNode) inputTile;
for (EnumFacing facing : EnumFacing.VALUES) { for (EnumFacing facing : EnumFacing.VALUES)
if (!inputNode.isTankConnectedToSide(facing) || !inputNode.isFluidInput(facing)) { {
if (!inputNode.isTankConnectedToSide(facing) || !inputNode.isFluidInput(facing))
{
continue; continue;
} }
IFluidFilter filter = inputNode.getInputFluidFilterForSide(facing); IFluidFilter filter = inputNode.getInputFluidFilterForSide(facing);
if (filter != null) { if (filter != null)
{
int priority = inputNode.getPriority(facing); int priority = inputNode.getPriority(facing);
if (inputMap.containsKey(priority)) { if (inputMap.containsKey(priority))
{
inputFluidMap.get(priority).add(filter); inputFluidMap.get(priority).add(filter);
} else { } else
{
List<IFluidFilter> filterList = new LinkedList<>(); List<IFluidFilter> filterList = new LinkedList<>();
filterList.add(filter); filterList.add(filter);
inputFluidMap.put(priority, filterList); inputFluidMap.put(priority, filterList);
@ -150,14 +182,19 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
int maxTransfer = this.getMaxTransferForDemonWill(WorldDemonWillHandler.getCurrentWill(getWorld(), pos, EnumDemonWillType.DEFAULT)); int maxTransfer = this.getMaxTransferForDemonWill(WorldDemonWillHandler.getCurrentWill(getWorld(), pos, EnumDemonWillType.DEFAULT));
int maxFluidTransfer = 1000; int maxFluidTransfer = 1000;
for (Entry<Integer, List<IItemFilter>> outputEntry : outputMap.entrySet()) { for (Entry<Integer, List<IItemFilter>> outputEntry : outputMap.entrySet())
{
List<IItemFilter> outputList = outputEntry.getValue(); List<IItemFilter> outputList = outputEntry.getValue();
for (IItemFilter outputFilter : outputList) { for (IItemFilter outputFilter : outputList)
for (Entry<Integer, List<IItemFilter>> inputEntry : inputMap.entrySet()) { {
for (Entry<Integer, List<IItemFilter>> inputEntry : inputMap.entrySet())
{
List<IItemFilter> inputList = inputEntry.getValue(); List<IItemFilter> inputList = inputEntry.getValue();
for (IItemFilter inputFilter : inputList) { for (IItemFilter inputFilter : inputList)
{
maxTransfer -= inputFilter.transferThroughInputFilter(outputFilter, maxTransfer); maxTransfer -= inputFilter.transferThroughInputFilter(outputFilter, maxTransfer);
if (maxTransfer <= 0) { if (maxTransfer <= 0)
{
return; return;
} }
} }
@ -165,14 +202,19 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
} }
} }
for (Entry<Integer, List<IFluidFilter>> outputEntry : outputFluidMap.entrySet()) { for (Entry<Integer, List<IFluidFilter>> outputEntry : outputFluidMap.entrySet())
{
List<IFluidFilter> outputList = outputEntry.getValue(); List<IFluidFilter> outputList = outputEntry.getValue();
for (IFluidFilter outputFilter : outputList) { for (IFluidFilter outputFilter : outputList)
for (Entry<Integer, List<IFluidFilter>> inputEntry : inputFluidMap.entrySet()) { {
for (Entry<Integer, List<IFluidFilter>> inputEntry : inputFluidMap.entrySet())
{
List<IFluidFilter> inputList = inputEntry.getValue(); List<IFluidFilter> inputList = inputEntry.getValue();
for (IFluidFilter inputFilter : inputList) { for (IFluidFilter inputFilter : inputList)
{
maxFluidTransfer -= inputFilter.transferThroughInputFilter(outputFilter, maxFluidTransfer); maxFluidTransfer -= inputFilter.transferThroughInputFilter(outputFilter, maxFluidTransfer);
if (maxFluidTransfer <= 0) { if (maxFluidTransfer <= 0)
{
return; return;
} }
} }
@ -181,15 +223,18 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
} }
} }
public int getMaxTransferForDemonWill(double will) { public int getMaxTransferForDemonWill(double will)
return 8; {
return 64;
} }
@Override @Override
public NBTTagCompound serialize(NBTTagCompound tag) { public NBTTagCompound serialize(NBTTagCompound tag)
{
super.serialize(tag); super.serialize(tag);
NBTTagList tags = new NBTTagList(); NBTTagList tags = new NBTTagList();
for (BlockPos pos : generalNodeList) { for (BlockPos pos : generalNodeList)
{
NBTTagCompound posTag = new NBTTagCompound(); NBTTagCompound posTag = new NBTTagCompound();
posTag.setInteger(Constants.NBT.X_COORD, pos.getX()); posTag.setInteger(Constants.NBT.X_COORD, pos.getX());
posTag.setInteger(Constants.NBT.Y_COORD, pos.getY()); posTag.setInteger(Constants.NBT.Y_COORD, pos.getY());
@ -199,7 +244,8 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
tag.setTag(Constants.NBT.ROUTING_MASTER_GENERAL, tags); tag.setTag(Constants.NBT.ROUTING_MASTER_GENERAL, tags);
tags = new NBTTagList(); tags = new NBTTagList();
for (BlockPos pos : inputNodeList) { for (BlockPos pos : inputNodeList)
{
NBTTagCompound posTag = new NBTTagCompound(); NBTTagCompound posTag = new NBTTagCompound();
posTag.setInteger(Constants.NBT.X_COORD, pos.getX()); posTag.setInteger(Constants.NBT.X_COORD, pos.getX());
posTag.setInteger(Constants.NBT.Y_COORD, pos.getY()); posTag.setInteger(Constants.NBT.Y_COORD, pos.getY());
@ -209,7 +255,8 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
tag.setTag(Constants.NBT.ROUTING_MASTER_INPUT, tags); tag.setTag(Constants.NBT.ROUTING_MASTER_INPUT, tags);
tags = new NBTTagList(); tags = new NBTTagList();
for (BlockPos pos : outputNodeList) { for (BlockPos pos : outputNodeList)
{
NBTTagCompound posTag = new NBTTagCompound(); NBTTagCompound posTag = new NBTTagCompound();
posTag.setInteger(Constants.NBT.X_COORD, pos.getX()); posTag.setInteger(Constants.NBT.X_COORD, pos.getX());
posTag.setInteger(Constants.NBT.Y_COORD, pos.getY()); posTag.setInteger(Constants.NBT.Y_COORD, pos.getY());
@ -221,25 +268,29 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
} }
@Override @Override
public void deserialize(NBTTagCompound tag) { public void deserialize(NBTTagCompound tag)
{
super.deserialize(tag); super.deserialize(tag);
NBTTagList tags = tag.getTagList(Constants.NBT.ROUTING_MASTER_GENERAL, 10); NBTTagList tags = tag.getTagList(Constants.NBT.ROUTING_MASTER_GENERAL, 10);
for (int i = 0; i < tags.tagCount(); i++) { for (int i = 0; i < tags.tagCount(); i++)
{
NBTTagCompound blockTag = tags.getCompoundTagAt(i); NBTTagCompound blockTag = tags.getCompoundTagAt(i);
BlockPos newPos = new BlockPos(blockTag.getInteger(Constants.NBT.X_COORD), blockTag.getInteger(Constants.NBT.Y_COORD), blockTag.getInteger(Constants.NBT.Z_COORD)); BlockPos newPos = new BlockPos(blockTag.getInteger(Constants.NBT.X_COORD), blockTag.getInteger(Constants.NBT.Y_COORD), blockTag.getInteger(Constants.NBT.Z_COORD));
generalNodeList.add(newPos); generalNodeList.add(newPos);
} }
tags = tag.getTagList(Constants.NBT.ROUTING_MASTER_INPUT, 10); tags = tag.getTagList(Constants.NBT.ROUTING_MASTER_INPUT, 10);
for (int i = 0; i < tags.tagCount(); i++) { for (int i = 0; i < tags.tagCount(); i++)
{
NBTTagCompound blockTag = tags.getCompoundTagAt(i); NBTTagCompound blockTag = tags.getCompoundTagAt(i);
BlockPos newPos = new BlockPos(blockTag.getInteger(Constants.NBT.X_COORD), blockTag.getInteger(Constants.NBT.Y_COORD), blockTag.getInteger(Constants.NBT.Z_COORD)); BlockPos newPos = new BlockPos(blockTag.getInteger(Constants.NBT.X_COORD), blockTag.getInteger(Constants.NBT.Y_COORD), blockTag.getInteger(Constants.NBT.Z_COORD));
inputNodeList.add(newPos); inputNodeList.add(newPos);
} }
tags = tag.getTagList(Constants.NBT.ROUTING_MASTER_OUTPUT, 10); tags = tag.getTagList(Constants.NBT.ROUTING_MASTER_OUTPUT, 10);
for (int i = 0; i < tags.tagCount(); i++) { for (int i = 0; i < tags.tagCount(); i++)
{
NBTTagCompound blockTag = tags.getCompoundTagAt(i); NBTTagCompound blockTag = tags.getCompoundTagAt(i);
BlockPos newPos = new BlockPos(blockTag.getInteger(Constants.NBT.X_COORD), blockTag.getInteger(Constants.NBT.Y_COORD), blockTag.getInteger(Constants.NBT.Z_COORD)); BlockPos newPos = new BlockPos(blockTag.getInteger(Constants.NBT.X_COORD), blockTag.getInteger(Constants.NBT.Y_COORD), blockTag.getInteger(Constants.NBT.Z_COORD));
outputNodeList.add(newPos); outputNodeList.add(newPos);
@ -247,14 +298,16 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
} }
@Override @Override
public boolean isConnected(List<BlockPos> path, BlockPos nodePos) { public boolean isConnected(List<BlockPos> path, BlockPos nodePos)
{
//TODO: Figure out how to make it so the path is obtained //TODO: Figure out how to make it so the path is obtained
// if (!connectionMap.containsKey(nodePos)) // if (!connectionMap.containsKey(nodePos))
// { // {
// return false; // return false;
// } // }
TileEntity tile = getWorld().getTileEntity(nodePos); TileEntity tile = getWorld().getTileEntity(nodePos);
if (!(tile instanceof IRoutingNode)) { if (!(tile instanceof IRoutingNode))
{
// connectionMap.remove(nodePos); // connectionMap.remove(nodePos);
return false; return false;
} }
@ -263,17 +316,22 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
List<BlockPos> connectionList = node.getConnected(); List<BlockPos> connectionList = node.getConnected();
// List<BlockPos> testPath = path.subList(0, path.size()); // List<BlockPos> testPath = path.subList(0, path.size());
path.add(nodePos); path.add(nodePos);
for (BlockPos testPos : connectionList) { for (BlockPos testPos : connectionList)
if (path.contains(testPos)) { {
if (path.contains(testPos))
{
continue; continue;
} }
if (testPos.equals(this.getPos()) && node.isConnectionEnabled(testPos)) { if (testPos.equals(this.getPos()) && node.isConnectionEnabled(testPos))
{
// path.clear(); // path.clear();
// path.addAll(testPath); // path.addAll(testPath);
return true; return true;
} else if (NodeHelper.isNodeConnectionEnabled(getWorld(), node, testPos)) { } else if (NodeHelper.isNodeConnectionEnabled(getWorld(), node, testPos))
if (isConnected(path, testPos)) { {
if (isConnected(path, testPos))
{
// path.clear(); // path.clear();
// path.addAll(testPath); // path.addAll(testPath);
return true; return true;
@ -285,44 +343,56 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
} }
@Override @Override
public boolean isConnectionEnabled(BlockPos testPos) { public boolean isConnectionEnabled(BlockPos testPos)
{
return currentInput <= 0; return currentInput <= 0;
} }
@Override @Override
public void addNodeToList(IRoutingNode node) { public void addNodeToList(IRoutingNode node)
{
BlockPos newPos = node.getBlockPos(); BlockPos newPos = node.getBlockPos();
if (!generalNodeList.contains(newPos)) { if (!generalNodeList.contains(newPos))
{
generalNodeList.add(newPos); generalNodeList.add(newPos);
} }
if (node instanceof IInputItemRoutingNode && !inputNodeList.contains(newPos)) { if (node instanceof IInputItemRoutingNode && !inputNodeList.contains(newPos))
{
inputNodeList.add(newPos); inputNodeList.add(newPos);
} }
if (node instanceof IOutputItemRoutingNode && !outputNodeList.contains(newPos)) { if (node instanceof IOutputItemRoutingNode && !outputNodeList.contains(newPos))
{
outputNodeList.add(newPos); outputNodeList.add(newPos);
} }
} }
@Override @Override
public void addConnections(BlockPos pos, List<BlockPos> connectionList) { public void addConnections(BlockPos pos, List<BlockPos> connectionList)
for (BlockPos testPos : connectionList) { {
for (BlockPos testPos : connectionList)
{
addConnection(pos, testPos); addConnection(pos, testPos);
} }
} }
@Override @Override
public void addConnection(BlockPos pos1, BlockPos pos2) { public void addConnection(BlockPos pos1, BlockPos pos2)
if (connectionMap.containsKey(pos1) && !connectionMap.get(pos1).contains(pos2)) { {
if (connectionMap.containsKey(pos1) && !connectionMap.get(pos1).contains(pos2))
{
connectionMap.get(pos1).add(pos2); connectionMap.get(pos1).add(pos2);
} else { } else
{
List<BlockPos> list = new LinkedList<>(); List<BlockPos> list = new LinkedList<>();
list.add(pos2); list.add(pos2);
connectionMap.put(pos1, list); connectionMap.put(pos1, list);
} }
if (connectionMap.containsKey(pos2) && !connectionMap.get(pos2).contains(pos1)) { if (connectionMap.containsKey(pos2) && !connectionMap.get(pos2).contains(pos1))
{
connectionMap.get(pos2).add(pos1); connectionMap.get(pos2).add(pos1);
} else { } else
{
List<BlockPos> list = new LinkedList<>(); List<BlockPos> list = new LinkedList<>();
list.add(pos1); list.add(pos1);
connectionMap.put(pos2, list); connectionMap.put(pos2, list);
@ -330,69 +400,84 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti
} }
@Override @Override
public void removeConnection(BlockPos pos1, BlockPos pos2) { public void removeConnection(BlockPos pos1, BlockPos pos2)
if (connectionMap.containsKey(pos1)) { {
if (connectionMap.containsKey(pos1))
{
List<BlockPos> posList = connectionMap.get(pos1); List<BlockPos> posList = connectionMap.get(pos1);
posList.remove(pos2); posList.remove(pos2);
if (posList.isEmpty()) { if (posList.isEmpty())
{
connectionMap.remove(pos1); connectionMap.remove(pos1);
} }
} }
if (connectionMap.containsKey(pos2)) { if (connectionMap.containsKey(pos2))
{
List<BlockPos> posList = connectionMap.get(pos2); List<BlockPos> posList = connectionMap.get(pos2);
posList.remove(pos1); posList.remove(pos1);
if (posList.isEmpty()) { if (posList.isEmpty())
{
connectionMap.remove(pos2); connectionMap.remove(pos2);
} }
} }
} }
@Override @Override
public void connectMasterToRemainingNode(World world, List<BlockPos> alreadyChecked, IMasterRoutingNode master) { public void connectMasterToRemainingNode(World world, List<BlockPos> alreadyChecked, IMasterRoutingNode master)
{
return; return;
} }
@Override @Override
public BlockPos getBlockPos() { public BlockPos getBlockPos()
{
return this.getPos(); return this.getPos();
} }
@Override @Override
public List<BlockPos> getConnected() { public List<BlockPos> getConnected()
{
return new LinkedList<>(); return new LinkedList<>();
} }
@Override @Override
public BlockPos getMasterPos() { public BlockPos getMasterPos()
{
return this.getPos(); return this.getPos();
} }
@Override @Override
public boolean isMaster(IMasterRoutingNode master) { public boolean isMaster(IMasterRoutingNode master)
{
return false; return false;
} }
@Override @Override
public void addConnection(BlockPos pos1) { public void addConnection(BlockPos pos1)
{
// Empty // Empty
} }
@Override @Override
public void removeConnection(BlockPos pos1) { public void removeConnection(BlockPos pos1)
{
generalNodeList.remove(pos1); generalNodeList.remove(pos1);
inputNodeList.remove(pos1); inputNodeList.remove(pos1);
outputNodeList.remove(pos1); outputNodeList.remove(pos1);
} }
@Override @Override
public void removeAllConnections() { public void removeAllConnections()
{
List<BlockPos> list = generalNodeList.subList(0, generalNodeList.size()); List<BlockPos> list = generalNodeList.subList(0, generalNodeList.size());
Iterator<BlockPos> itr = list.iterator(); Iterator<BlockPos> itr = list.iterator();
while (itr.hasNext()) { while (itr.hasNext())
{
BlockPos testPos = itr.next(); BlockPos testPos = itr.next();
TileEntity tile = getWorld().getTileEntity(testPos); TileEntity tile = getWorld().getTileEntity(testPos);
if (tile instanceof IRoutingNode) { if (tile instanceof IRoutingNode)
{
((IRoutingNode) tile).removeConnection(pos); ((IRoutingNode) tile).removeConnection(pos);
getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(testPos), getWorld().getBlockState(testPos), 3); getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(testPos), getWorld().getBlockState(testPos), 3);
} }