This commit is contained in:
Anuken
2020-09-07 17:06:56 -04:00
parent 15bb01fd22
commit fe76490418
11 changed files with 106 additions and 60 deletions

View File

@@ -449,10 +449,6 @@ public class Tile implements Position, QuadTreeObject, Displayable{
return block.solid && block.fillsTile && !block.synthetic() ? data : 0;
}
//TODO remove this method?
public void updateOcclusion(){
}
protected void preChanged(){
if(build != null){
//only call removed() for the center block - this only gets called once.
@@ -475,8 +471,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
other.block = Blocks.air;
//manually call changed event
other.updateOcclusion();
world.notifyChanged(other);
other.fireChanged();
}
}
}
@@ -533,9 +528,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
}
}
updateOcclusion();
world.notifyChanged(this);
fireChanged();
//recache when static block is added
if(block.isStatic()){
@@ -543,6 +536,10 @@ public class Tile implements Position, QuadTreeObject, Displayable{
}
}
protected void fireChanged(){
world.notifyChanged(this);
}
@Override
public void display(Table table){
Block toDisplay = overlay.itemDrop != null ? overlay : floor;

View File

@@ -70,7 +70,7 @@ public class NuclearReactor extends PowerGenerator{
@Override
public void updateTile(){
ConsumeLiquid cliquid = consumes.get(ConsumeType.liquid);
Item item = consumes.<ConsumeItems>get(ConsumeType.item).items[0].item;
Item item = consumes.getItem().items[0].item;
int fuel = items.get(item);
float fullness = (float)fuel / itemCapacity;

View File

@@ -34,6 +34,10 @@ public class Consumers{
return get(ConsumeType.power);
}
public ConsumeItems getItem(){
return get(ConsumeType.item);
}
public boolean hasPower(){
return has(ConsumeType.power);
}