This commit is contained in:
asiekierka 2015-08-03 18:16:10 +02:00
parent 8b5c76d401
commit 2fb8e04972
2 changed files with 11 additions and 19 deletions

View file

@ -5,8 +5,10 @@ Improvements:
Bugs fixed:
* [#2942] Autarchic Gates not reacting to short pulses on Single Energy Pulse mode (asie)
* [#2935, attempted] Programming Table robot board mixups (asie)
* [#2929] Builders unable to place liquid in survival mode (asie)
* [#2921] Architect Table's defined area box not visible >64 blocks (ganymedes01)
* [#2914] Advanced Crafting Table excess tick times in certain circumstances (asie)
* [#2898] Robot crash on chunk unload/reload (hea3ven)
* Fluid tanks rendering incorrectly in Builder (asie)

View file

@ -16,11 +16,13 @@ import net.minecraftforge.common.util.ForgeDirection;
import cofh.api.energy.IEnergyHandler;
import buildcraft.BuildCraftTransport;
import buildcraft.api.core.BCLog;
import buildcraft.api.gates.GateExpansionController;
import buildcraft.api.gates.IGate;
import buildcraft.api.gates.IGateExpansion;
import buildcraft.api.statements.IActionInternal;
import buildcraft.api.statements.IStatement;
import buildcraft.core.lib.utils.MathUtils;
import buildcraft.transport.statements.ActionEnergyPulsar;
import buildcraft.transport.statements.ActionSingleEnergyPulse;
@ -38,7 +40,6 @@ public final class GateExpansionPulsar extends GateExpansionBuildcraft implement
}
private class GateExpansionControllerPulsar extends GateExpansionController {
private static final int PULSE_PERIOD = 10;
private boolean isActive;
private boolean singlePulse;
@ -58,7 +59,7 @@ public final class GateExpansionPulsar extends GateExpansionBuildcraft implement
@Override
public void startResolution() {
if (isActive()) {
if (isActive) {
disablePulse();
}
}
@ -84,46 +85,35 @@ public final class GateExpansionPulsar extends GateExpansionBuildcraft implement
@Override
public void tick(IGate gate) {
if (!isActive && hasPulsed) {
hasPulsed = false;
}
if (tick++ % PULSE_PERIOD != 0) {
// only do the treatement once every period
return;
}
if (!isActive) {
gate.setPulsing(false);
return;
}
gate.setPulsing(isActive);
if (pipeTile instanceof IEnergyHandler && (!singlePulse || !hasPulsed)) {
gate.setPulsing(true);
((IEnergyHandler) pipeTile).receiveEnergy(ForgeDirection.UNKNOWN, Math.min(1 << (count - 1), 64) * 10,
if (pipeTile instanceof IEnergyHandler && ((singlePulse && !hasPulsed) || (!singlePulse && isActive))) {
((IEnergyHandler) pipeTile).receiveEnergy(ForgeDirection.UNKNOWN, MathUtils.clamp(1 << (count - 1), 1, 64) * 10,
false);
hasPulsed = true;
} else {
gate.setPulsing(true);
}
}
private void enableSinglePulse(int count) {
singlePulse = true;
isActive = true;
singlePulse = true;
hasPulsed = false;
this.count = count;
}
private void enablePulse(int count) {
isActive = true;
hasPulsed = false;
singlePulse = false;
this.count = count;
}
private void disablePulse() {
if (!isActive) {
hasPulsed = false;
}
isActive = false;
this.count = 0;
}