Fixed world border enable

This commit is contained in:
Anuken
2022-02-28 15:57:20 -05:00
parent ab4190a6b5
commit 2cb75d9d88
3 changed files with 11 additions and 0 deletions

Binary file not shown.

View File

@@ -445,6 +445,15 @@ public class World{
return 0; return 0;
} }
public void checkMapArea(){
for(var build : Groups.build){
//reset map-area-based disabled blocks.
if(build.allowUpdate() && !build.enabled){
build.enabled = true;
}
}
}
//TODO optimize; this is very slow and called too often! //TODO optimize; this is very slow and called too often!
public float getDarkness(int x, int y){ public float getDarkness(int x, int y){
float dark = 0; float dark = 0;

View File

@@ -1338,6 +1338,7 @@ public class LExecutor{
if(!headless){ if(!headless){
renderer.updateAllDarkness(); renderer.updateAllDarkness();
} }
world.checkMapArea();
return false; return false;
} }
} }
@@ -1351,6 +1352,7 @@ public class LExecutor{
state.rules.limitY = y; state.rules.limitY = y;
state.rules.limitWidth = w; state.rules.limitWidth = w;
state.rules.limitHeight = h; state.rules.limitHeight = h;
world.checkMapArea();
if(!headless){ if(!headless){
renderer.updateAllDarkness(); renderer.updateAllDarkness();