Эх сурвалжийг харах

Minor fixes, update Forge dependency

malte0811 4 жил өмнө
parent
commit
9ba66d3019

+ 2 - 2
gradle.properties

@@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
 org.gradle.daemon=false
 mod_version=1.0
 modid=ferritecore
-mc_version=1.16.3
-forge_version=34.1.25
+mc_version=1.16.4
+forge_version=35.1.13
 mapping=20200916
 mcp_version=1.16.2

+ 2 - 2
src/main/java/malte0811/ferritecore/HackyGlobalState.java

@@ -5,6 +5,6 @@ import net.minecraft.state.Property;
 import java.util.Map;
 
 public class HackyGlobalState {
-    public static ThreadLocal<Map<Map<Property<?>, Comparable<?>>, ?>> lastStateMap;
-    public static ThreadLocal<FastMap<?>> lastFastStateMap;
+    public static final ThreadLocal<Map<Map<Property<?>, Comparable<?>>, ?>> LAST_STATE_MAP = new ThreadLocal<>();
+    public static final ThreadLocal<FastMap<?>> LAST_FAST_STATE_MAP = new ThreadLocal<>();
 }

+ 4 - 4
src/main/java/malte0811/ferritecore/mixin/StateholderMixin.java

@@ -37,13 +37,13 @@ public abstract class StateholderMixin<O, S> {
     public void func_235899_a_(Map<Map<Property<?>, Comparable<?>>, S> states) {
         if (globalTable != null) {
             throw new IllegalStateException();
-        } else if (states == HackyGlobalState.lastStateMap.get()) {
+        } else if (states == HackyGlobalState.LAST_STATE_MAP.get()) {
             // Use "hacky global state" to use the same fast map for all states of one block
-            this.globalTable = (FastMap<S>) HackyGlobalState.lastFastStateMap.get();
+            this.globalTable = (FastMap<S>) HackyGlobalState.LAST_FAST_STATE_MAP.get();
         } else {
-            HackyGlobalState.lastStateMap.set(states);
+            HackyGlobalState.LAST_STATE_MAP.set(states);
             this.globalTable = new FastMap<>(getProperties(), states);
-            HackyGlobalState.lastFastStateMap.set(this.globalTable);
+            HackyGlobalState.LAST_FAST_STATE_MAP.set(this.globalTable);
         }
         this.globalTableIndex = this.globalTable.getIndexOf(properties);
         properties = null;