Fix poofing ¬ working if conveyor was backed up

This commit is contained in:
Patrick 'Quezler' Mounier
2020-01-07 10:44:37 +01:00
parent 252817abb7
commit 12c3b22b7c

View File

@ -107,7 +107,6 @@ public class CraterConveyor extends BaseConveyor{
}else{
// poof out crater
if(entity.items.total() == 0){
Effects.effect(Fx.plasticburn, tile.drawx(), tile.drawy());
entity.link = Pos.invalid;
return;
}
@ -129,6 +128,7 @@ public class CraterConveyor extends BaseConveyor{
if(entity.reload < 0.25f){
if(!(destination.block() instanceof CraterConveyor) && (entity.link != tile.pos() || !isStart(tile))){ // ...and if its not a crater conveyor, start unloading (everything)
while(entity.items.total() > 0 && entity.dominant() != null && offloadDir(tile, entity.dominant())) entity.items.remove(entity.dominant(), 1);
if(entity.items.total() == 0) Effects.effect(Fx.plasticburn, tile.drawx(), tile.drawy());
}
}
@ -198,6 +198,13 @@ public class CraterConveyor extends BaseConveyor{
return true;
}
@Override
public int removeStack(Tile tile, Item item, int amount){
int i = super.removeStack(tile, item, amount);
if(tile.entity.items.total() == 0) Effects.effect(Fx.plasticburn, tile.drawx(), tile.drawy());
return i;
}
@Override
public int getMaximumAccepted(Tile tile, Item item){
return Mathf.round(super.getMaximumAccepted(tile, item) * tile.entity.timeScale);