Fix some minor logic derps in the energy pulser. Much better behaviour now.
This commit is contained in:
parent
a4e7e74d5e
commit
eb8d6cace2
1 changed files with 5 additions and 12 deletions
|
@ -18,23 +18,16 @@ public class EnergyPulser {
|
|||
}
|
||||
|
||||
public void update() {
|
||||
if (powerReceptor == null)
|
||||
if (powerReceptor == null || !isActive || tick++ % 10 != 0)
|
||||
return;
|
||||
|
||||
if (isActive)
|
||||
{
|
||||
tick++;
|
||||
if (!singlePulse || !hasPulsed) {
|
||||
if (tick % 10 == 0 || !hasPulsed)
|
||||
if (!singlePulse || !hasPulsed)
|
||||
{
|
||||
System.out.printf("Pulsing%d\n",Math.min(1 << (pulseCount-1),64));
|
||||
powerReceptor.getPowerProvider().receiveEnergy(Math.min(1 << (pulseCount-1),64), ForgeDirection.WEST);
|
||||
if (singlePulse) {
|
||||
hasPulsed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void enableSinglePulse(int count) {
|
||||
singlePulse = true;
|
||||
|
|
Loading…
Reference in a new issue