mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-20 04:09:43 +00:00
Add basic ME Conduits.
Non-rendering, function as basic 8-channel conduits
This commit is contained in:
1 parent
63e1a1dc1d
commit
c764cfdd0d
33 files changed
+396
-61
No files matched your search
@@ -53,6 +53,7 @@ import crazypants.enderio.conduit.item.filter.ItemBasicItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemExistingItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemModItemFilter;
|
||||
import crazypants.enderio.conduit.liquid.ItemLiquidConduit;
|
||||
import crazypants.enderio.conduit.me.ItemMEConduit;
|
||||
import crazypants.enderio.conduit.power.ItemPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.ItemRedstoneConduit;
|
||||
import crazypants.enderio.config.Config;
|
||||
@@ -199,6 +200,7 @@ public class EnderIO {
|
||||
public static ItemLiquidConduit itemLiquidConduit;
|
||||
public static ItemItemConduit itemItemConduit;
|
||||
public static ItemGasConduit itemGasConduit;
|
||||
public static ItemMEConduit itemMEConduit;
|
||||
public static ItemBasicItemFilter itemBasicFilterUpgrade;
|
||||
public static ItemExistingItemFilter itemExistingItemFilter;
|
||||
public static ItemModItemFilter itemModItemFilter;
|
||||
@@ -363,6 +365,7 @@ public class EnderIO {
|
||||
itemLiquidConduit = ItemLiquidConduit.create();
|
||||
itemItemConduit = ItemItemConduit.create();
|
||||
itemGasConduit = ItemGasConduit.create();
|
||||
itemMEConduit = ItemMEConduit.create();
|
||||
|
||||
itemBasicFilterUpgrade = ItemBasicItemFilter.create();
|
||||
itemExistingItemFilter = ItemExistingItemFilter.create();
|
||||
|
||||
@@ -12,6 +12,7 @@ public enum ModObject {
|
||||
itemRedstoneConduit,
|
||||
itemItemConduit,
|
||||
itemGasConduit,
|
||||
itemMEConduit,
|
||||
itemBasicFilterUpgrade,
|
||||
itemExistingItemFilter,
|
||||
itemModItemFilter,
|
||||
|
||||
@@ -181,7 +181,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockCoord getLocation() {
|
||||
public BlockCoord getBlockCoord() {
|
||||
if(bundle == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (IConduit con : conduits) {
|
||||
sb.append(con.getLocation());
|
||||
sb.append(con.getBlockCoord());
|
||||
sb.append(", ");
|
||||
}
|
||||
return "AbstractConduitNetwork [conduits=" + sb.toString() + "]";
|
||||
|
||||
@@ -36,6 +36,8 @@ import crazypants.enderio.conduit.liquid.EnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduitNetwork;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.LiquidConduitNetwork;
|
||||
import crazypants.enderio.conduit.me.IMEConduit;
|
||||
import crazypants.enderio.conduit.me.MEConduitNetwork;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
@@ -65,6 +67,8 @@ public class ConduitUtil {
|
||||
return new ItemConduitNetwork();
|
||||
} else if(IGasConduit.class.isAssignableFrom(type)) {
|
||||
return new GasConduitNetwork();
|
||||
} else if(IMEConduit.class.isAssignableFrom(type)) {
|
||||
return new MEConduitNetwork();
|
||||
}
|
||||
FMLCommonHandler.instance().raiseException(new Exception("Could not determine network type for class " + type), "ConduitUtil.createNetworkForType", false);
|
||||
return null;
|
||||
@@ -108,7 +112,7 @@ public class ConduitUtil {
|
||||
|
||||
public static <T extends IConduit> void disconectConduits(T con, ForgeDirection connDir) {
|
||||
con.conduitConnectionRemoved(connDir);
|
||||
BlockCoord loc = con.getLocation().getLocation(connDir);
|
||||
BlockCoord loc = con.getBlockCoord().getLocation(connDir);
|
||||
IConduit neighbour = ConduitUtil.getConduit(con.getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, con.getBaseConduitType());
|
||||
if(neighbour != null) {
|
||||
neighbour.conduitConnectionRemoved(connDir.getOpposite());
|
||||
@@ -122,7 +126,7 @@ public class ConduitUtil {
|
||||
}
|
||||
|
||||
public static <T extends IConduit> boolean joinConduits(T con, ForgeDirection faceHit) {
|
||||
BlockCoord loc = con.getLocation().getLocation(faceHit);
|
||||
BlockCoord loc = con.getBlockCoord().getLocation(faceHit);
|
||||
IConduit neighbour = ConduitUtil.getConduit(con.getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, con.getBaseConduitType());
|
||||
if(neighbour != null && con.canConnectToConduit(faceHit, neighbour) && neighbour.canConnectToConduit(faceHit.getOpposite(), con)) {
|
||||
con.conduitConnectionAdded(faceHit);
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface IConduit {
|
||||
|
||||
void onRemovedFromBundle();
|
||||
|
||||
BlockCoord getLocation();
|
||||
BlockCoord getBlockCoord();
|
||||
|
||||
// Conections
|
||||
boolean hasConnections();
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -12,6 +13,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import cofh.api.transport.IItemDuct;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
@@ -19,7 +21,8 @@ import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.power.IInternalPowerReceptor;
|
||||
import crazypants.util.BlockCoord;
|
||||
|
||||
public interface IConduitBundle extends IInternalPowerReceptor, IFluidHandler, IItemDuct, IGasHandler {
|
||||
@Interface(iface = "appeng.api.networking.IGridHost", modid = "appliedenergistics2")
|
||||
public interface IConduitBundle extends IInternalPowerReceptor, IFluidHandler, IItemDuct, IGasHandler, IGridHost {
|
||||
|
||||
TileEntity getEntity();
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
@@ -32,6 +35,7 @@ import crazypants.enderio.conduit.geom.Offsets;
|
||||
import crazypants.enderio.conduit.geom.Offsets.Axis;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.me.IMEConduit;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
|
||||
import crazypants.enderio.config.Config;
|
||||
@@ -836,7 +840,28 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
public World getWorld() {
|
||||
return getWorldObj();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* AE2 */
|
||||
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public IGridNode getGridNode(ForgeDirection dir) {
|
||||
IMEConduit cond = getConduit(IMEConduit.class);
|
||||
if (cond != null) {
|
||||
return cond.getGridNode(dir);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public AECableType getCableConnectionType(ForgeDirection dir) {
|
||||
return AECableType.GLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public void securityBreak() {
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public abstract class AbstractGasConduit extends AbstractConduit implements IGas
|
||||
protected boolean redstoneStateDirty = true;
|
||||
|
||||
public IGasHandler getExternalHandler(ForgeDirection direction) {
|
||||
IGasHandler con = GasUtil.getExternalGasHandler(getBundle().getWorld(), getLocation().getLocation(direction));
|
||||
IGasHandler con = GasUtil.getExternalGasHandler(getBundle().getWorld(), getBlockCoord().getLocation(direction));
|
||||
return (con != null && !(con instanceof IConduitBundle)) ? con : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class AbstractGasTankConduit extends AbstractGasConduit {
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockCoord loc = getLocation().getLocation(faceHit);
|
||||
BlockCoord loc = getBlockCoord().getLocation(faceHit);
|
||||
IGasConduit n = ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, IGasConduit.class);
|
||||
if(n == null) {
|
||||
return false;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
BlockCoord loc = getBlockCoord();
|
||||
if(!hasConnectionMode(ConnectionMode.INPUT)) {
|
||||
return;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
if(network == null) {
|
||||
return;
|
||||
}
|
||||
GasOutput lo = new GasOutput(getLocation().getLocation(dir), dir.getOpposite());
|
||||
GasOutput lo = new GasOutput(getBlockCoord().getLocation(dir), dir.getOpposite());
|
||||
network.removeInput(lo);
|
||||
if(getConectionMode(dir).acceptsOutput() && containsExternalConnection(dir)) {
|
||||
network.addInput(lo);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
}
|
||||
for (ForgeDirection dir : con.getExternalConnections()) {
|
||||
if(con.getConectionMode(dir).acceptsOutput()) {
|
||||
outputs.add(new GasOutput(con.getLocation().getLocation(dir), dir.getOpposite()));
|
||||
outputs.add(new GasOutput(con.getBlockCoord().getLocation(dir), dir.getOpposite()));
|
||||
}
|
||||
}
|
||||
outputIterator = null;
|
||||
@@ -91,7 +91,7 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
leftOvers--;
|
||||
}
|
||||
con.getTank().setGas(f);
|
||||
BlockCoord bc = con.getLocation();
|
||||
BlockCoord bc = con.getBlockCoord();
|
||||
con.getBundle().getEntity().getWorldObj().markTileEntityChunkModified(bc.x, bc.y, bc.z, con.getBundle().getEntity());
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
}
|
||||
|
||||
public IGasHandler getTankContainer(GasConduit con, ForgeDirection dir) {
|
||||
BlockCoord bc = con.getLocation().getLocation(dir);
|
||||
BlockCoord bc = con.getBlockCoord().getLocation(dir);
|
||||
return getTankContainer(bc);
|
||||
}
|
||||
|
||||
|
||||
@@ -444,7 +444,7 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
if(world == null) {
|
||||
return null;
|
||||
}
|
||||
BlockCoord loc = getLocation().getLocation(direction);
|
||||
BlockCoord loc = getBlockCoord().getLocation(direction);
|
||||
TileEntity te = world.getTileEntity(loc.x, loc.y, loc.z);
|
||||
if(te instanceof IInventory && !(te instanceof IConduitBundle)) {
|
||||
return (IInventory) te;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
@Override
|
||||
public void addConduit(IItemConduit con) {
|
||||
super.addConduit(con);
|
||||
conMap.put(con.getLocation(), con);
|
||||
conMap.put(con.getBlockCoord(), con);
|
||||
|
||||
TileEntity te = con.getBundle().getEntity();
|
||||
if(te != null) {
|
||||
@@ -91,7 +91,7 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
List<NetworkedInventory> invs = getOrCreate(bc);
|
||||
NetworkedInventory remove = null;
|
||||
for (NetworkedInventory ni : invs) {
|
||||
if(ni.con.getLocation().equals(itemConduit.getLocation())) {
|
||||
if(ni.con.getBlockCoord().equals(itemConduit.getBlockCoord())) {
|
||||
remove = ni;
|
||||
break;
|
||||
}
|
||||
@@ -119,13 +119,13 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
|
||||
try {
|
||||
doingSend = true;
|
||||
BlockCoord loc = itemConduit.getLocation().getLocation(side);
|
||||
BlockCoord loc = itemConduit.getBlockCoord().getLocation(side);
|
||||
|
||||
ItemStack result = item.copy();
|
||||
List<NetworkedInventory> invs = getOrCreate(loc);
|
||||
for (NetworkedInventory inv : invs) {
|
||||
|
||||
if(inv.con.getLocation().equals(itemConduit.getLocation())) {
|
||||
if(inv.con.getBlockCoord().equals(itemConduit.getBlockCoord())) {
|
||||
int numInserted = inv.insertIntoTargets(item.copy());
|
||||
if(numInserted >= item.stackSize) {
|
||||
return null;
|
||||
@@ -145,7 +145,7 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
List<NetworkedInventory> invs = getOrCreate(extractFrom);
|
||||
for (NetworkedInventory source : invs) {
|
||||
|
||||
if(source.con.getLocation().equals(con.getLocation())) {
|
||||
if(source.con.getBlockCoord().equals(con.getBlockCoord())) {
|
||||
if(source != null && source.sendPriority != null) {
|
||||
for (Target t : source.sendPriority) {
|
||||
IItemFilter f = t.inv.con.getOutputFilter(t.inv.conDir);
|
||||
|
||||
@@ -293,7 +293,7 @@ public class NetworkedInventory {
|
||||
if(!result.isEmpty()) {
|
||||
Map<BlockCoord, Integer> visited = new HashMap<BlockCoord, Integer>();
|
||||
List<BlockCoord> steps = new ArrayList<BlockCoord>();
|
||||
steps.add(con.getLocation());
|
||||
steps.add(con.getBlockCoord());
|
||||
calculateDistances(result, visited, steps, 0);
|
||||
|
||||
sendPriority.addAll(result);
|
||||
@@ -339,15 +339,15 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
private Target getTarget(List<Target> targets, IItemConduit con, ForgeDirection dir) {
|
||||
if(targets == null || con == null || con.getLocation() == null) {
|
||||
if(targets == null || con == null || con.getBlockCoord() == null) {
|
||||
return null;
|
||||
}
|
||||
for (Target target : targets) {
|
||||
BlockCoord targetConLoc = null;
|
||||
if(target != null && target.inv != null && target.inv.con != null) {
|
||||
targetConLoc = target.inv.con.getLocation();
|
||||
targetConLoc = target.inv.con.getBlockCoord();
|
||||
}
|
||||
if(targetConLoc != null && target.inv.conDir == dir && targetConLoc.equals(con.getLocation())) {
|
||||
if(targetConLoc != null && target.inv.conDir == dir && targetConLoc.equals(con.getBlockCoord())) {
|
||||
return target;
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,7 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
private int distanceTo(NetworkedInventory other) {
|
||||
return con.getLocation().distanceSquared(other.con.getLocation());
|
||||
return con.getBlockCoord().distanceSquared(other.con.getBlockCoord());
|
||||
}
|
||||
|
||||
public ISidedInventory getInventory() {
|
||||
|
||||
@@ -30,7 +30,7 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
protected boolean redstoneStateDirty = true;
|
||||
|
||||
public IFluidHandler getExternalHandler(ForgeDirection direction) {
|
||||
IFluidHandler con = FluidUtil.getExternalFluidHandler(getBundle().getWorld(), getLocation().getLocation(direction));
|
||||
IFluidHandler con = FluidUtil.getExternalFluidHandler(getBundle().getWorld(), getBlockCoord().getLocation(direction));
|
||||
return (con != null && !(con instanceof IConduitBundle)) ? con : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public abstract class AbstractTankConduit extends AbstractLiquidConduit {
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockCoord loc = getLocation().getLocation(faceHit);
|
||||
BlockCoord loc = getBlockCoord().getLocation(faceHit);
|
||||
ILiquidConduit n = ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, ILiquidConduit.class);
|
||||
if(n == null) {
|
||||
return false;
|
||||
|
||||
@@ -84,7 +84,7 @@ public class AdvancedLiquidConduit extends AbstractTankConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
BlockCoord loc = getBlockCoord();
|
||||
if(!hasConnectionMode(ConnectionMode.INPUT)) {
|
||||
return;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public class AdvancedLiquidConduit extends AbstractTankConduit {
|
||||
if(network == null) {
|
||||
return;
|
||||
}
|
||||
LiquidOutput lo = new LiquidOutput(getLocation().getLocation(dir), dir.getOpposite());
|
||||
LiquidOutput lo = new LiquidOutput(getBlockCoord().getLocation(dir), dir.getOpposite());
|
||||
network.removeInput(lo);
|
||||
if(getConectionMode(dir).acceptsOutput() && containsExternalConnection(dir)) {
|
||||
network.addInput(lo);
|
||||
|
||||
@@ -55,7 +55,7 @@ public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<Adv
|
||||
}
|
||||
for (ForgeDirection dir : con.getExternalConnections()) {
|
||||
if(con.getConectionMode(dir).acceptsOutput()) {
|
||||
outputs.add(new LiquidOutput(con.getLocation().getLocation(dir), dir.getOpposite()));
|
||||
outputs.add(new LiquidOutput(con.getBlockCoord().getLocation(dir), dir.getOpposite()));
|
||||
}
|
||||
}
|
||||
outputIterator = null;
|
||||
@@ -102,7 +102,7 @@ public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<Adv
|
||||
leftOvers--;
|
||||
}
|
||||
con.getTank().setLiquid(f);
|
||||
BlockCoord bc = con.getLocation();
|
||||
BlockCoord bc = con.getBlockCoord();
|
||||
con.getBundle().getEntity().getWorldObj().markTileEntityChunkModified(bc.x, bc.y, bc.z, con.getBundle().getEntity());
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<Adv
|
||||
}
|
||||
|
||||
public IFluidHandler getTankContainer(AdvancedLiquidConduit con, ForgeDirection dir) {
|
||||
BlockCoord bc = con.getLocation().getLocation(dir);
|
||||
BlockCoord bc = con.getBlockCoord().getLocation(dir);
|
||||
return getTankContainer(bc);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public class EnderLiquidConduit extends AbstractLiquidConduit {
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockCoord loc = getLocation().getLocation(faceHit);
|
||||
BlockCoord loc = getBlockCoord().getLocation(faceHit);
|
||||
ILiquidConduit n = ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, ILiquidConduit.class);
|
||||
if(n == null) {
|
||||
return false;
|
||||
@@ -217,7 +217,7 @@ public class EnderLiquidConduit extends AbstractLiquidConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
BlockCoord loc = getBlockCoord();
|
||||
if(!hasConnectionMode(ConnectionMode.INPUT)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
BlockCoord conduitLoc;
|
||||
|
||||
public NetworkTankKey(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
this(con.getLocation(), conDir);
|
||||
this(con.getBlockCoord(), conDir);
|
||||
}
|
||||
|
||||
public NetworkTankKey(BlockCoord conduitLoc, ForgeDirection conDir) {
|
||||
@@ -196,7 +196,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
public NetworkTank(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
this.con = con;
|
||||
this.conDir = conDir;
|
||||
conduitLoc = con.getLocation();
|
||||
conduitLoc = con.getBlockCoord();
|
||||
tankDir = conDir.getOpposite();
|
||||
externalTank = FluidUtil.getExternalFluidHandler(con.getBundle().getWorld(), conduitLoc.getLocation(conDir));
|
||||
acceptsOuput = con.getConectionMode(conDir).acceptsOutput();
|
||||
|
||||
@@ -110,7 +110,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
|
||||
//need to send a custom packet as we don't want want to trigger a full chunk update, just
|
||||
//need to get the required values to the entity renderer
|
||||
BlockCoord loc = getLocation();
|
||||
BlockCoord loc = getBlockCoord();
|
||||
PacketHandler.INSTANCE.sendToAllAround(new PacketFluidLevel(this), new TargetPoint(world.provider.dimensionId, loc.x, loc.y, loc.z, 64));
|
||||
lastSyncRatio = tank.getFilledRatio();
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
|
||||
private void doExtract() {
|
||||
|
||||
BlockCoord loc = getLocation();
|
||||
BlockCoord loc = getBlockCoord();
|
||||
if(!hasConnectionMode(ConnectionMode.INPUT)) {
|
||||
return;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
if(autoExtractForDir(dir)) {
|
||||
|
||||
IFluidHandler extTank = getTankContainer(getLocation().getLocation(dir));
|
||||
IFluidHandler extTank = getTankContainer(getBlockCoord().getLocation(dir));
|
||||
if(extTank != null) {
|
||||
|
||||
boolean foundFluid = false;
|
||||
@@ -193,13 +193,13 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
// Note: This is just a guard against mekansims pipes that will continuously
|
||||
// call
|
||||
// fill on us if we push liquid to them.
|
||||
if(filledFromThisTick.contains(getLocation().getLocation(from))) {
|
||||
if(filledFromThisTick.contains(getBlockCoord().getLocation(from))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(network.lockNetworkForFill()) {
|
||||
if(doFill) {
|
||||
filledFromThisTick.add(getLocation().getLocation(from));
|
||||
filledFromThisTick.add(getBlockCoord().getLocation(from));
|
||||
}
|
||||
try {
|
||||
int res = fill(from, resource, doFill, true, network == null ? -1 : network.getNextPushToken());
|
||||
@@ -287,7 +287,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
pushed += toCon;
|
||||
}
|
||||
} else if(getExternalConnections().contains(dir)) {
|
||||
IFluidHandler con = getTankContainer(getLocation().getLocation(dir));
|
||||
IFluidHandler con = getTankContainer(getBlockCoord().getLocation(dir));
|
||||
if(con != null) {
|
||||
int toExt = con.fill(dir.getOpposite(), toPush, doPush);
|
||||
toPush.amount -= toExt;
|
||||
|
||||
@@ -159,7 +159,7 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
if(con.canOutputToDir(dir)) {
|
||||
IFluidHandler externalTank = con.getExternalHandler(dir);
|
||||
if(externalTank != null) {
|
||||
externals.add(new LocatedFluidHandler(externalTank, con.getLocation().getLocation(dir), dir.getOpposite()));
|
||||
externals.add(new LocatedFluidHandler(externalTank, con.getBlockCoord().getLocation(dir), dir.getOpposite()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
}
|
||||
|
||||
private void drainConduitToNearestExternal(LiquidConduit con, List<LocatedFluidHandler> externals) {
|
||||
BlockCoord conLoc = con.getLocation();
|
||||
BlockCoord conLoc = con.getBlockCoord();
|
||||
FluidStack toDrain = con.getTank().getFluid();
|
||||
if(toDrain == null) {
|
||||
return;
|
||||
@@ -230,7 +230,7 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
|
||||
// First flow all we can down, then balance the rest
|
||||
if(con.getConduitConnections().contains(ForgeDirection.DOWN)) {
|
||||
BlockCoord loc = con.getLocation().getLocation(ForgeDirection.DOWN);
|
||||
BlockCoord loc = con.getBlockCoord().getLocation(ForgeDirection.DOWN);
|
||||
ILiquidConduit dc = ConduitUtil.getConduit(con.getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, ILiquidConduit.class);
|
||||
if(dc instanceof LiquidConduit) {
|
||||
LiquidConduit downCon = (LiquidConduit) dc;
|
||||
@@ -290,7 +290,7 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
}
|
||||
int totalCapacity = tank.getCapacity();
|
||||
|
||||
BlockCoord loc = con.getLocation();
|
||||
BlockCoord loc = con.getBlockCoord();
|
||||
Collection<ILiquidConduit> connections =
|
||||
ConduitUtil.getConnectedConduits(con.getBundle().getEntity().getWorldObj(),
|
||||
loc.x, loc.y, loc.z, ILiquidConduit.class);
|
||||
@@ -331,7 +331,7 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
if(neighbour.getNetwork() != this) {
|
||||
return false;
|
||||
}
|
||||
if(neighbour.getLocation().y > con.getLocation().y) {
|
||||
if(neighbour.getBlockCoord().y > con.getBlockCoord().y) {
|
||||
return false;
|
||||
}
|
||||
float nr = neighbour.getTank().getFilledRatio();
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package crazypants.enderio.conduit.me;
|
||||
|
||||
import appeng.me.helpers.IGridProxyable;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public interface IMEConduit extends IConduit, IGridProxyable {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package crazypants.enderio.conduit.me;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
|
||||
public class ItemMEConduit extends AbstractItemConduit {
|
||||
|
||||
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name(), "enderio:itemMEConduit"),
|
||||
};
|
||||
|
||||
public static ItemMEConduit create() {
|
||||
ItemMEConduit result = new ItemMEConduit();
|
||||
result.init(subtypes);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected ItemMEConduit() {
|
||||
super(ModObject.itemMEConduit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IConduit> getBaseConduitType() {
|
||||
return IMEConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack item) {
|
||||
return new MEConduit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package crazypants.enderio.conduit.me;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.events.MENetworkEvent;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
|
||||
public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
private IGridNode node;
|
||||
|
||||
protected MEConduitNetwork network;
|
||||
|
||||
protected MEConduitGrid grid;
|
||||
|
||||
public MEConduit() {
|
||||
grid = new MEConduitGrid(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IConduit> getBaseConduitType() {
|
||||
return IMEConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return new ItemStack(EnderIO.itemMEConduit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractConduitNetwork<?, ?> getNetwork() {
|
||||
return network;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setNetwork(AbstractConduitNetwork<?, ?> network) {
|
||||
this.network = (MEConduitNetwork) network;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTransmitionTextureForState(CollidableComponent component) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode(ForgeDirection dir) {
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void securityBreak() {
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType(ForgeDirection dir) {
|
||||
return AECableType.GLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AENetworkProxy getProxy() {
|
||||
return grid.getProxy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DimensionalCoord getLocation() {
|
||||
return new DimensionalCoord(getBundle().getEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gridChanged() {
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(World worldObj) {
|
||||
if(node == null && !worldObj.isRemote) {
|
||||
node = AEApi.instance().createGridNode(grid);
|
||||
node.updateState();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemovedFromBundle() {
|
||||
node.destroy();
|
||||
node = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package crazypants.enderio.conduit.me;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import scala.actors.threadpool.Arrays;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.GridNotification;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridBlock;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
|
||||
public class MEConduitGrid implements IGridBlock {
|
||||
|
||||
private IMEConduit conduit;
|
||||
|
||||
private AENetworkProxy proxy;
|
||||
|
||||
public MEConduitGrid(IMEConduit conduit) {
|
||||
this.conduit = conduit;
|
||||
proxy = new AENetworkProxy(conduit, "enderio:MEConduit", conduit.createItem(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getIdlePowerUsage() {
|
||||
return 0; // TODO Balance
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<GridFlags> getFlags() {
|
||||
return EnumSet.noneOf(GridFlags.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWorldAccessable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DimensionalCoord getLocation() {
|
||||
return new DimensionalCoord(conduit.getBundle().getEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AEColor getGridColor() {
|
||||
return AEColor.Transparent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGridNotification(GridNotification notification) {
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNetworkStatus(IGrid grid, int channelsInUse) {
|
||||
;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getConnectableSides() {
|
||||
return EnumSet.copyOf(Arrays.asList(ForgeDirection.VALID_DIRECTIONS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridHost getMachine() {
|
||||
return conduit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gridChanged() {
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getMachineRepresentation() {
|
||||
return conduit.createItem();
|
||||
}
|
||||
|
||||
public AENetworkProxy getProxy() {
|
||||
return proxy;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package crazypants.enderio.conduit.me;
|
||||
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
|
||||
public class MEConduitNetwork extends AbstractConduitNetwork<IMEConduit, IMEConduit> {
|
||||
|
||||
public MEConduitNetwork() {
|
||||
super(IMEConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<IMEConduit> getBaseConduitType() {
|
||||
return IMEConduit.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package crazypants.enderio.conduit.me;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.render.BoundingBox;
|
||||
import crazypants.render.CubeRenderer;
|
||||
import crazypants.util.ForgeDirectionOffsets;
|
||||
import crazypants.vecmath.Vector3d;
|
||||
|
||||
public class MEConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
return conduit instanceof IMEConduit;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float selfIllum) {
|
||||
if(IPowerConduit.COLOR_CONTROLLER_ID.equals(component.data)) {
|
||||
IPowerConduit pc = (IPowerConduit) conduit;
|
||||
ConnectionMode conMode = pc.getConectionMode(component.dir);
|
||||
if(conduit.containsExternalConnection(component.dir) && pc.getExtractionRedstoneMode(component.dir) != RedstoneControlMode.IGNORE
|
||||
&& conMode != ConnectionMode.DISABLED) {
|
||||
int c = ((IPowerConduit) conduit).getExtractionSignalColor(component.dir).getColor();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_I(c);
|
||||
|
||||
Offset offset = conduit.getBundle().getOffset(IPowerConduit.class, component.dir);
|
||||
BoundingBox bound = component.bound;
|
||||
if(conMode != ConnectionMode.IN_OUT) {
|
||||
Vector3d trans = ForgeDirectionOffsets.offsetScaled(component.dir, -0.075);
|
||||
bound = bound.translate(trans);
|
||||
}
|
||||
CubeRenderer.render(bound, tex);
|
||||
tessellator.setColorOpaque(255, 255, 255);
|
||||
}
|
||||
} else {
|
||||
super.renderConduit(tex, conduit, component, selfIllum);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
|
||||
} else if(connDir == ForgeDirection.UNKNOWN || connDir == faceHit) {
|
||||
|
||||
BlockCoord loc = getLocation().getLocation(faceHit);
|
||||
BlockCoord loc = getBlockCoord().getLocation(faceHit);
|
||||
Block id = world.getBlock(loc.x, loc.y, loc.z);
|
||||
if(id == EnderIO.blockConduitBundle) {
|
||||
IRedstoneConduit neighbour = ConduitUtil.getConduit(world, loc.x, loc.y, loc.z, IRedstoneConduit.class);
|
||||
@@ -126,7 +126,7 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
return true;
|
||||
|
||||
} else if(containsConduitConnection(connDir)) {
|
||||
BlockCoord loc = getLocation().getLocation(connDir);
|
||||
BlockCoord loc = getBlockCoord().getLocation(connDir);
|
||||
IRedstoneConduit neighbour = ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, IRedstoneConduit.class);
|
||||
if(neighbour != null) {
|
||||
if(network != null) {
|
||||
@@ -256,7 +256,7 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
return true;
|
||||
}
|
||||
//Not set so figure it out
|
||||
BlockCoord loc = getLocation().getLocation(direction);
|
||||
BlockCoord loc = getBlockCoord().getLocation(direction);
|
||||
Block block = getBundle().getEntity().getWorldObj().getBlock(loc.x, loc.y, loc.z);
|
||||
|
||||
if(VANILLA_CONECTABLES.contains(block)) {
|
||||
|
||||
@@ -101,7 +101,7 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
}
|
||||
|
||||
protected boolean acceptSignalsForDir(ForgeDirection dir) {
|
||||
BlockCoord loc = getLocation().getLocation(dir);
|
||||
BlockCoord loc = getBlockCoord().getLocation(dir);
|
||||
return ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, IRedstoneConduit.class) == null;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
int input = getExternalPowerLevel(dir);
|
||||
if(input > 1) { // need to degrade external signals by one as they
|
||||
// enter
|
||||
BlockCoord loc = getLocation().getLocation(dir);
|
||||
BlockCoord loc = getBlockCoord().getLocation(dir);
|
||||
Signal signal = new Signal(loc.x, loc.y, loc.z, dir, input - 1, getSignalColor(dir));
|
||||
res.add(signal);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
// RedNet API, without requiring a piece of RedNet cable in-between.
|
||||
int[] bundledInput = getExternalBundledPowerLevel(dir);
|
||||
if(bundledInput != null) {
|
||||
BlockCoord loc = getLocation().getLocation(dir);
|
||||
BlockCoord loc = getBlockCoord().getLocation(dir);
|
||||
for (int subnet = 0; subnet < bundledInput.length; ++subnet) {
|
||||
if(bundledInput[subnet] > 1) { // force signal strength reduction to avoid cycles
|
||||
int color = convertColorForRedNet(subnet);
|
||||
@@ -196,7 +196,7 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
//returns 16 for string power inputs
|
||||
protected int getExternalPowerLevel(ForgeDirection dir) {
|
||||
World world = getBundle().getEntity().getWorldObj();
|
||||
BlockCoord loc = getLocation();
|
||||
BlockCoord loc = getBlockCoord();
|
||||
loc = loc.getLocation(dir);
|
||||
|
||||
int strong = world.isBlockProvidingPowerTo(loc.x, loc.y, loc.z, dir.ordinal());
|
||||
@@ -214,7 +214,7 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
|
||||
protected int[] getExternalBundledPowerLevel(ForgeDirection dir) {
|
||||
World world = getBundle().getEntity().getWorldObj();
|
||||
BlockCoord loc = getLocation();
|
||||
BlockCoord loc = getBlockCoord();
|
||||
loc = loc.getLocation(dir);
|
||||
|
||||
Block block = world.getBlock(loc.x, loc.y, loc.z);
|
||||
@@ -266,7 +266,7 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
|
||||
Set<Signal> outs = network != null ? network.getSignals() : null;
|
||||
if(outs != null) {
|
||||
BlockCoord loc = getLocation().getLocation(side);
|
||||
BlockCoord loc = getBlockCoord().getLocation(side);
|
||||
for (Signal s : outs) {
|
||||
// Avoid "feedback loops", i.e. don't report an output on a side where
|
||||
// we have an input (otherwise a RedNet cable connected to a conduit
|
||||
@@ -289,7 +289,7 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
public int getOutputValue(World world, int x, int y, int z, ForgeDirection side, int subnet) {
|
||||
Set<Signal> outs = network != null ? network.getSignals() : null;
|
||||
if(outs != null) {
|
||||
BlockCoord loc = getLocation().getLocation(side);
|
||||
BlockCoord loc = getBlockCoord().getLocation(side);
|
||||
int color = convertColorForRedNet(subnet);
|
||||
for (Signal s : outs) {
|
||||
// Avoid "feedback loops", see comment in getOutputValues.
|
||||
@@ -312,7 +312,7 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
// with zero signal strength no signals are stored.
|
||||
Set<Signal> inputs = getNetworkInputs(side);
|
||||
externalSignals.get(side.ordinal()).clear();
|
||||
BlockCoord loc = getLocation().getLocation(side);
|
||||
BlockCoord loc = getBlockCoord().getLocation(side);
|
||||
for (int subnet = 0; subnet < inputValues.length; ++subnet) {
|
||||
int color = convertColorForRedNet(subnet);
|
||||
int newInput = inputValues[subnet];
|
||||
|
||||
@@ -129,7 +129,7 @@ public class RedstoneSwitch extends RedstoneConduit {
|
||||
public Set<Signal> getNetworkInputs() {
|
||||
Set<Signal> res = super.getNetworkInputs();
|
||||
if(isOn) {
|
||||
BlockCoord loc = getLocation();
|
||||
BlockCoord loc = getBlockCoord();
|
||||
Signal signal = new Signal(loc.x, loc.y, loc.z, ForgeDirection.UNKNOWN, 15, DyeColor.RED);
|
||||
res.add(signal);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class PacketConduitProbe implements IMessage, IMessageHandler<PacketCondu
|
||||
sb.append(input.getDisplayName());
|
||||
}
|
||||
sb.append(" ");
|
||||
List<String> targets = icn.getTargetsForExtraction(conduit.getLocation().getLocation(dir), conduit, input);
|
||||
List<String> targets = icn.getTargetsForExtraction(conduit.getBlockCoord().getLocation(dir), conduit, input);
|
||||
if(targets.isEmpty()) {
|
||||
sb.append(" ");
|
||||
sb.append(Lang.localize("gui.mjReader.noOutputs"));
|
||||
|
||||
Reference in new issue
Block a user