mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-28 07:55:41 +00:00
Merge branch 'master' into 1.6.4
This commit is contained in:
commit
efbf145f2a
6 files changed
+37
-6
No files matched your search
@@ -36,6 +36,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitConnectorType;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.render.BoundingBox;
|
||||
@@ -351,6 +352,9 @@ public class BlockConduitBundle extends Block implements ITileEntityProvider, IC
|
||||
IConduitBundle bundle = (IConduitBundle) te;
|
||||
IRedstoneConduit con = bundle.getConduit(IRedstoneConduit.class);
|
||||
if(con != null) {
|
||||
if(con instanceof IInsulatedRedstoneConduit) {
|
||||
((IInsulatedRedstoneConduit) con).onInputsChanged(side, inputValues);
|
||||
}
|
||||
con.onNeighborBlockChange(world.getBlockId(x, y, z));
|
||||
}
|
||||
}
|
||||
@@ -364,6 +368,9 @@ public class BlockConduitBundle extends Block implements ITileEntityProvider, IC
|
||||
IConduitBundle bundle = (IConduitBundle) te;
|
||||
IRedstoneConduit con = bundle.getConduit(IRedstoneConduit.class);
|
||||
if(con != null) {
|
||||
if(con instanceof IInsulatedRedstoneConduit) {
|
||||
((IInsulatedRedstoneConduit) con).onInputChanged(side, inputValue);
|
||||
}
|
||||
con.onNeighborBlockChange(world.getBlockId(x, y, z));
|
||||
}
|
||||
}
|
||||
@@ -467,6 +474,10 @@ public class BlockConduitBundle extends Block implements ITileEntityProvider, IC
|
||||
return false;
|
||||
}
|
||||
|
||||
if(PainterUtil.getSourceBlockId(player.getCurrentEquippedItem()) <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bundle.setFacadeId(PainterUtil.getSourceBlockId(player.getCurrentEquippedItem()));
|
||||
bundle.setFacadeMetadata(PainterUtil.getSourceBlockMetadata(player.getCurrentEquippedItem()));
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
|
||||
@@ -416,6 +416,8 @@ public class NetworkPowerManager {
|
||||
|
||||
float canExtract;
|
||||
float canFill;
|
||||
Set<TileCapacitorBank> capBanks = new HashSet<TileCapacitorBank>();
|
||||
|
||||
float filledRatio;
|
||||
float stored = 0;
|
||||
float maxCap = 0;
|
||||
@@ -427,6 +429,7 @@ public class NetworkPowerManager {
|
||||
}
|
||||
|
||||
void init() {
|
||||
capBanks.clear();
|
||||
canExtract = 0;
|
||||
canFill = 0;
|
||||
stored = 0;
|
||||
@@ -435,8 +438,11 @@ public class NetworkPowerManager {
|
||||
for (ReceptorEntry rec : storageReceptors) {
|
||||
TileCapacitorBank cb = (TileCapacitorBank) rec.powerReceptor;
|
||||
|
||||
stored += cb.getEnergyStored();
|
||||
maxCap += cb.getMaxEnergyStored();
|
||||
if(!capBanks.contains(cb)) {
|
||||
stored += cb.getEnergyStored();
|
||||
maxCap += cb.getMaxEnergyStored();
|
||||
capBanks.add(cb);
|
||||
}
|
||||
|
||||
float canGet = 0;
|
||||
if(cb.isOutputEnabled()) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.conduit.redstone;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public interface IInsulatedRedstoneConduit extends IRedstoneConduit {
|
||||
|
||||
@@ -11,4 +12,7 @@ public interface IInsulatedRedstoneConduit extends IRedstoneConduit {
|
||||
|
||||
static final String COLOR_CONTROLLER_ID = "ColorController";
|
||||
|
||||
public void onInputsChanged(ForgeDirection side, int[] inputValues);
|
||||
|
||||
public void onInputChanged(ForgeDirection side, int inputValue);
|
||||
}
|
||||
@@ -170,6 +170,16 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
return InsulatedRedstoneConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInputsChanged(ForgeDirection side, int[] inputValues) {
|
||||
//System.out.println("InsulatedRedstoneConduit.onInputsChanged: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInputChanged(ForgeDirection side, int inputValue) {
|
||||
//System.out.println("InsulatedRedstoneConduit.onInputChanged: ");
|
||||
}
|
||||
|
||||
private SignalColor getSignalColorFromEquippedItem(ItemStack currentEquippedItem) {
|
||||
if(currentEquippedItem == null) {
|
||||
return null;
|
||||
|
||||
@@ -158,11 +158,11 @@ public class MJReaderPacketHandler implements IPacketProcessor {
|
||||
PowerReceiver rec = pr.getPowerReceiver(ForgeDirection.values()[side]);
|
||||
if(rec == null) {
|
||||
player.sendChatToPlayer(ChatMessageComponent.createFromText(block.getLocalizedName() + " cannot recieve power from this side."));
|
||||
} else {
|
||||
sendPowerReciptorInfo(player, block, rec.getEnergyStored(), rec.getMaxEnergyStored(), rec.getMinEnergyReceived(), rec.getMaxEnergyReceived(),
|
||||
rec.powerRequest());
|
||||
}
|
||||
|
||||
sendPowerReciptorInfo(player, block, rec.getEnergyStored(), rec.getMaxEnergyStored(), rec.getMinEnergyReceived(), rec.getMaxEnergyReceived(),
|
||||
rec.powerRequest());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
if(cur < max) {
|
||||
|
||||
float used = 0;
|
||||
if("appeng.common.base.AppEngMultiChargeable".equals(chargable.getClass().getName())) {
|
||||
if(chargable.getClass().getName().startsWith("appeng") || "appeng.common.base.AppEngMultiChargeable".equals(chargable.getClass().getName())) {
|
||||
//256 max limit
|
||||
canUse = Math.min(canUse, 256);
|
||||
NBTTagCompound tc = item.getTagCompound();
|
||||
|
||||
Reference in new issue
Block a user