Fixed #3222 / Fixed #3218 / Fixed #3228 / Fixed #3217

This commit is contained in:
Anuken
2020-11-01 09:28:03 -05:00
parent 54ba4b31a1
commit 187cb79265
7 changed files with 33 additions and 9 deletions
@@ -58,16 +58,16 @@ public class StackConveyor extends Block implements Autotiler{
@Override
public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
if(tile.build instanceof StackConveyorBuild){
int state = ((StackConveyorBuild)tile.build).state;
if(tile.build instanceof StackConveyorBuild b){
int state = b.state;
if(state == stateLoad){ //standard conveyor mode
return otherblock.outputsItems() && lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock);
}else if(state == stateUnload){ //router mode
return otherblock.acceptsItems &&
(notLookingAt(tile, rotation, otherx, othery, otherrot, otherblock) ||
(otherblock instanceof StackConveyor && facing(otherx, othery, otherrot, tile.x, tile.y))) &&
!(world.build(otherx, othery) instanceof StackConveyorBuild && ((StackConveyorBuild)world.build(otherx, othery)).state == stateUnload) &&
!(world.build(otherx, othery) instanceof StackConveyorBuild && ((StackConveyorBuild)world.build(otherx, othery)).state == stateMove &&
!(world.build(otherx, othery) instanceof StackConveyorBuild s && s.state == stateUnload) &&
!(world.build(otherx, othery) instanceof StackConveyorBuild s2 && s2.state == stateMove &&
!facing(otherx, othery, otherrot, tile.x, tile.y));
}
}