mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-05 13:08:20 +07:00
Minor ConstructBlock logic tweak
This commit is contained in:
parent
975043d439
commit
d72db58b3f
@ -25,7 +25,8 @@ public class Scripts implements Disposable{
|
||||
private static final Seq<String> blacklist = Seq.with(".net.", "java.net", "files", "reflect", "javax", "rhino", "file", "channels", "jdk",
|
||||
"runtime", "util.os", "rmi", "security", "org.", "sun.", "beans", "sql", "http", "exec", "compiler", "process", "system",
|
||||
".awt", "socket", "classloader", "oracle", "invoke", "java.util.function", "java.util.stream", "org.", "mod.classmap");
|
||||
private static final Seq<String> whitelist = Seq.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "mindustry.gen.", "mindustry.logic.", "mindustry.async.", "saveio", "systemcursor", "filetreeinitevent");
|
||||
private static final Seq<String> whitelist = Seq.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "jdk.proxy1", "mindustry.gen.",
|
||||
"mindustry.logic.", "mindustry.async.", "saveio", "systemcursor", "filetreeinitevent");
|
||||
|
||||
private final Context context;
|
||||
private final Scriptable scope;
|
||||
|
@ -22,6 +22,8 @@ import mindustry.world.*;
|
||||
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||
import mindustry.world.modules.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
/** A block in the process of construction. */
|
||||
@ -263,6 +265,11 @@ public class ConstructBlock extends Block{
|
||||
}
|
||||
|
||||
public void deconstruct(Unit builder, @Nullable Building core, float amount){
|
||||
//reset accumulated resources when switching modes
|
||||
if(wasConstructing){
|
||||
Arrays.fill(accumulator, 0);
|
||||
Arrays.fill(totalAccumulator, 0);
|
||||
}
|
||||
wasConstructing = false;
|
||||
activeDeconstruct = true;
|
||||
float deconstructMultiplier = state.rules.deconstructRefundMultiplier;
|
||||
|
Loading…
Reference in New Issue
Block a user