More misc cleanup

This commit is contained in:
Anuken
2021-03-17 17:39:50 -04:00
parent 786d638ad0
commit c7cbe50876
6 changed files with 17 additions and 13 deletions
@@ -283,7 +283,7 @@ public class StackConveyor extends Block implements Autotiler{
@Override
public void handleItem(Building source, Item item){
if(items.empty()) poofIn();
if(items.empty() && tile != null) poofIn();
super.handleItem(source, item);
lastItem = item;
}
@@ -291,7 +291,7 @@ public class StackConveyor extends Block implements Autotiler{
@Override
public void handleStack(Item item, int amount, Teamc source){
if(amount <= 0) return;
if(items.empty()) poofIn();
if(items.empty() && tile != null) poofIn();
super.handleStack(item, amount, source);
lastItem = item;
}
@@ -47,7 +47,7 @@ public class LogicBlock extends Block{
config(Integer.class, (LogicBuild entity, Integer pos) -> {
//if there is no valid link in the first place, nobody cares
if(!entity.validLink(world.build(pos))) return;
Building lbuild = world.build(pos);
var lbuild = world.build(pos);
int x = lbuild.tileX(), y = lbuild.tileY();
LogicLink link = entity.links.find(l -> l.x == x && l.y == y);
@@ -62,8 +62,7 @@ public class LogicBlock extends Block{
}
}else{
entity.links.remove(l -> world.build(l.x, l.y) == lbuild);
LogicLink out = new LogicLink(x, y, entity.findLinkName(lbuild.block), true);
entity.links.add(out);
entity.links.add(new LogicLink(x, y, entity.findLinkName(lbuild.block), true));
}
entity.updateCode(entity.code, true, null);