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 4ba51f2a2..9fec41528 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/laser/ILaserRelayConnectionHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/laser/ILaserRelayConnectionHandler.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.api.laser; import io.netty.util.internal.ConcurrentSet; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -30,13 +31,11 @@ public interface ILaserRelayConnectionHandler{ Network getNetworkFor(BlockPos relay, World world); - @Deprecated - boolean addConnection(BlockPos firstRelay, BlockPos secondRelay, World world); - - @Deprecated - boolean addConnection(BlockPos firstRelay, BlockPos secondRelay, World world, boolean suppressConnectionRender); - boolean addConnection(BlockPos firstRelay, BlockPos secondRelay, LaserType type, World world); boolean addConnection(BlockPos firstRelay, BlockPos secondRelay, LaserType type, World world, boolean suppressConnectionRender); + + LaserType getTypeFromLaser(TileEntity tile); + + LaserType getTypeFromLsaer(BlockPos pos, World world); } 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 dfd61c47e..d8bc623aa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java @@ -15,9 +15,11 @@ import de.ellpeck.actuallyadditions.api.laser.ILaserRelayConnectionHandler; import de.ellpeck.actuallyadditions.api.laser.LaserType; import de.ellpeck.actuallyadditions.api.laser.Network; import de.ellpeck.actuallyadditions.mod.data.WorldData; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay; import io.netty.util.internal.ConcurrentSet; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -109,16 +111,6 @@ public final class LaserRelayConnectionHandler implements ILaserRelayConnectionH return null; } - @Override - public boolean addConnection(BlockPos firstRelay, BlockPos secondRelay, World world){ - return this.addConnection(firstRelay, secondRelay, null, world); - } - - @Override - public boolean addConnection(BlockPos firstRelay, BlockPos secondRelay, World world, boolean suppressConnectionRender){ - return this.addConnection(firstRelay, secondRelay, null, world, suppressConnectionRender); - } - @Override public boolean addConnection(BlockPos firstRelay, BlockPos secondRelay, LaserType type, World world){ return this.addConnection(firstRelay, secondRelay, type, world, false); @@ -170,4 +162,19 @@ public final class LaserRelayConnectionHandler implements ILaserRelayConnectionH return true; } + @Override + public LaserType getTypeFromLaser(TileEntity tile){ + if(tile instanceof TileEntityLaserRelay){ + return ((TileEntityLaserRelay)tile).type; + } + else{ + return null; + } + } + + @Override + public LaserType getTypeFromLsaer(BlockPos pos, World world){ + return this.getTypeFromLaser(world.getTileEntity(pos)); + } + } \ No newline at end of file