Browse Source

Prefix Mixin-added fields with mod ID

malte0811 3 years ago
parent
commit
c7fbc6156e

+ 2 - 1
common/src/main/java/malte0811/ferritecore/mixin/dedupmultipart/MixinMultipartModel.java

@@ -1,5 +1,6 @@
 package malte0811.ferritecore.mixin.dedupmultipart;
 
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
 import net.minecraft.block.BlockState;
 import net.minecraft.client.renderer.model.MultipartBakedModel;
 import org.spongepowered.asm.mixin.Final;
@@ -12,7 +13,7 @@ import java.util.BitSet;
 import java.util.Map;
 
 /**
- * The map implementation used for {@link MultipartBakedModel#bitSetCache} ({@link it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap})
+ * The map implementation used for {@link MultipartBakedModel#bitSetCache} ({@link Object2ObjectOpenCustomHashMap})
  * is not thread-safe, but getQuads is called in parallel in vanilla (and even more so in Forge with
  * alwaysSetupTerrainOffThread=true). The only reason this works for vanilla is that the cache will never contain more
  * than a single blockstate, since a new instance is created for each blockstate (this is probably unintentional, a map

+ 11 - 7
common/src/main/java/malte0811/ferritecore/mixin/fastmap/FastMapStateHolderMixin.java

@@ -22,8 +22,8 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
     @Shadow
     private Table<Property<?>, Comparable<?>, S> propertyToStateTable;
 
-    private int globalTableIndex;
-    private FastMap<S> globalTable;
+    private int ferritecore_globalTableIndex;
+    private FastMap<S> ferritecore_globalTable;
 
     @Redirect(
             method = "with",
@@ -34,7 +34,11 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
             )
     )
     public Object getNeighborFromFastMap(Table<?, ?, ?> ignore, Object rowKey, Object columnKey) {
-        return this.globalTable.withUnsafe(this.globalTableIndex, (Property<?>) rowKey, columnKey);
+        return this.ferritecore_globalTable.withUnsafe(
+                this.ferritecore_globalTableIndex,
+                (Property<?>) rowKey,
+                columnKey
+        );
     }
 
     /**
@@ -49,12 +53,12 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
 
     @Override
     public FastMap<S> getStateMap() {
-        return globalTable;
+        return ferritecore_globalTable;
     }
 
     @Override
     public int getStateIndex() {
-        return globalTableIndex;
+        return ferritecore_globalTableIndex;
     }
 
     @Override
@@ -69,12 +73,12 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
 
     @Override
     public void setStateMap(FastMap<S> newValue) {
-        globalTable = newValue;
+        ferritecore_globalTable = newValue;
     }
 
     @Override
     public void setStateIndex(int newValue) {
-        globalTableIndex = newValue;
+        ferritecore_globalTableIndex = newValue;
     }
 
     @Override

+ 1 - 1
gradle.properties

@@ -5,7 +5,7 @@ minecraft_version=1.16.5
 mcp_version=20210309-1.16.5
 
 archives_base_name=ferritecore
-mod_version=2.0.5
+mod_version=2.0.6
 maven_group=malte0811.ferritecore
 
 fabric_loader_version=0.11.1