Fixed cores being replaceable
This commit is contained in:
@@ -123,6 +123,8 @@ public class Block extends UnlockableContent{
|
||||
public boolean fillsTile = true;
|
||||
/** whether this block can be replaced in all cases */
|
||||
public boolean alwaysReplace = false;
|
||||
/** if false, this block can never be replaced. */
|
||||
public boolean replaceable = true;
|
||||
/** The block group. Unless {@link #canReplace} is overriden, blocks in the same group can replace each other. */
|
||||
public BlockGroup group = BlockGroup.none;
|
||||
/** List of block flags. Used for AI indexing. */
|
||||
@@ -410,7 +412,7 @@ public class Block extends UnlockableContent{
|
||||
|
||||
public boolean canReplace(Block other){
|
||||
if(other.alwaysReplace) return true;
|
||||
return (other != this || rotate) && this.group != BlockGroup.none && other.group == this.group &&
|
||||
return other.replaceable && (other != this || rotate) && this.group != BlockGroup.none && other.group == this.group &&
|
||||
(size == other.size || (size >= other.size && ((subclass != null && subclass == other.subclass) || group.anyReplace)));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ public class CoreBlock extends StorageBlock{
|
||||
loopSoundVolume = 1f;
|
||||
drawDisabled = false;
|
||||
canOverdrive = false;
|
||||
replaceable = false;
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
|
||||
Reference in New Issue
Block a user