Ban/Unban Blocks & Units with World Processors (#9052)
* uh * mmmmmm * hhhhhh * i * indicate
This commit is contained in:
@@ -1450,6 +1450,22 @@ public class LExecutor{
|
||||
}
|
||||
case ambientLight -> state.rules.ambientLight.fromDouble(exec.num(value));
|
||||
case solarMultiplier -> state.rules.solarMultiplier = Math.max(exec.numf(value), 0f);
|
||||
case ban -> {
|
||||
Object cont = exec.obj(value);
|
||||
if(cont instanceof Block b){
|
||||
state.rules.bannedBlocks.add(b);
|
||||
}else if(cont instanceof UnitType u){
|
||||
state.rules.bannedUnits.add(u);
|
||||
}
|
||||
}
|
||||
case unban -> {
|
||||
Object cont = exec.obj(value);
|
||||
if(cont instanceof Block b){
|
||||
state.rules.bannedBlocks.remove(b);
|
||||
}else if(cont instanceof UnitType u){
|
||||
state.rules.bannedUnits.remove(u);
|
||||
}
|
||||
}
|
||||
case unitHealth, unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, buildSpeed, rtsMinSquad, rtsMinWeight -> {
|
||||
Team team = exec.team(p1);
|
||||
if(team != null){
|
||||
|
||||
@@ -1392,6 +1392,11 @@ public class LStatements{
|
||||
row(table);
|
||||
field(table, value, s -> value = s);
|
||||
}
|
||||
case ban, unban -> {
|
||||
table.add(" block/unit ");
|
||||
|
||||
field(table, value, s -> value = s);
|
||||
}
|
||||
default -> {
|
||||
table.add(" = ");
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ public enum LogicRule{
|
||||
lighting,
|
||||
ambientLight,
|
||||
solarMultiplier,
|
||||
ban,
|
||||
unban,
|
||||
|
||||
//team specific
|
||||
buildSpeed,
|
||||
|
||||
Reference in New Issue
Block a user