Prevent visual plastanium conveyor glitch when disabled (#4101)

This commit is contained in:
Patrick 'Quezler' Mounier
2020-12-24 15:47:43 +01:00
committed by GitHub
parent 90372171b2
commit 85a668c202

View File

@@ -179,14 +179,18 @@ public class StackConveyor extends Block implements Autotiler{
}
}
@Override
public float efficiency(){
return 1f;
}
@Override
public void updateTile(){
// reel in crater
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge);
if(link == -1){
return;
}
// indicates empty state
if(link == -1) return;
// crater needs to be centered
if(cooldown > 0f) return;
@@ -196,6 +200,9 @@ public class StackConveyor extends Block implements Autotiler{
lastItem = items.first();
}
// do not continue if disabled, will still allow one to be reeled in to prevent visual stacking
if(!enabled) return;
if(state == stateUnload){ //unload
while(lastItem != null && (!splitOut ? moveForward(lastItem) : dump(lastItem))){
if(items.empty()) poofOut();