Whitelist Option + Hiding Banned Blocks Rules (#7553)
* Whitelist Option * Hide banned blocks rule
This commit is contained in:
@@ -853,11 +853,11 @@ public class Block extends UnlockableContent implements Senseable{
|
||||
}
|
||||
|
||||
public boolean isVisible(){
|
||||
return !isHidden();
|
||||
return !isHidden() && (state.rules.editor || (!state.rules.hideBannedBlocks || !state.rules.isBanned(this)));
|
||||
}
|
||||
|
||||
public boolean isPlaceable(){
|
||||
return isVisible() && (!state.rules.bannedBlocks.contains(this) || state.rules.editor) && supportsEnv(state.rules.env);
|
||||
return isVisible() && (!state.rules.isBanned(this) || state.rules.editor) && supportsEnv(state.rules.env);
|
||||
}
|
||||
|
||||
/** @return whether this block supports a specific environment. */
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Constructor extends BlockProducer{
|
||||
}
|
||||
|
||||
public boolean canProduce(Block b){
|
||||
return b.isVisible() && b.size >= minBlockSize && b.size <= maxBlockSize && !(b instanceof CoreBlock) && !state.rules.bannedBlocks.contains(b) && b.environmentBuildable() && (filter.isEmpty() || filter.contains(b));
|
||||
return b.isVisible() && b.size >= minBlockSize && b.size <= maxBlockSize && !(b instanceof CoreBlock) && !state.rules.isBanned(b) && b.environmentBuildable() && (filter.isEmpty() || filter.contains(b));
|
||||
}
|
||||
|
||||
public class ConstructorBuild extends BlockProducerBuild{
|
||||
@@ -91,4 +91,4 @@ public class Constructor extends BlockProducer{
|
||||
recipe = Vars.content.block(read.s());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PayloadRouter extends PayloadConveyor{
|
||||
}
|
||||
|
||||
public boolean canSort(Block b){
|
||||
return b.isVisible() && b.size <= size && !(b instanceof CoreBlock) && !state.rules.bannedBlocks.contains(b) && b.environmentBuildable();
|
||||
return b.isVisible() && b.size <= size && !(b instanceof CoreBlock) && !state.rules.isBanned(b) && b.environmentBuildable();
|
||||
}
|
||||
|
||||
public boolean canSort(UnitType t){
|
||||
|
||||
@@ -76,7 +76,7 @@ public class PayloadSource extends PayloadBlock{
|
||||
}
|
||||
|
||||
public boolean canProduce(Block b){
|
||||
return b.isVisible() && b.size < size && !(b instanceof CoreBlock) && !state.rules.bannedBlocks.contains(b) && b.environmentBuildable();
|
||||
return b.isVisible() && b.size < size && !(b instanceof CoreBlock) && !state.rules.isBanned(b) && b.environmentBuildable();
|
||||
}
|
||||
|
||||
public boolean canProduce(UnitType t){
|
||||
|
||||
Reference in New Issue
Block a user