Less instant transfer block chaining

This commit is contained in:
Anuken 2020-08-18 10:17:07 -04:00
parent 00f7f57c46
commit ec2593f3d5
2 changed files with 4 additions and 4 deletions

View File

@ -21,6 +21,7 @@ public class OverflowGate extends Block{
solid = true;
update = true;
group = BlockGroup.transportation;
instantTransfer = true;
unloadable = false;
canOverdrive = false;
}
@ -92,12 +93,11 @@ public class OverflowGate extends Block{
Building to = nearby((from + 2) % 4);
boolean canForward = to != null && to.acceptItem(this, item) && to.team() == team && !(to.block() instanceof OverflowGate);
if(!canForward || invert){
Building a = nearby(Mathf.mod(from - 1, 4));
Building b = nearby(Mathf.mod(from + 1, 4));
boolean ac = a != null && a.acceptItem(this, item) && !(a.block() instanceof OverflowGate) && a.team() == team;
boolean bc = b != null && b.acceptItem(this, item) && !(b.block() instanceof OverflowGate) && b.team() == team;
boolean ac = a != null && a.acceptItem(this, item) && !(a.block() instanceof OverflowGate) && a.team == team;
boolean bc = b != null && b.acceptItem(this, item) && !(b.block() instanceof OverflowGate) && b.team == team;
if(!ac && !bc){
return invert && canForward ? to : null;

View File

@ -88,7 +88,7 @@ public class Sorter extends Block{
public boolean isSame(Building other){
// comment code below to allow sorter/gate chaining
return other != null && (other.block() instanceof Sorter || other.block() instanceof OverflowGate);
return other != null && other.block().instantTransfer;
}
public Building getTileTarget(Item item, Building source, boolean flip){