Penalties: Redo Marianas Trench.
This commit is contained in:
parent
3e083e4ce7
commit
cbfcecf2b4
|
@ -24,11 +24,17 @@ package fr.neatmonster.nocheatplus.actions.types.penalty;
|
||||||
public final class CancelPenalty implements Penalty<CancelPenalty> {
|
public final class CancelPenalty implements Penalty<CancelPenalty> {
|
||||||
|
|
||||||
public static final CancelPenalty CANCEL = new CancelPenalty();
|
public static final CancelPenalty CANCEL = new CancelPenalty();
|
||||||
|
private static boolean locked = false;
|
||||||
|
|
||||||
public CancelPenalty() {
|
public CancelPenalty() {
|
||||||
super(); // Magic.
|
super(); // Magic.
|
||||||
if (this != CANCEL) {
|
synchronized(CancelPenalty.class) {
|
||||||
throw new IllegalStateException("CancelPenalty.CANCEL is supposed to be the unique instance.");
|
if (CancelPenalty.locked) {
|
||||||
|
throw new IllegalStateException("CancelPenalty.CANCEL is supposed to be the unique instance.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CancelPenalty.locked = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.junit.Test;
|
||||||
|
|
||||||
import fr.neatmonster.nocheatplus.config.ConfPaths;
|
import fr.neatmonster.nocheatplus.config.ConfPaths;
|
||||||
import fr.neatmonster.nocheatplus.config.ConfigFile;
|
import fr.neatmonster.nocheatplus.config.ConfigFile;
|
||||||
|
import fr.neatmonster.nocheatplus.config.DefaultConfig;
|
||||||
import fr.neatmonster.nocheatplus.config.PathUtils;
|
import fr.neatmonster.nocheatplus.config.PathUtils;
|
||||||
import fr.neatmonster.nocheatplus.config.RawConfigFile;
|
import fr.neatmonster.nocheatplus.config.RawConfigFile;
|
||||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||||
|
@ -99,4 +100,10 @@ public class TestConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testActionLists() {
|
||||||
|
ConfigFile config = new DefaultConfig();
|
||||||
|
config.getOptimizedActionList(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue