mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-21 04:42:17 +00:00
replace lotr blockrendering hashmap with concurrent version (#98)
This commit is contained in:
1 parent
74cdc561e6
commit
446c8e74ee
3 files changed
+24
-2
No files matched your search
@@ -25,10 +25,13 @@ public class AngelicaMod {
|
||||
/** ASM Version */
|
||||
public static boolean isOldNEIDLoaded;
|
||||
|
||||
public static boolean isLotrLoaded;
|
||||
|
||||
public static boolean isChunkAPILoaded;
|
||||
|
||||
public static boolean isEIDBiomeLoaded;
|
||||
public static final boolean lwjglDebug = Boolean.parseBoolean(System.getProperty("org.lwjgl.util.Debug", "false"));
|
||||
|
||||
public static final boolean lwjglDebug = Boolean.parseBoolean(System.getProperty("org.lwjgl.util.Debug", "false"));
|
||||
|
||||
public static final ManagedEnum<AnimationMode> animationsMode = new ManagedEnum<>(AnimationMode.VISIBLE_ONLY);
|
||||
|
||||
@@ -36,6 +39,7 @@ public class AngelicaMod {
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
isNEIDLoaded = Loader.isModLoaded("neid");
|
||||
isOldNEIDLoaded = Loader.isModLoaded("notenoughIDs");
|
||||
isLotrLoaded = Loader.isModLoaded("lotr");
|
||||
isChunkAPILoaded = Loader.isModLoaded("chunkapi");
|
||||
isEIDBiomeLoaded = Loader.isModLoaded("endlessids_biome");
|
||||
proxy.preInit(event);
|
||||
|
||||
@@ -79,6 +79,11 @@ public class AngelicaConfig {
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean optimizeJabbaGetInteger;
|
||||
|
||||
@Config.Comment("Fix thread-safety in lotrs rendering")
|
||||
@Config.DefaultBoolean(true)
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean fixLotrSodiumCompat;
|
||||
|
||||
@Config.Comment("Enable Debug Logging")
|
||||
@Config.DefaultBoolean(false)
|
||||
@Config.RequiresMcRestart
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gtnewhorizons.angelica.proxy;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.gtnewhorizons.angelica.AngelicaMod;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.hudcaching.HUDCaching;
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
@@ -11,6 +12,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import me.jellysquid.mods.sodium.client.SodiumDebugScreenHandler;
|
||||
import net.coderbot.iris.Iris;
|
||||
import net.coderbot.iris.client.IrisDebugScreenHandler;
|
||||
@@ -32,6 +34,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@@ -62,7 +65,17 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
// Nothing to do here (yet)
|
||||
if (AngelicaMod.isLotrLoaded && AngelicaConfig.enableSodium && AngelicaConfig.fixLotrSodiumCompat) {
|
||||
try {
|
||||
Class<?> lotrRendering = Class.forName("lotr.common.coremod.LOTRReplacedMethods$BlockRendering");
|
||||
ReflectionHelper.setPrivateValue(lotrRendering,null,new ConcurrentHashMap<>(),"naturalBlockClassTable");
|
||||
ReflectionHelper.setPrivateValue(lotrRendering,null,new ConcurrentHashMap<>(),"naturalBlockTable");
|
||||
ReflectionHelper.setPrivateValue(lotrRendering,null,new ConcurrentHashMap<>(),"cachedNaturalBlocks");
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
AngelicaTweaker.LOGGER.error("Could net replace LOTR handle render code with thread safe version");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float lastIntegratedTickTime;
|
||||
|
||||
Reference in new issue
Block a user