Mark certain blocks as non-updating

This commit is contained in:
Anuken
2022-02-23 11:15:33 -05:00
parent 9383bb4b30
commit 8be7e9a13f
6 changed files with 14 additions and 3 deletions

View File

@@ -1008,6 +1008,7 @@ public class Blocks{
outputsLiquid = true;
envEnabled = Env.any;
drawer = new DrawMixer(true);
liquidCapacity = 24f;
consumePower(1f);
consumeItem(Items.titanium);
@@ -2018,7 +2019,7 @@ public class Blocks{
}};
liquidJunction = new LiquidJunction("liquid-junction"){{
requirements(Category.liquid, with(Items.graphite, 2, Items.metaglass, 2));
requirements(Category.liquid, with(Items.graphite, 4, Items.metaglass, 8));
}};
bridgeConduit = new LiquidBridge("bridge-conduit"){{

View File

@@ -16,7 +16,8 @@ public class OverflowGate extends Block{
super(name);
hasItems = true;
solid = true;
update = true;
update = false;
destructible = true;
group = BlockGroup.transportation;
instantTransfer = true;
unloadable = false;

View File

@@ -19,7 +19,8 @@ public class Sorter extends Block{
public Sorter(String name){
super(name);
update = true;
update = false;
destructible = true;
solid = true;
instantTransfer = true;
group = BlockGroup.transportation;

View File

@@ -24,6 +24,9 @@ public class Battery extends PowerDistributor{
flags = EnumSet.of(BlockFlag.battery);
//TODO could be supported everywhere...
envEnabled |= Env.space;
destructible = true;
//batteries don't need to update
update = false;
}
public class BatteryBuild extends Building{

View File

@@ -94,6 +94,7 @@ public class BeamNode extends PowerBlock{
@Override
public void updateTile(){
//TODO this block technically does not need to update every frame, perhaps put it in a special list.
if(lastChange != world.tileChanges){
lastChange = world.tileChanges;
updateDirections();

View File

@@ -46,6 +46,10 @@ public class PowerNode extends PowerBlock{
schematicPriority = -10;
drawDisabled = false;
envEnabled |= Env.space;
destructible = true;
//nodes do not even need to update
update = false;
config(Integer.class, (entity, value) -> {
PowerModule power = entity.power;