diff options
author | Technus <daniel112092@gmail.com> | 2017-10-01 15:22:23 +0200 |
---|---|---|
committer | Technus <daniel112092@gmail.com> | 2017-10-01 15:22:23 +0200 |
commit | e930027cf170c3501d5ace2bc995b9c017849e3c (patch) | |
tree | bc745b7349bd64e2be7f4b77a961d4a10b5673b1 /src/main | |
parent | 56846cb2599c7b29ec3af4950b53181daa5200b8 (diff) | |
download | GT5-Unofficial-e930027cf170c3501d5ace2bc995b9c017849e3c.tar.gz GT5-Unofficial-e930027cf170c3501d5ace2bc995b9c017849e3c.tar.bz2 GT5-Unofficial-e930027cf170c3501d5ace2bc995b9c017849e3c.zip |
Use new and better XSTR with locked seed.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/github/technus/tectech/TecTech.java | 3 | ||||
-rw-r--r-- | src/main/java/com/github/technus/tectech/XSTR.java | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 114c2fb19b..3f3d486af4 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -38,11 +38,11 @@ public class TecTech { @Instance(Reference.MODID) public static TecTech instance; + public static final XSTR Rnd = XSTR.XSTR_INSTANCE; public static final LogHelper Logger = new LogHelper(Reference.MODID); private static IngameErrorLog Module_AdminErrorLogs = null; public static MainLoader GTCustomLoader = null; public static TecTechConfig ModConfig; - public static XSTR Rnd = null; public static CreativeTabs mainTab = null; public static boolean hasCOFH = false, hasThaumcraft = false; @@ -57,7 +57,6 @@ public class TecTech { @EventHandler public void PreLoad(FMLPreInitializationEvent PreEvent) { Logger.setDebugOutput(true); - Rnd = new XSTR(); ModConfig = new TecTechConfig(PreEvent.getModConfigurationDirectory(), Reference.COLLECTIONNAME, Reference.MODID); diff --git a/src/main/java/com/github/technus/tectech/XSTR.java b/src/main/java/com/github/technus/tectech/XSTR.java index 4fa4b98fbd..611d350ce7 100644 --- a/src/main/java/com/github/technus/tectech/XSTR.java +++ b/src/main/java/com/github/technus/tectech/XSTR.java @@ -43,6 +43,12 @@ public class XSTR extends Random { private static final long SEEDER_INCREMENT = 0xbb67ae8584caa73bL; private static final double DOUBLE_UNIT = 0x1.0p-53; // 1.0 / (1L << 53) private static final float FLOAT_UNIT = 0x1.0p-24f; // 1.0f / (1 << 24) + public final static XSTR XSTR_INSTANCE=new XSTR(){ + @Override + public synchronized void setSeed(long seed) { + throw new NoSuchMethodError("This is meant to be shared!, leave seed state alone!"); + } + }; /* MODIFIED BY: Robotia |