More cleanup

This commit is contained in:
Anuken
2024-04-25 10:36:41 -04:00
parent be64defc37
commit a07d1f2c00

View File

@ -14,7 +14,6 @@ public class LogicFilter extends GenerateFilter{
public static int maxInstructionsExecution = 500 * 500 * 25; public static int maxInstructionsExecution = 500 * 500 * 25;
public String code; public String code;
public boolean loop; public boolean loop;
LExecutor executor;
@Override @Override
public FilterOption[] options(){ public FilterOption[] options(){
@ -39,7 +38,7 @@ public class LogicFilter extends GenerateFilter{
@Override @Override
public void apply(Tiles tiles, GenerateInput in){ public void apply(Tiles tiles, GenerateInput in){
executor = new LExecutor(); LExecutor executor = new LExecutor();
executor.privileged = true; executor.privileged = true;
try{ try{
@ -54,8 +53,7 @@ public class LogicFilter extends GenerateFilter{
logicVars.update(); logicVars.update();
//NOTE: all tile operations will call setNet for tiles, but that should have no overhead during world loading //NOTE: all tile operations will call setNet for tiles, but that should have no overhead during world loading
//executions are limited to prevent infinite generation
//limited run
for(int i = 1; i < maxInstructionsExecution; i++){ for(int i = 1; i < maxInstructionsExecution; i++){
if(!loop && (executor.counter.numval >= executor.instructions.length || executor.counter.numval < 0)) break; if(!loop && (executor.counter.numval >= executor.instructions.length || executor.counter.numval < 0)) break;
executor.runOnce(); executor.runOnce();