Minor ban/unban instruction and join dialog changes (#9249)

* Make PlacementFragment update after world processor's ban/unban instructions, add buttons in community server list to add server as remote

* Small world processor ban/unban optimization
This commit is contained in:
ApsZoldat
2023-11-11 17:55:01 +03:00
committed by GitHub
parent fbd0675f75
commit c4dc095adb
3 changed files with 62 additions and 31 deletions

View File

@@ -1459,7 +1459,8 @@ public class LExecutor{
case ban -> {
Object cont = exec.obj(value);
if(cont instanceof Block b){
state.rules.bannedBlocks.add(b);
// Rebuild PlacementFragment if anything has changed
if(state.rules.bannedBlocks.add(b) && !headless) ui.hudfrag.blockfrag.rebuild();
}else if(cont instanceof UnitType u){
state.rules.bannedUnits.add(u);
}
@@ -1467,7 +1468,7 @@ public class LExecutor{
case unban -> {
Object cont = exec.obj(value);
if(cont instanceof Block b){
state.rules.bannedBlocks.remove(b);
if(state.rules.bannedBlocks.remove(b) && !headless) ui.hudfrag.blockfrag.rebuild();
}else if(cont instanceof UnitType u){
state.rules.bannedUnits.remove(u);
}