mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
Digital Miner now only accepts cable connections on certain sides
This commit is contained in:
1 parent
44d9aa506f
commit
4a78cb65b1
4 files changed
+34
-13
No files matched your search
@@ -9,6 +9,7 @@ import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
@@ -23,6 +24,8 @@ public interface IAdvancedBoundingBlock extends IBoundingBlock, ISidedInventory,
|
||||
public boolean canBoundInsert(Coord4D location, int i, ItemStack itemstack);
|
||||
|
||||
public boolean canBoundExtract(Coord4D location, int i, ItemStack itemstack, int j);
|
||||
|
||||
public boolean canBoundReceiveEnergy(Coord4D location, ForgeDirection side);
|
||||
|
||||
public void onPower();
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
|
||||
{
|
||||
if(getInv() == null)
|
||||
if(getInv() == null || !canReceiveEnergy(from))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -225,7 +225,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
return false;
|
||||
}
|
||||
|
||||
return getInv().canConnectEnergy(from);
|
||||
return canReceiveEnergy(from);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -286,7 +286,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
@Override
|
||||
public double transferEnergyToAcceptor(ForgeDirection side, double amount)
|
||||
{
|
||||
if(getInv() == null)
|
||||
if(getInv() == null || !canReceiveEnergy(side))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
return false;
|
||||
}
|
||||
|
||||
return getInv().canReceiveEnergy(side);
|
||||
return getInv().canBoundReceiveEnergy(Coord4D.get(this), side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -321,7 +321,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
@Method(modid = "IC2")
|
||||
public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage)
|
||||
{
|
||||
if(getInv() == null)
|
||||
if(getInv() == null || !canReceiveEnergy(directionFrom))
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.BitSet;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@@ -1099,7 +1100,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
@Override
|
||||
public boolean lightUpdate()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1491,6 +1492,30 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBoundReceiveEnergy(Coord4D coord, ForgeDirection side)
|
||||
{
|
||||
ForgeDirection left = MekanismUtils.getLeft(facing);
|
||||
ForgeDirection right = MekanismUtils.getRight(facing);
|
||||
|
||||
if(coord.equals(Coord4D.get(this).getFromSide(left)))
|
||||
{
|
||||
return side == left;
|
||||
}
|
||||
else if(coord.equals(Coord4D.get(this).getFromSide(right)))
|
||||
{
|
||||
return side == right;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getConsumingSides()
|
||||
{
|
||||
return EnumSet.of(MekanismUtils.getLeft(facing), MekanismUtils.getRight(facing), ForgeDirection.DOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
|
||||
@@ -51,7 +51,6 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
public int pulseOperations;
|
||||
|
||||
public RecipeFormula formula;
|
||||
public RecipeFormula prevFormula;
|
||||
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
@@ -136,12 +135,6 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
||||
formula = null;
|
||||
}
|
||||
|
||||
if(formula != prevFormula)
|
||||
{
|
||||
prevFormula = formula;
|
||||
markDirty();
|
||||
}
|
||||
|
||||
if(autoMode && formula == null)
|
||||
{
|
||||
toggleAutoMode();
|
||||
|
||||
Reference in new issue
Block a user