From ce63aafe3fe99c42aceb900244cd0b4c7d9bb4e2 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 12 Sep 2016 16:13:39 +0200 Subject: [PATCH] Add a breaking change to the API --- .../api/laser/IConnectionPair.java | 32 ++++++++++ .../laser/ILaserRelayConnectionHandler.java | 2 +- .../actuallyadditions/api/laser/Network.java | 2 +- .../mod/event/CommonEvents.java | 16 ++--- .../laser => mod/misc}/ConnectionPair.java | 60 +++++++++++++------ .../mod/misc/LaserRelayConnectionHandler.java | 26 ++++---- .../mod/tile/TileEntityLaserRelay.java | 28 +++++---- .../mod/tile/TileEntityLaserRelayEnergy.java | 7 ++- .../mod/tile/TileEntityLaserRelayFluids.java | 9 +-- .../mod/tile/TileEntityLaserRelayItem.java | 7 ++- 10 files changed, 125 insertions(+), 64 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/api/laser/IConnectionPair.java rename src/main/java/de/ellpeck/actuallyadditions/{api/laser => mod/misc}/ConnectionPair.java (69%) diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/laser/IConnectionPair.java b/src/main/java/de/ellpeck/actuallyadditions/api/laser/IConnectionPair.java new file mode 100644 index 000000000..e9fd9354d --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/api/laser/IConnectionPair.java @@ -0,0 +1,32 @@ +/* + * This file ("IConnectionPair.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.api.laser; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.math.BlockPos; + +public interface IConnectionPair{ + + void writeToNBT(NBTTagCompound compound); + + void readFromNBT(NBTTagCompound compound); + + BlockPos[] getPositions(); + + boolean doesSuppressRender(); + + LaserType getType(); + + boolean contains(BlockPos pos); + + @Deprecated //TODO Remove this once removing the temporary type fixer + void setType(LaserType type); +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/laser/ILaserRelayConnectionHandler.java b/src/main/java/de/ellpeck/actuallyadditions/api/laser/ILaserRelayConnectionHandler.java index 9b71aad00..4ba51f2a2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/laser/ILaserRelayConnectionHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/laser/ILaserRelayConnectionHandler.java @@ -24,7 +24,7 @@ import net.minecraft.world.World; */ public interface ILaserRelayConnectionHandler{ - ConcurrentSet getConnectionsFor(BlockPos relay, World world); + ConcurrentSet getConnectionsFor(BlockPos relay, World world); void removeRelayFromNetwork(BlockPos relay, World world); diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/laser/Network.java b/src/main/java/de/ellpeck/actuallyadditions/api/laser/Network.java index cbe5427ea..4ea733eea 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/laser/Network.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/laser/Network.java @@ -14,7 +14,7 @@ import io.netty.util.internal.ConcurrentSet; public class Network{ - public final ConcurrentSet connections = new ConcurrentSet(); + public final ConcurrentSet connections = new ConcurrentSet(); @Override public String toString(){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java index 132f92528..f62b891ec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.event; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.laser.ConnectionPair; +import de.ellpeck.actuallyadditions.mod.misc.ConnectionPair; import de.ellpeck.actuallyadditions.api.laser.LaserType; import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements; import de.ellpeck.actuallyadditions.mod.achievement.TheAchievements; @@ -149,26 +149,26 @@ public class CommonEvents{ //TODO Remove this eventually (part of the ConnectionPair system change) if(!ConnectionPair.PAIRS_FOR_FIXING.isEmpty()){ for(ConnectionPair pair : ConnectionPair.PAIRS_FOR_FIXING){ - TileEntity first = event.getWorld().getTileEntity(pair.positions[0]); - TileEntity second = event.getWorld().getTileEntity(pair.positions[1]); + TileEntity first = event.getWorld().getTileEntity(pair.getPositions()[0]); + TileEntity second = event.getWorld().getTileEntity(pair.getPositions()[1]); boolean fixed = false; if(first instanceof TileEntityLaserRelay && second instanceof TileEntityLaserRelay){ LaserType firstType = ((TileEntityLaserRelay)first).type; LaserType secondType = ((TileEntityLaserRelay)second).type; if(firstType == secondType){ - pair.type = firstType; + pair.setType(firstType); fixed = true; } } if(!fixed){ - for(int i = 0; i < pair.positions.length; i++){ - if(ActuallyAdditionsAPI.connectionHandler.getNetworkFor(pair.positions[i], event.getWorld()) != null){ - ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(pair.positions[i], event.getWorld()); + for(int i = 0; i < pair.getPositions().length; i++){ + if(ActuallyAdditionsAPI.connectionHandler.getNetworkFor(pair.getPositions()[i], event.getWorld()) != null){ + ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(pair.getPositions()[i], event.getWorld()); } } - ModUtil.LOGGER.error("Had to remove a Laser Relay connection between "+pair.positions[0]+" and "+pair.positions[1]+" because it couldn't be adapted to the new system!"); + ModUtil.LOGGER.error("Had to remove a Laser Relay connection between "+pair.getPositions()[0]+" and "+pair.getPositions()[1]+" because it couldn't be adapted to the new system!"); } } ModUtil.LOGGER.info("Adapted "+ConnectionPair.PAIRS_FOR_FIXING.size()+" Laser Relay Connections to the new system!"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/laser/ConnectionPair.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/ConnectionPair.java similarity index 69% rename from src/main/java/de/ellpeck/actuallyadditions/api/laser/ConnectionPair.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/misc/ConnectionPair.java index dfe63ae25..1390b0ada 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/laser/ConnectionPair.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/ConnectionPair.java @@ -8,23 +8,29 @@ * © 2015-2016 Ellpeck */ -package de.ellpeck.actuallyadditions.api.laser; +package de.ellpeck.actuallyadditions.mod.misc; +import de.ellpeck.actuallyadditions.api.laser.IConnectionPair; +import de.ellpeck.actuallyadditions.api.laser.LaserType; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.math.BlockPos; import java.util.ArrayList; import java.util.List; -public class ConnectionPair{ +public class ConnectionPair implements IConnectionPair{ //TODO Remove eventually, just for making the implementation of LaserType work //TODO Also remove those deprecated methods in the API public static final List PAIRS_FOR_FIXING = new ArrayList(); - public final BlockPos[] positions = new BlockPos[2]; - public final boolean suppressConnectionRender; - public LaserType type; + private final BlockPos[] positions = new BlockPos[2]; + private boolean suppressConnectionRender; + private LaserType type; + + public ConnectionPair(){ + + } public ConnectionPair(BlockPos firstRelay, BlockPos secondRelay, LaserType type, boolean suppressConnectionRender){ this.positions[0] = firstRelay; @@ -33,28 +39,45 @@ public class ConnectionPair{ this.type = type; } - public static ConnectionPair readFromNBT(NBTTagCompound compound){ + @Override + public void readFromNBT(NBTTagCompound compound){ if(compound != null){ - BlockPos[] pos = new BlockPos[2]; - for(int i = 0; i < pos.length; i++){ + for(int i = 0; i < this.positions.length; i++){ int anX = compound.getInteger("x"+i); int aY = compound.getInteger("y"+i); int aZ = compound.getInteger("z"+i); - pos[i] = new BlockPos(anX, aY, aZ); + this.positions[i] = new BlockPos(anX, aY, aZ); } + this.suppressConnectionRender = compound.getBoolean("SuppressRender"); - LaserType type = null; String typeStrg = compound.getString("Type"); if(typeStrg != null && !typeStrg.isEmpty()){ - type = LaserType.valueOf(typeStrg); + this.type = LaserType.valueOf(typeStrg); } - ConnectionPair pair = new ConnectionPair(pos[0], pos[1], type, compound.getBoolean("SuppressRender")); - if(type == null){ - PAIRS_FOR_FIXING.add(pair); + if(this.type == null){ + PAIRS_FOR_FIXING.add(this); } - return pair; } - return null; + } + + @Override + public BlockPos[] getPositions(){ + return this.positions; + } + + @Override + public boolean doesSuppressRender(){ + return this.suppressConnectionRender; + } + + @Override + public LaserType getType(){ + return this.type; + } + + @Override + public void setType(LaserType type){ + this.type = type; } public boolean contains(BlockPos relay){ @@ -71,8 +94,8 @@ public class ConnectionPair{ return (this.positions[0] == null ? "-" : this.positions[0].toString())+" | "+(this.positions[1] == null ? "-" : this.positions[1].toString()); } - public NBTTagCompound writeToNBT(){ - NBTTagCompound compound = new NBTTagCompound(); + @Override + public void writeToNBT(NBTTagCompound compound){ for(int i = 0; i < this.positions.length; i++){ BlockPos relay = this.positions[i]; compound.setInteger("x"+i, relay.getX()); @@ -83,7 +106,6 @@ public class ConnectionPair{ compound.setString("Type", this.type.name()); } compound.setBoolean("SuppressRender", this.suppressConnectionRender); - return compound; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java index 4b89f6b3f..27ed87bff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.misc; -import de.ellpeck.actuallyadditions.api.laser.ConnectionPair; +import de.ellpeck.actuallyadditions.api.laser.IConnectionPair; import de.ellpeck.actuallyadditions.api.laser.ILaserRelayConnectionHandler; import de.ellpeck.actuallyadditions.api.laser.LaserType; import de.ellpeck.actuallyadditions.api.laser.Network; @@ -25,8 +25,10 @@ public final class LaserRelayConnectionHandler implements ILaserRelayConnectionH public static NBTTagCompound writeNetworkToNBT(Network network){ NBTTagList list = new NBTTagList(); - for(ConnectionPair pair : network.connections){ - list.appendTag(pair.writeToNBT()); + for(IConnectionPair pair : network.connections){ + NBTTagCompound tag = new NBTTagCompound(); + pair.writeToNBT(tag); + list.appendTag(tag); } NBTTagCompound compound = new NBTTagCompound(); compound.setTag("Network", list); @@ -37,7 +39,9 @@ public final class LaserRelayConnectionHandler implements ILaserRelayConnectionH NBTTagList list = tag.getTagList("Network", 10); Network network = new Network(); for(int i = 0; i < list.tagCount(); i++){ - network.connections.add(ConnectionPair.readFromNBT(list.getCompoundTagAt(i))); + ConnectionPair pair = new ConnectionPair(); + pair.readFromNBT(list.getCompoundTagAt(i)); + network.connections.add(pair); } return network; } @@ -46,10 +50,10 @@ public final class LaserRelayConnectionHandler implements ILaserRelayConnectionH * Gets all Connections for a Relay */ @Override - public ConcurrentSet getConnectionsFor(BlockPos relay, World world){ - ConcurrentSet allPairs = new ConcurrentSet(); + public ConcurrentSet getConnectionsFor(BlockPos relay, World world){ + ConcurrentSet allPairs = new ConcurrentSet(); for(Network aNetwork : WorldData.getDataForWorld(world).laserRelayNetworks){ - for(ConnectionPair pair : aNetwork.connections){ + for(IConnectionPair pair : aNetwork.connections){ if(pair.contains(relay)){ allPairs.add(pair); } @@ -67,9 +71,9 @@ public final class LaserRelayConnectionHandler implements ILaserRelayConnectionH if(network != null){ //Setup new network (so that splitting a network will cause it to break into two) WorldData.getDataForWorld(world).laserRelayNetworks.remove(network); - for(ConnectionPair pair : network.connections){ + for(IConnectionPair pair : network.connections){ if(!pair.contains(relay)){ - this.addConnection(pair.positions[0], pair.positions[1], pair.type, world, pair.suppressConnectionRender); + this.addConnection(pair.getPositions()[0], pair.getPositions()[1], pair.getType(), world, pair.doesSuppressRender()); } } //System.out.println("Removing a Relay from the Network!"); @@ -82,7 +86,7 @@ public final class LaserRelayConnectionHandler implements ILaserRelayConnectionH @Override public Network getNetworkFor(BlockPos relay, World world){ for(Network aNetwork : WorldData.getDataForWorld(world).laserRelayNetworks){ - for(ConnectionPair pair : aNetwork.connections){ + for(IConnectionPair pair : aNetwork.connections){ if(pair.contains(relay)){ return aNetwork; } @@ -153,7 +157,7 @@ public final class LaserRelayConnectionHandler implements ILaserRelayConnectionH * (Actually puts everything from the second network into the first one and removes the second one) */ private static void mergeNetworks(Network firstNetwork, Network secondNetwork, World world){ - for(ConnectionPair secondPair : secondNetwork.connections){ + for(IConnectionPair secondPair : secondNetwork.connections){ firstNetwork.connections.add(secondPair); } WorldData.getDataForWorld(world).laserRelayNetworks.remove(secondNetwork); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java index b681e653a..514a0fc8c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java @@ -11,7 +11,8 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.laser.ConnectionPair; +import de.ellpeck.actuallyadditions.api.laser.IConnectionPair; +import de.ellpeck.actuallyadditions.mod.misc.ConnectionPair; import de.ellpeck.actuallyadditions.api.laser.LaserType; import de.ellpeck.actuallyadditions.api.laser.Network; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; @@ -40,7 +41,7 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ public final LaserType type; - private Set tempConnectionStorage; + private Set tempConnectionStorage; public TileEntityLaserRelay(String name, LaserType type){ super(name); @@ -57,8 +58,9 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ NBTTagList list = compound.getTagList("Connections", 10); if(!list.hasNoTags()){ for(int i = 0; i < list.tagCount(); i++){ - ConnectionPair pair = ConnectionPair.readFromNBT(list.getCompoundTagAt(i)); - ActuallyAdditionsAPI.connectionHandler.addConnection(pair.positions[0], pair.positions[1], this.type, this.worldObj, pair.suppressConnectionRender); + ConnectionPair pair = new ConnectionPair(); + pair.readFromNBT(list.getCompoundTagAt(i)); + ActuallyAdditionsAPI.connectionHandler.addConnection(pair.getPositions()[0], pair.getPositions()[1], this.type, this.worldObj, pair.doesSuppressRender()); } } } @@ -71,10 +73,12 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ if(type == NBTType.SYNC){ NBTTagList list = new NBTTagList(); - ConcurrentSet connections = ActuallyAdditionsAPI.connectionHandler.getConnectionsFor(this.pos, this.worldObj); + ConcurrentSet connections = ActuallyAdditionsAPI.connectionHandler.getConnectionsFor(this.pos, this.worldObj); if(connections != null && !connections.isEmpty()){ - for(ConnectionPair pair : connections){ - list.appendTag(pair.writeToNBT()); + for(IConnectionPair pair : connections){ + NBTTagCompound tag = new NBTTagCompound(); + pair.writeToNBT(tag); + list.appendTag(tag); } } @@ -102,9 +106,9 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ if(mode == WrenchMode.ALWAYS_PARTICLES || (stack != null && stack.getItem() instanceof ItemLaserWrench)){ Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.pos, this.worldObj); if(network != null){ - for(ConnectionPair aPair : network.connections){ - if(!aPair.suppressConnectionRender && aPair.contains(this.pos) && this.pos.equals(aPair.positions[0])){ - AssetUtil.renderParticlesFromAToB(aPair.positions[0].getX(), aPair.positions[0].getY(), aPair.positions[0].getZ(), aPair.positions[1].getX(), aPair.positions[1].getY(), aPair.positions[1].getZ(), ConfigBoolValues.LESS_PARTICLES.isEnabled() ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, this.type == LaserType.ITEM ? COLOR_ITEM : (this.type == LaserType.FLUID ? COLOR_FLUIDS : COLOR), 1F); + for(IConnectionPair aPair : network.connections){ + if(!aPair.doesSuppressRender() && aPair.contains(this.pos) && this.pos.equals(aPair.getPositions()[0])){ + AssetUtil.renderParticlesFromAToB(aPair.getPositions()[0].getX(), aPair.getPositions()[0].getY(), aPair.getPositions()[0].getZ(), aPair.getPositions()[1].getX(), aPair.getPositions()[1].getY(), aPair.getPositions()[1].getZ(), ConfigBoolValues.LESS_PARTICLES.isEnabled() ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, this.type == LaserType.ITEM ? COLOR_ITEM : (this.type == LaserType.FLUID ? COLOR_FLUIDS : COLOR), 1F); } } } @@ -127,8 +131,8 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ @Override public void validate(){ if(this.tempConnectionStorage != null){ - for(ConnectionPair pair : this.tempConnectionStorage){ - ActuallyAdditionsAPI.connectionHandler.addConnection(pair.positions[0], pair.positions[1], pair.type, this.worldObj, pair.suppressConnectionRender); + for(IConnectionPair pair : this.tempConnectionStorage){ + ActuallyAdditionsAPI.connectionHandler.addConnection(pair.getPositions()[0], pair.getPositions()[1], pair.getType(), this.worldObj, pair.doesSuppressRender()); } this.tempConnectionStorage = null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java index 49459b737..949c4d0f6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java @@ -12,7 +12,8 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.laser.ConnectionPair; +import de.ellpeck.actuallyadditions.api.laser.IConnectionPair; +import de.ellpeck.actuallyadditions.mod.misc.ConnectionPair; import de.ellpeck.actuallyadditions.api.laser.LaserType; import de.ellpeck.actuallyadditions.api.laser.Network; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; @@ -102,8 +103,8 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay implements List relaysThatWork = new ArrayList(); int totalReceiverAmount = 0; - for(ConnectionPair pair : network.connections){ - for(BlockPos relay : pair.positions){ + for(IConnectionPair pair : network.connections){ + for(BlockPos relay : pair.getPositions()){ if(relay != null && !alreadyChecked.contains(relay)){ alreadyChecked.add(relay); TileEntity relayTile = this.worldObj.getTileEntity(relay); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java index 28d3cffbe..0190c73ab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java @@ -10,13 +10,10 @@ package de.ellpeck.actuallyadditions.mod.tile; -import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.laser.ConnectionPair; +import de.ellpeck.actuallyadditions.api.laser.IConnectionPair; import de.ellpeck.actuallyadditions.api.laser.LaserType; import de.ellpeck.actuallyadditions.api.laser.Network; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; @@ -98,8 +95,8 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay implements List relaysThatWork = new ArrayList(); int totalReceiverAmount = 0; - for(ConnectionPair pair : network.connections){ - for(BlockPos relay : pair.positions){ + for(IConnectionPair pair : network.connections){ + for(BlockPos relay : pair.getPositions()){ if(relay != null && !alreadyChecked.contains(relay)){ alreadyChecked.add(relay); TileEntity relayTile = this.worldObj.getTileEntity(relay); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java index 4a41ffd2d..814879125 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java @@ -10,7 +10,8 @@ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.api.laser.ConnectionPair; +import de.ellpeck.actuallyadditions.api.laser.IConnectionPair; +import de.ellpeck.actuallyadditions.mod.misc.ConnectionPair; import de.ellpeck.actuallyadditions.api.laser.LaserType; import de.ellpeck.actuallyadditions.api.laser.Network; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer.GenericItemHandlerInfo; @@ -70,8 +71,8 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay{ List alreadyChecked = new ArrayList(); List handlers = new ArrayList(); - for(ConnectionPair pair : network.connections){ - for(BlockPos relay : pair.positions){ + for(IConnectionPair pair : network.connections){ + for(BlockPos relay : pair.getPositions()){ if(relay != null && !alreadyChecked.contains(relay)){ alreadyChecked.add(relay); TileEntity aRelayTile = this.worldObj.getTileEntity(relay);