Bridge cleanup
This commit is contained in:
@@ -45,18 +45,7 @@ public class ItemBridge extends Block{
|
||||
|
||||
@Override
|
||||
public void configured(Tile tile, Player player, int value){
|
||||
ItemBridgeEntity entity = tile.entity();
|
||||
|
||||
if(world.tile(entity.link) != null && world.tile(entity.link).entity instanceof ItemBridgeEntity){
|
||||
ItemBridgeEntity oe = world.tile(entity.link).entity();
|
||||
oe.incoming.remove(tile.pos());
|
||||
}
|
||||
|
||||
entity.link = value;
|
||||
|
||||
if(world.tile(value) != null && world.tile(value).entity instanceof ItemBridgeEntity){
|
||||
((ItemBridgeEntity)world.tile(value).entity).incoming.add(tile.pos());
|
||||
}
|
||||
tile.<ItemBridgeEntity>entity().link = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,6 +184,7 @@ public class ItemBridge extends Block{
|
||||
tryDump(tile);
|
||||
entity.uptime = 0f;
|
||||
}else{
|
||||
((ItemBridgeEntity)world.tile(entity.link).entity).incoming.add(tile.pos());
|
||||
|
||||
if(entity.cons.valid() && Mathf.zero(1f - entity.efficiency())){
|
||||
entity.uptime = Mathf.lerpDelta(entity.uptime, 1f, 0.04f);
|
||||
|
||||
Reference in New Issue
Block a user