Fix Bugs
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-07-25 17:58:36 -04:00
parent 0fb24c7258
commit 20214848ab
2 changed files with 8 additions and 2 deletions

View File

@ -98,7 +98,7 @@ public class StructureGeneratorBlock extends SimpleBlockWithEntity {
} }
public void schedule(World world, BlockPos pos) { public void schedule(World world, BlockPos pos) {
world.getBlockTickScheduler().schedule(pos, this, 0); world.getBlockTickScheduler().schedule(pos, this, 4);
} }
@Override @Override

View File

@ -25,7 +25,11 @@ public abstract class EnergyReceiverBlockEntity extends EnergyProviderBlockEntit
private long totalCost = 0; private long totalCost = 0;
private long previousTotalCost = 0; private long previousTotalCost = 0;
private final List<Action.PropagatedAction> sent = new ArrayList<>();
protected void propagateAction(Action.PropagatedAction action) { protected void propagateAction(Action.PropagatedAction action) {
sent.add(action);
totalCost = totalCost + action.amountOwed(); totalCost = totalCost + action.amountOwed();
if (providers.size() > 0) { if (providers.size() > 0) {
action.expandPayments(providers.size()); action.expandPayments(providers.size());
@ -43,6 +47,8 @@ public abstract class EnergyReceiverBlockEntity extends EnergyProviderBlockEntit
@Override @Override
public List<EnergyProviderBlockEntity> startTick() { public List<EnergyProviderBlockEntity> startTick() {
sent.clear();
List<EnergyProviderBlockEntity> list = new ArrayList<>(super.startTick()); List<EnergyProviderBlockEntity> list = new ArrayList<>(super.startTick());
ServerWorld world = (ServerWorld) getWorld(); ServerWorld world = (ServerWorld) getWorld();
@ -84,7 +90,7 @@ public abstract class EnergyReceiverBlockEntity extends EnergyProviderBlockEntit
protected void handlePropagatedAction(Action.PropagatedAction action) { protected void handlePropagatedAction(Action.PropagatedAction action) {
super.handlePropagatedAction(action); super.handlePropagatedAction(action);
// Propagate Action To Energy Providers // Propagate Action To Energy Providers
if (isEnergyProviderActive()) { if (isEnergyProviderActive() && !sent.contains(action)) {
propagateAction(action); propagateAction(action);
} else { } else {
action.pay(0); action.pay(0);