Prevent visual plastanium conveyor glitch when disabled (#4101)

This commit is contained in:
Patrick 'Quezler' Mounier
2020-12-24 09:47:43 -05:00
committed by GitHub
parent 90372171b2
commit 85a668c202
@@ -179,14 +179,18 @@ public class StackConveyor extends Block implements Autotiler{
} }
} }
@Override
public float efficiency(){
return 1f;
}
@Override @Override
public void updateTile(){ public void updateTile(){
// reel in crater // reel in crater
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge); if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge);
if(link == -1){ // indicates empty state
return; if(link == -1) return;
}
// crater needs to be centered // crater needs to be centered
if(cooldown > 0f) return; if(cooldown > 0f) return;
@@ -196,6 +200,9 @@ public class StackConveyor extends Block implements Autotiler{
lastItem = items.first(); 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 if(state == stateUnload){ //unload
while(lastItem != null && (!splitOut ? moveForward(lastItem) : dump(lastItem))){ while(lastItem != null && (!splitOut ? moveForward(lastItem) : dump(lastItem))){
if(items.empty()) poofOut(); if(items.empty()) poofOut();