Make rebuildable a block attribute (#1338)

This commit is contained in:
Patrick 'Quezler' Mounier
2020-01-08 16:28:28 +01:00
committed by Anuken
parent 105aeade1f
commit 406c11a14d
4 changed files with 6 additions and 2 deletions

View File

@@ -47,8 +47,8 @@ public class Logic implements ApplicationListener{
//blocks that get broken are appended to the team's broken block queue //blocks that get broken are appended to the team's broken block queue
Tile tile = event.tile; Tile tile = event.tile;
Block block = tile.block(); Block block = tile.block();
//skip null entities or nukes, for obvious reasons; also skip client since they can't modify these requests //skip null entities or un-rebuildables, for obvious reasons; also skip client since they can't modify these requests
if(tile.entity == null || tile.block() instanceof NuclearReactor || net.client()) return; if(tile.entity == null || !tile.block().rebuildable || net.client()) return;
if(block instanceof BuildBlock){ if(block instanceof BuildBlock){

View File

@@ -55,6 +55,8 @@ public class Block extends BlockStorage{
public boolean rotate; public boolean rotate;
/** whether you can break this with rightclick */ /** whether you can break this with rightclick */
public boolean breakable; public boolean breakable;
/** whether to add this block to brokenblocks */
public boolean rebuildable = true;
/** whether this floor can be placed on. */ /** whether this floor can be placed on. */
public boolean placeableOn = true; public boolean placeableOn = true;
/** whether this block has insulating properties. */ /** whether this block has insulating properties. */

View File

@@ -26,6 +26,7 @@ public class ShockMine extends Block{
solid = false; solid = false;
targetable = false; targetable = false;
layer = Layer.overlay; layer = Layer.overlay;
rebuildable = false;
} }
@Override @Override

View File

@@ -46,6 +46,7 @@ public class NuclearReactor extends PowerGenerator{
hasItems = true; hasItems = true;
hasLiquids = true; hasLiquids = true;
entityType = NuclearReactorEntity::new; entityType = NuclearReactorEntity::new;
rebuildable = false;
} }
@Override @Override