mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 23:13:21 +00:00
#518 Crash when breaking a TE redstone conduit, connected to an EIO power conduit, which is connected to a Power Monitor.
Merged from 1.6.4.
This commit is contained in:
commit
3e84d12b8f
6 files changed
+51
-38
No files matched your search
@@ -45,7 +45,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
private int lastNumConections = -1;
|
||||
|
||||
private boolean updateConnections = true;
|
||||
protected boolean connectionsDirty = true;
|
||||
|
||||
protected AbstractConduit() {
|
||||
}
|
||||
@@ -327,7 +327,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
if(!updateConnections) {
|
||||
if(!connectionsDirty) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
connectionsChanged();
|
||||
}
|
||||
|
||||
updateConnections = false;
|
||||
connectionsDirty = false;
|
||||
}
|
||||
|
||||
protected void connectionsChanged() {
|
||||
@@ -442,7 +442,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
return false;
|
||||
}
|
||||
|
||||
updateConnections = true;
|
||||
connectionsDirty = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -47,4 +47,6 @@ public interface IPowerConduit extends IConduit, IInternalPowerReceptor {
|
||||
|
||||
void setEnergyStored(float give);
|
||||
|
||||
boolean getConnectionsDirty();
|
||||
|
||||
}
|
||||
@@ -90,10 +90,12 @@ public class NetworkPowerManager {
|
||||
float result = 0;
|
||||
Set<IPowerInterface> done = new HashSet<IPowerInterface>();
|
||||
for (ReceptorEntry re : receptors) {
|
||||
IPowerInterface powerReceptor = re.powerInterface;
|
||||
if(!done.contains(powerReceptor)) {
|
||||
done.add(powerReceptor);
|
||||
result += powerReceptor.getEnergyStored(re.direction);
|
||||
if(!re.emmiter.getConnectionsDirty()) {
|
||||
IPowerInterface powerReceptor = re.powerInterface;
|
||||
if(!done.contains(powerReceptor)) {
|
||||
done.add(powerReceptor);
|
||||
result += powerReceptor.getEnergyStored(re.direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -103,10 +105,12 @@ public class NetworkPowerManager {
|
||||
float result = 0;
|
||||
Set<IPowerInterface> done = new HashSet<IPowerInterface>();
|
||||
for (ReceptorEntry re : receptors) {
|
||||
IPowerInterface powerReceptor = re.powerInterface;
|
||||
if(!done.contains(powerReceptor)) {
|
||||
done.add(powerReceptor);
|
||||
result += powerReceptor.getMaxEnergyStored(re.direction);
|
||||
if(!re.emmiter.getConnectionsDirty()) {
|
||||
IPowerInterface powerReceptor = re.powerInterface;
|
||||
if(!done.contains(powerReceptor)) {
|
||||
done.add(powerReceptor);
|
||||
result += powerReceptor.getMaxEnergyStored(re.direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -112,6 +112,11 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
//powerHandler = createPowerHandlerForType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectionsDirty() {
|
||||
return connectionsDirty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, RaytraceResult res, List<RaytraceResult> all) {
|
||||
DyeColor col = DyeColor.getColorFromDye(player.getCurrentEquippedItem());
|
||||
|
||||
@@ -124,33 +124,32 @@ public class TilePowerMonitor extends AbstractMachineEntity implements IInternal
|
||||
@Override
|
||||
protected boolean processTasks(boolean redstoneCheckPassed) {
|
||||
powerHandler.setEnergy(powerHandler.getEnergyStored() - energyPerTick);
|
||||
boolean update = worldObj.getWorldInfo().getWorldTotalTime() % 20 == 0;
|
||||
boolean update = worldObj.getWorldInfo().getWorldTotalTime() % 10 == 0;
|
||||
|
||||
// NetworkPowerManager pm = getPowerManager();
|
||||
// if(pm != null) {
|
||||
// if(pm != null && update) {
|
||||
// update(pm);
|
||||
// }
|
||||
|
||||
// Signal sig = null;
|
||||
// if(!engineControlEnabled) {
|
||||
// sig = null;
|
||||
// } else {
|
||||
// float percentFull = getPercentFull();
|
||||
// if(currentlyEmmittedSignal == null) {
|
||||
// if(percentFull <= startLevel) {
|
||||
// sig = new Signal(xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN, 15, signalColor);
|
||||
// }
|
||||
// Signal sig = null;
|
||||
// if(!engineControlEnabled) {
|
||||
// sig = null;
|
||||
// } else {
|
||||
// if(percentFull >= stopLevel) {
|
||||
// sig = null;
|
||||
// float percentFull = getPercentFull();
|
||||
// if(currentlyEmmittedSignal == null) {
|
||||
// if(percentFull <= startLevel) {
|
||||
// sig = new Signal(xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN, 15, signalColor);
|
||||
// }
|
||||
// } else {
|
||||
// sig = currentlyEmmittedSignal;
|
||||
// if(percentFull >= stopLevel) {
|
||||
// sig = null;
|
||||
// } else {
|
||||
// sig = currentlyEmmittedSignal;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if(currentlyEmmittedSignal != sig) {
|
||||
// currentlyEmmittedSignal = sig;
|
||||
// broadcastSignal();
|
||||
// if(currentlyEmmittedSignal != sig) {
|
||||
// currentlyEmmittedSignal = sig;
|
||||
// broadcastSignal();
|
||||
// }
|
||||
// }
|
||||
|
||||
return update;
|
||||
|
||||
Reference in new issue
Block a user