Browse Source

Update mappings to official/MojMap

malte0811 4 years ago
parent
commit
ea1dc9a3bb
44 changed files with 273 additions and 282 deletions
  1. 3 3
      README.md
  2. 2 2
      build.gradle
  3. 1 1
      common/src/googleimpl/java/malte0811/ferritecore/fastmap/immutable/FastMapEntryEntrySet.java
  4. 1 1
      common/src/googleimpl/java/malte0811/ferritecore/fastmap/immutable/FastMapEntryImmutableMap.java
  5. 1 1
      common/src/googleimpl/java/malte0811/ferritecore/fastmap/immutable/FastMapEntryIterator.java
  6. 6 6
      common/src/main/java/malte0811/ferritecore/classloading/FastImmutableMapDefiner.java
  7. 1 1
      common/src/main/java/malte0811/ferritecore/ducks/FastMapStateHolder.java
  8. 6 6
      common/src/main/java/malte0811/ferritecore/fastmap/BinaryFastMapKey.java
  9. 1 1
      common/src/main/java/malte0811/ferritecore/fastmap/CompactFastMapKey.java
  10. 1 2
      common/src/main/java/malte0811/ferritecore/fastmap/FastMap.java
  11. 1 1
      common/src/main/java/malte0811/ferritecore/fastmap/FastMapKey.java
  12. 15 16
      common/src/main/java/malte0811/ferritecore/fastmap/PropertyIndexer.java
  13. 9 9
      common/src/main/java/malte0811/ferritecore/hash/VoxelShapeArrayHash.java
  14. 16 16
      common/src/main/java/malte0811/ferritecore/hash/VoxelShapeHash.java
  15. 34 34
      common/src/main/java/malte0811/ferritecore/hash/VoxelShapePartHash.java
  16. 11 11
      common/src/main/java/malte0811/ferritecore/hash/VoxelShapeSplitHash.java
  17. 28 29
      common/src/main/java/malte0811/ferritecore/impl/BlockStateCacheImpl.java
  18. 16 16
      common/src/main/java/malte0811/ferritecore/impl/Deduplicator.java
  19. 9 9
      common/src/main/java/malte0811/ferritecore/impl/PropertyValueConditionImpl.java
  20. 2 3
      common/src/main/java/malte0811/ferritecore/impl/StateHolderImpl.java
  21. 6 6
      common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/AbstractBlockStateMixin.java
  22. 4 4
      common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/BlockStateCacheAccess.java
  23. 8 8
      common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSArrayAccess.java
  24. 9 9
      common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSPBitSetAccess.java
  25. 4 4
      common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSPSplitAccess.java
  26. 2 2
      common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSPartAccess.java
  27. 5 9
      common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSSplitAccess.java
  28. 6 6
      common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VoxelShapeAccess.java
  29. 2 2
      common/src/main/java/malte0811/ferritecore/mixin/dedupbakedquad/BakedQuadAccess.java
  30. 5 5
      common/src/main/java/malte0811/ferritecore/mixin/dedupbakedquad/SimpleModelBuilderMixin.java
  31. 6 6
      common/src/main/java/malte0811/ferritecore/mixin/dedupmultipart/MixinMultipartBuilder.java
  32. 7 7
      common/src/main/java/malte0811/ferritecore/mixin/fastmap/FastMapStateHolderMixin.java
  33. 3 3
      common/src/main/java/malte0811/ferritecore/mixin/mrl/ModelResourceLocationMixin.java
  34. 1 1
      common/src/main/java/malte0811/ferritecore/mixin/mrl/ResourceLocationAccess.java
  35. 7 7
      common/src/main/java/malte0811/ferritecore/mixin/predicates/AndConditionMixin.java
  36. 7 7
      common/src/main/java/malte0811/ferritecore/mixin/predicates/OrConditionMixin.java
  37. 8 8
      common/src/main/java/malte0811/ferritecore/mixin/predicates/PropertyValueConditionMixin.java
  38. 6 7
      common/src/main/java/malte0811/ferritecore/util/PredicateHelper.java
  39. 4 4
      common/src/test/java/malte0811/ferritecore/fastmap/FastMapTest.java
  40. 1 1
      common/src/test/java/malte0811/ferritecore/fastmap/MockFMStateHolder.java
  41. 3 3
      fabric/src/main/java/malte0811/ferritecore/mixin/fabric/HydrogenStateholderMixin.java
  42. 3 3
      fabric/src/main/java/malte0811/ferritecore/mixin/fabric/MinecraftMixin.java
  43. 1 1
      gradle/wrapper/gradle-wrapper.properties
  44. 1 1
      summary.md

+ 3 - 3
README.md

@@ -12,6 +12,6 @@ high-level description of the improvements implemented by this mod see [here](su
 
 ### Mappings
 
-This mod currently uses MCP names for everything, in case someone involved in MCP mapping wants to look at it. There are
-a few commits using official names, so be careful when looking at the commit history if you are concerned about "mapping
-taint".
+This mod currently uses official/Mojmap names for everything, some of the history is in MCP names. If you don't know
+what this means it most likely isn't relevant to you, this information is mostly for people who do not want to see names
+in these mappings for legel reasons.

+ 2 - 2
build.gradle

@@ -46,8 +46,8 @@ subprojects {
     build.dependsOn signJar
 
     dependencies {
-        minecraft("com.mojang:minecraft:${rootProject.minecraft_version}")
-        mappings "de.oceanlabs.mcp:mcp_snapshot:${rootProject.mcp_version}"
+        minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
+        mappings minecraft.officialMojangMappings()
     }
 }
 

+ 1 - 1
common/src/googleimpl/java/malte0811/ferritecore/fastmap/immutable/FastMapEntryEntrySet.java

@@ -3,7 +3,7 @@ package malte0811.ferritecore.fastmap.immutable;
 import com.google.common.collect.FerriteCoreEntrySetAccess;
 import com.google.common.collect.UnmodifiableIterator;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 

+ 1 - 1
common/src/googleimpl/java/malte0811/ferritecore/fastmap/immutable/FastMapEntryImmutableMap.java

@@ -3,7 +3,7 @@ package malte0811.ferritecore.fastmap.immutable;
 import com.google.common.collect.FerriteCoreImmutableMapAccess;
 import com.google.common.collect.ImmutableSet;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 import org.jetbrains.annotations.Nullable;
 
 public class FastMapEntryImmutableMap extends FerriteCoreImmutableMapAccess<Property<?>, Comparable<?>> {

+ 1 - 1
common/src/googleimpl/java/malte0811/ferritecore/fastmap/immutable/FastMapEntryIterator.java

@@ -2,7 +2,7 @@ package malte0811.ferritecore.fastmap.immutable;
 
 import com.google.common.collect.UnmodifiableIterator;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 
 import java.util.Map;
 

+ 6 - 6
common/src/main/java/malte0811/ferritecore/classloading/FastImmutableMapDefiner.java

@@ -3,8 +3,8 @@ package malte0811.ferritecore.classloading;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
-import net.minecraft.state.Property;
-import net.minecraft.util.LazyValue;
+import net.minecraft.util.LazyLoadedValue;
+import net.minecraft.world.level.block.state.properties.Property;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
@@ -23,7 +23,7 @@ public class FastImmutableMapDefiner {
     public static String GOOGLE_ACCESS_PREFIX = "/googleaccess/";
     public static String GOOGLE_ACCESS_SUFFIX = ".class_manual";
 
-    private static final LazyValue<Definer> DEFINE_CLASS = new LazyValue<>(() -> {
+    private static final LazyLoadedValue<Definer> DEFINE_CLASS = new LazyLoadedValue<>(() -> {
         try {
             // Try to create a Java 9+ style class definer
             // These are all public methods, but just don't exist in Java 8
@@ -55,7 +55,7 @@ public class FastImmutableMapDefiner {
      * Creates a MethodHandle for the constructor of FastMapEntryImmutableMap which takes one argument, which has to be
      * an instance FastMapStateHolder. This also handles the necessary classloader acrobatics.
      */
-    private static final LazyValue<MethodHandle> MAKE_IMMUTABLE_FAST_MAP = new LazyValue<>(() -> {
+    private static final LazyLoadedValue<MethodHandle> MAKE_IMMUTABLE_FAST_MAP = new LazyLoadedValue<>(() -> {
         try {
             // Load these in the app classloader!
             defineInAppClassloader("com.google.common.collect.FerriteCoreEntrySetAccess");
@@ -72,7 +72,7 @@ public class FastImmutableMapDefiner {
 
     public static ImmutableMap<Property<?>, Comparable<?>> makeMap(FastMapStateHolder<?> state) {
         try {
-            return (ImmutableMap<Property<?>, Comparable<?>>) MAKE_IMMUTABLE_FAST_MAP.getValue().invoke(state);
+            return (ImmutableMap<Property<?>, Comparable<?>>) MAKE_IMMUTABLE_FAST_MAP.get().invoke(state);
         } catch (Error e) {
             throw e;
         } catch (Throwable x) {
@@ -87,7 +87,7 @@ public class FastImmutableMapDefiner {
         byte[] classBytes = new byte[byteInput.available()];
         final int bytesRead = byteInput.read(classBytes);
         Preconditions.checkState(bytesRead == classBytes.length);
-        Class<?> loaded = DEFINE_CLASS.getValue().define(classBytes, name);
+        Class<?> loaded = DEFINE_CLASS.get().define(classBytes, name);
         Preconditions.checkState(loaded.getClassLoader() == ImmutableMap.class.getClassLoader());
     }
 

+ 1 - 1
common/src/main/java/malte0811/ferritecore/ducks/FastMapStateHolder.java

@@ -2,7 +2,7 @@ package malte0811.ferritecore.ducks;
 
 import com.google.common.collect.ImmutableMap;
 import malte0811.ferritecore.fastmap.FastMap;
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 
 public interface FastMapStateHolder<S> {
     FastMap<S> getStateMap();

+ 6 - 6
common/src/main/java/malte0811/ferritecore/fastmap/BinaryFastMapKey.java

@@ -1,8 +1,8 @@
 package malte0811.ferritecore.fastmap;
 
 import com.google.common.base.Preconditions;
-import net.minecraft.state.Property;
-import net.minecraft.util.math.MathHelper;
+import net.minecraft.util.Mth;
+import net.minecraft.world.level.block.state.properties.Property;
 
 /**
  * A bitmask-based implementation of a FastMapKey. This reduces the density of data in the value matrix, but allows
@@ -14,12 +14,12 @@ public class BinaryFastMapKey<T extends Comparable<T>> extends FastMapKey<T> {
 
     public BinaryFastMapKey(Property<T> property, int mapFactor) {
         super(property);
-        Preconditions.checkArgument(MathHelper.isPowerOfTwo(mapFactor));
-        final int addedFactor = MathHelper.smallestEncompassingPowerOfTwo(numValues());
+        Preconditions.checkArgument(Mth.isPowerOfTwo(mapFactor));
+        final int addedFactor = Mth.smallestEncompassingPowerOfTwo(numValues());
         Preconditions.checkState(numValues() <= addedFactor);
         Preconditions.checkState(addedFactor < 2 * numValues());
-        final int setBitInBaseFactor = MathHelper.log2(mapFactor);
-        final int setBitInAddedFactor = MathHelper.log2(addedFactor);
+        final int setBitInBaseFactor = Mth.log2(mapFactor);
+        final int setBitInAddedFactor = Mth.log2(addedFactor);
         Preconditions.checkState(setBitInBaseFactor + setBitInAddedFactor <= 31);
         firstBitInValue = (byte) setBitInBaseFactor;
         firstBitAfterValue = (byte) (setBitInBaseFactor + setBitInAddedFactor);

+ 1 - 1
common/src/main/java/malte0811/ferritecore/fastmap/CompactFastMapKey.java

@@ -1,6 +1,6 @@
 package malte0811.ferritecore.fastmap;
 
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 
 /**
  * A "compact" implementation of a FastMapKey, i.e. one which completely fills the value matrix

+ 1 - 2
common/src/main/java/malte0811/ferritecore/fastmap/FastMap.java

@@ -2,9 +2,8 @@ package malte0811.ferritecore.fastmap;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
-import net.minecraft.state.Property;
-
 import javax.annotation.Nullable;
+import net.minecraft.world.level.block.state.properties.Property;
 import java.util.*;
 
 /**

+ 1 - 1
common/src/main/java/malte0811/ferritecore/fastmap/FastMapKey.java

@@ -1,6 +1,6 @@
 package malte0811.ferritecore.fastmap;
 
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 
 /**
  * Defines the indexing strategy for a single property in a FastMap

+ 15 - 16
common/src/main/java/malte0811/ferritecore/fastmap/PropertyIndexer.java

@@ -4,15 +4,14 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
-import net.minecraft.state.BooleanProperty;
-import net.minecraft.state.EnumProperty;
-import net.minecraft.state.IntegerProperty;
-import net.minecraft.state.Property;
-import net.minecraft.util.Direction;
-import net.minecraft.util.IStringSerializable;
-import net.minecraft.util.Util;
-
 import javax.annotation.Nullable;
+import net.minecraft.Util;
+import net.minecraft.core.Direction;
+import net.minecraft.util.StringRepresentable;
+import net.minecraft.world.level.block.state.properties.BooleanProperty;
+import net.minecraft.world.level.block.state.properties.EnumProperty;
+import net.minecraft.world.level.block.state.properties.IntegerProperty;
+import net.minecraft.world.level.block.state.properties.Property;
 import java.util.*;
 
 /**
@@ -21,7 +20,7 @@ import java.util.*;
  */
 public abstract class PropertyIndexer<T extends Comparable<T>> {
     private static final Map<Property<?>, PropertyIndexer<?>> KNOWN_INDEXERS = new Object2ObjectOpenCustomHashMap<>(
-            Util.identityHashStrategy()
+            Util.identityStrategy()
     );
 
     private final Property<T> property;
@@ -52,7 +51,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
 
     protected PropertyIndexer(Property<T> property) {
         this.property = property;
-        this.numValues = property.getAllowedValues().size();
+        this.numValues = property.getPossibleValues().size();
     }
 
     public Property<T> getProperty() {
@@ -72,7 +71,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
      * Checks if this indexer is valid, i.e. iterates over the correct set of values in the correct order
      */
     protected boolean isValid() {
-        Collection<T> allowed = getProperty().getAllowedValues();
+        Collection<T> allowed = getProperty().getPossibleValues();
         int index = 0;
         for (T val : allowed) {
             if (toIndex(val) != index || !val.equals(byIndex(index))) {
@@ -113,7 +112,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
 
         protected IntIndexer(IntegerProperty property) {
             super(property);
-            this.min = property.getAllowedValues().stream().min(Comparator.naturalOrder()).orElse(0);
+            this.min = property.getPossibleValues().stream().min(Comparator.naturalOrder()).orElse(0);
         }
 
         @Override
@@ -132,14 +131,14 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
         }
     }
 
-    private static class EnumIndexer<E extends Enum<E> & IStringSerializable>
+    private static class EnumIndexer<E extends Enum<E> & StringRepresentable>
             extends PropertyIndexer<E> {
         private final int ordinalOffset;
         private final E[] enumValues;
 
         protected EnumIndexer(EnumProperty<E> property) {
             super(property);
-            this.ordinalOffset = property.getAllowedValues()
+            this.ordinalOffset = property.getPossibleValues()
                     .stream()
                     .mapToInt(Enum::ordinal)
                     .min()
@@ -180,7 +179,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
         }
 
         static boolean isApplicable(Property<?> prop) {
-            Collection<?> values = prop.getAllowedValues();
+            Collection<?> values = prop.getPossibleValues();
             if (values.size() != ORDER.length) {
                 return false;
             }
@@ -223,7 +222,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
 
         protected GenericIndexer(Property<T> property) {
             super(property);
-            this.values = ImmutableList.copyOf(property.getAllowedValues());
+            this.values = ImmutableList.copyOf(property.getPossibleValues());
             ImmutableMap.Builder<Comparable<?>, Integer> toValueIndex = ImmutableMap.builder();
             for (int i = 0; i < this.values.size(); i++) {
                 toValueIndex.put(this.values.get(i), i);

+ 9 - 9
common/src/main/java/malte0811/ferritecore/hash/VoxelShapeArrayHash.java

@@ -3,24 +3,24 @@ package malte0811.ferritecore.hash;
 import it.unimi.dsi.fastutil.Hash;
 import malte0811.ferritecore.mixin.blockstatecache.VSArrayAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
-import net.minecraft.util.math.shapes.VoxelShape;
-import net.minecraft.util.math.shapes.VoxelShapeArray;
-import net.minecraft.util.math.shapes.VoxelShapePart;
+import net.minecraft.world.phys.shapes.ArrayVoxelShape;
+import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
+import net.minecraft.world.phys.shapes.VoxelShape;
 
 import java.util.Objects;
 
-public class VoxelShapeArrayHash implements Hash.Strategy<VoxelShapeArray> {
+public class VoxelShapeArrayHash implements Hash.Strategy<ArrayVoxelShape> {
     public static final VoxelShapeArrayHash INSTANCE = new VoxelShapeArrayHash();
 
     @Override
-    public int hashCode(VoxelShapeArray o) {
+    public int hashCode(ArrayVoxelShape o) {
         VSArrayAccess access = access(o);
         return 31 * Objects.hash(access.getXPoints(), access.getYPoints(), access.getZPoints())
                 + VoxelShapePartHash.INSTANCE.hashCode(getPart(o));
     }
 
     @Override
-    public boolean equals(VoxelShapeArray a, VoxelShapeArray b) {
+    public boolean equals(ArrayVoxelShape a, ArrayVoxelShape b) {
         if (a == b) {
             return true;
         } else if (a == null || b == null) {
@@ -35,11 +35,11 @@ public class VoxelShapeArrayHash implements Hash.Strategy<VoxelShapeArray> {
     }
 
     @SuppressWarnings("ConstantConditions")
-    private static VSArrayAccess access(VoxelShapeArray a) {
+    private static VSArrayAccess access(ArrayVoxelShape a) {
         return (VSArrayAccess) (Object) a;
     }
 
-    private static VoxelShapePart getPart(VoxelShape a) {
-        return ((VoxelShapeAccess) a).getPart();
+    private static DiscreteVoxelShape getPart(VoxelShape a) {
+        return ((VoxelShapeAccess) a).getShape();
     }
 }

+ 16 - 16
common/src/main/java/malte0811/ferritecore/hash/VoxelShapeHash.java

@@ -2,22 +2,22 @@ package malte0811.ferritecore.hash;
 
 import it.unimi.dsi.fastutil.Hash;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
-import net.minecraft.util.math.shapes.SplitVoxelShape;
-import net.minecraft.util.math.shapes.VoxelShape;
-import net.minecraft.util.math.shapes.VoxelShapeArray;
-import net.minecraft.util.math.shapes.VoxelShapeCube;
+import net.minecraft.world.phys.shapes.ArrayVoxelShape;
+import net.minecraft.world.phys.shapes.CubeVoxelShape;
+import net.minecraft.world.phys.shapes.SliceShape;
+import net.minecraft.world.phys.shapes.VoxelShape;
 
 public class VoxelShapeHash implements Hash.Strategy<VoxelShape> {
     public static final VoxelShapeHash INSTANCE = new VoxelShapeHash();
 
     @Override
     public int hashCode(VoxelShape o) {
-        if (o instanceof SplitVoxelShape) {
-            return VoxelShapeSplitHash.INSTANCE.hashCode((SplitVoxelShape) o);
-        } else if (o instanceof VoxelShapeArray) {
-            return VoxelShapeArrayHash.INSTANCE.hashCode((VoxelShapeArray) o);
-        } else if (o instanceof VoxelShapeCube) {
-            return VoxelShapePartHash.INSTANCE.hashCode(((VoxelShapeAccess) o).getPart());
+        if (o instanceof SliceShape) {
+            return VoxelShapeSplitHash.INSTANCE.hashCode((SliceShape) o);
+        } else if (o instanceof ArrayVoxelShape) {
+            return VoxelShapeArrayHash.INSTANCE.hashCode((ArrayVoxelShape) o);
+        } else if (o instanceof CubeVoxelShape) {
+            return VoxelShapePartHash.INSTANCE.hashCode(((VoxelShapeAccess) o).getShape());
         } else {
             //TODO VSCube?
             return o.hashCode();
@@ -32,13 +32,13 @@ public class VoxelShapeHash implements Hash.Strategy<VoxelShape> {
             return false;
         } else if (a.getClass() != b.getClass()) {
             return false;
-        } else if (a instanceof SplitVoxelShape) {
-            return VoxelShapeSplitHash.INSTANCE.equals((SplitVoxelShape) a, (SplitVoxelShape) b);
-        } else if (a instanceof VoxelShapeArray) {
-            return VoxelShapeArrayHash.INSTANCE.equals((VoxelShapeArray) a, (VoxelShapeArray) b);
-        } else if (a instanceof VoxelShapeCube) {
+        } else if (a instanceof SliceShape) {
+            return VoxelShapeSplitHash.INSTANCE.equals((SliceShape) a, (SliceShape) b);
+        } else if (a instanceof ArrayVoxelShape) {
+            return VoxelShapeArrayHash.INSTANCE.equals((ArrayVoxelShape) a, (ArrayVoxelShape) b);
+        } else if (a instanceof CubeVoxelShape) {
             return VoxelShapePartHash.INSTANCE.equals(
-                    ((VoxelShapeAccess) a).getPart(), ((VoxelShapeAccess) b).getPart()
+                    ((VoxelShapeAccess) a).getShape(), ((VoxelShapeAccess) b).getShape()
             );
         } else {
             return a.equals(b);

+ 34 - 34
common/src/main/java/malte0811/ferritecore/hash/VoxelShapePartHash.java

@@ -4,40 +4,40 @@ import it.unimi.dsi.fastutil.Hash;
 import malte0811.ferritecore.mixin.blockstatecache.VSPBitSetAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VSPSplitAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VSPartAccess;
-import net.minecraft.util.math.shapes.BitSetVoxelShapePart;
-import net.minecraft.util.math.shapes.PartSplitVoxelShape;
-import net.minecraft.util.math.shapes.VoxelShapePart;
+import net.minecraft.world.phys.shapes.BitSetDiscreteVoxelShape;
+import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
+import net.minecraft.world.phys.shapes.SubShape;
 
 import java.util.Objects;
 
-public class VoxelShapePartHash implements Hash.Strategy<VoxelShapePart> {
+public class VoxelShapePartHash implements Hash.Strategy<DiscreteVoxelShape> {
     public static final VoxelShapePartHash INSTANCE = new VoxelShapePartHash();
 
     @Override
-    public int hashCode(VoxelShapePart o) {
+    public int hashCode(DiscreteVoxelShape o) {
         VSPartAccess generalAccess = (VSPartAccess) o;
         int result = generalAccess.getXSize();
         result = 31 * result + generalAccess.getYSize();
         result = 31 * result + generalAccess.getZSize();
-        if (o instanceof PartSplitVoxelShape) {
-            VSPSplitAccess access = access((PartSplitVoxelShape) o);
+        if (o instanceof SubShape) {
+            VSPSplitAccess access = access((SubShape) o);
             result = 31 * result + access.getStartX();
             result = 31 * result + access.getStartY();
             result = 31 * result + access.getStartZ();
             result = 31 * result + access.getEndX();
             result = 31 * result + access.getEndY();
             result = 31 * result + access.getEndZ();
-            result = 31 * result + hashCode(access.getPart());
+            result = 31 * result + hashCode(access.getParent());
             return result;
-        } else if (o instanceof BitSetVoxelShapePart) {
-            VSPBitSetAccess access = access((BitSetVoxelShapePart) o);
-            result = 31 * result + access.getStartX();
-            result = 31 * result + access.getStartY();
-            result = 31 * result + access.getStartZ();
-            result = 31 * result + access.getEndX();
-            result = 31 * result + access.getEndY();
-            result = 31 * result + access.getEndZ();
-            result = 31 * result + Objects.hashCode(access.getBitSet());
+        } else if (o instanceof BitSetDiscreteVoxelShape) {
+            VSPBitSetAccess access = access((BitSetDiscreteVoxelShape) o);
+            result = 31 * result + access.getXMin();
+            result = 31 * result + access.getYMin();
+            result = 31 * result + access.getZMin();
+            result = 31 * result + access.getXMax();
+            result = 31 * result + access.getYMax();
+            result = 31 * result + access.getZMax();
+            result = 31 * result + Objects.hashCode(access.getStorage());
             return result;
         } else {
             return 31 * result + Objects.hashCode(o);
@@ -45,7 +45,7 @@ public class VoxelShapePartHash implements Hash.Strategy<VoxelShapePart> {
     }
 
     @Override
-    public boolean equals(VoxelShapePart a, VoxelShapePart b) {
+    public boolean equals(DiscreteVoxelShape a, DiscreteVoxelShape b) {
         if (a == b) {
             return true;
         } else if (a == null || b == null) {
@@ -61,38 +61,38 @@ public class VoxelShapePartHash implements Hash.Strategy<VoxelShapePart> {
         ) {
             return false;
         }
-        if (a instanceof PartSplitVoxelShape) {
-            VSPSplitAccess accessA = access((PartSplitVoxelShape) a);
-            VSPSplitAccess accessB = access((PartSplitVoxelShape) b);
-            return accessA.getEndX() == accessB.getEndX() &&
-                    accessA.getEndY() == accessB.getEndY() &&
-                    accessA.getEndZ() == accessB.getEndZ() &&
-                    accessA.getStartX() == accessB.getStartX() &&
-                    accessA.getStartY() == accessB.getStartY() &&
-                    accessA.getStartZ() == accessB.getStartZ() &&
-                    equals(accessA.getPart(), accessB.getPart());
-        } else if (a instanceof BitSetVoxelShapePart) {
-            VSPBitSetAccess accessA = access((BitSetVoxelShapePart) a);
-            VSPBitSetAccess accessB = access((BitSetVoxelShapePart) b);
+        if (a instanceof SubShape) {
+            VSPSplitAccess accessA = access((SubShape) a);
+            VSPSplitAccess accessB = access((SubShape) b);
             return accessA.getEndX() == accessB.getEndX() &&
                     accessA.getEndY() == accessB.getEndY() &&
                     accessA.getEndZ() == accessB.getEndZ() &&
                     accessA.getStartX() == accessB.getStartX() &&
                     accessA.getStartY() == accessB.getStartY() &&
                     accessA.getStartZ() == accessB.getStartZ() &&
-                    accessA.getBitSet().equals(accessB.getBitSet());
+                    equals(accessA.getParent(), accessB.getParent());
+        } else if (a instanceof BitSetDiscreteVoxelShape) {
+            VSPBitSetAccess accessA = access((BitSetDiscreteVoxelShape) a);
+            VSPBitSetAccess accessB = access((BitSetDiscreteVoxelShape) b);
+            return accessA.getXMax() == accessB.getXMax() &&
+                    accessA.getYMax() == accessB.getYMax() &&
+                    accessA.getZMax() == accessB.getZMax() &&
+                    accessA.getXMin() == accessB.getXMin() &&
+                    accessA.getYMin() == accessB.getYMin() &&
+                    accessA.getZMin() == accessB.getZMin() &&
+                    accessA.getStorage().equals(accessB.getStorage());
         } else {
             return a.equals(b);
         }
     }
 
     @SuppressWarnings("ConstantConditions")
-    private static VSPSplitAccess access(PartSplitVoxelShape part) {
+    private static VSPSplitAccess access(SubShape part) {
         return (VSPSplitAccess) (Object) part;
     }
 
     @SuppressWarnings("ConstantConditions")
-    private static VSPBitSetAccess access(BitSetVoxelShapePart part) {
+    private static VSPBitSetAccess access(BitSetDiscreteVoxelShape part) {
         return (VSPBitSetAccess) (Object) part;
     }
 }

+ 11 - 11
common/src/main/java/malte0811/ferritecore/hash/VoxelShapeSplitHash.java

@@ -3,26 +3,26 @@ package malte0811.ferritecore.hash;
 import it.unimi.dsi.fastutil.Hash;
 import malte0811.ferritecore.mixin.blockstatecache.VSSplitAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
-import net.minecraft.util.math.shapes.SplitVoxelShape;
-import net.minecraft.util.math.shapes.VoxelShape;
-import net.minecraft.util.math.shapes.VoxelShapePart;
+import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
+import net.minecraft.world.phys.shapes.SliceShape;
+import net.minecraft.world.phys.shapes.VoxelShape;
 
 import java.util.Objects;
 
-public class VoxelShapeSplitHash implements Hash.Strategy<SplitVoxelShape> {
+public class VoxelShapeSplitHash implements Hash.Strategy<SliceShape> {
     public static final VoxelShapeSplitHash INSTANCE = new VoxelShapeSplitHash();
 
     @Override
-    public int hashCode(SplitVoxelShape o) {
+    public int hashCode(SliceShape o) {
         VSSplitAccess access = access(o);
         int result = Objects.hashCode(access.getAxis());
         result = 31 * result + VoxelShapePartHash.INSTANCE.hashCode(getPart(o));
-        result = 31 * result + VoxelShapeHash.INSTANCE.hashCode(access.getShape());
+        result = 31 * result + VoxelShapeHash.INSTANCE.hashCode(access.getDelegate());
         return result;
     }
 
     @Override
-    public boolean equals(SplitVoxelShape a, SplitVoxelShape b) {
+    public boolean equals(SliceShape a, SliceShape b) {
         if (a == b) {
             return true;
         } else if (a == null || b == null) {
@@ -31,15 +31,15 @@ public class VoxelShapeSplitHash implements Hash.Strategy<SplitVoxelShape> {
         VSSplitAccess accessA = access(a);
         VSSplitAccess accessB = access(b);
         return Objects.equals(accessA.getAxis(), accessB.getAxis()) &&
-                VoxelShapeHash.INSTANCE.equals(accessA.getShape(), accessB.getShape()) &&
+                VoxelShapeHash.INSTANCE.equals(accessA.getDelegate(), accessB.getDelegate()) &&
                 VoxelShapePartHash.INSTANCE.equals(getPart(a), getPart(b));
     }
 
-    private static VSSplitAccess access(SplitVoxelShape a) {
+    private static VSSplitAccess access(SliceShape a) {
         return (VSSplitAccess) a;
     }
 
-    private static VoxelShapePart getPart(VoxelShape a) {
-        return ((VoxelShapeAccess) a).getPart();
+    private static DiscreteVoxelShape getPart(VoxelShape a) {
+        return ((VoxelShapeAccess) a).getShape();
     }
 }

+ 28 - 29
common/src/main/java/malte0811/ferritecore/impl/BlockStateCacheImpl.java

@@ -8,10 +8,11 @@ import malte0811.ferritecore.mixin.blockstatecache.VSArrayAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VSSplitAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
 import malte0811.ferritecore.util.Constants;
-import net.minecraft.util.LazyValue;
-import net.minecraft.util.math.shapes.SplitVoxelShape;
-import net.minecraft.util.math.shapes.VoxelShape;
-import net.minecraft.util.math.shapes.VoxelShapeArray;
+import net.minecraft.util.LazyLoadedValue;
+import net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase;
+import net.minecraft.world.phys.shapes.ArrayVoxelShape;
+import net.minecraft.world.phys.shapes.SliceShape;
+import net.minecraft.world.phys.shapes.VoxelShape;
 import org.apache.commons.lang3.tuple.Pair;
 
 import javax.annotation.Nullable;
@@ -21,10 +22,8 @@ import java.lang.reflect.Field;
 import java.util.Map;
 import java.util.function.Function;
 
-import static net.minecraft.block.AbstractBlock.AbstractBlockState;
-
 public class BlockStateCacheImpl {
-    public static final Map<VoxelShapeArray, VoxelShapeArray> CACHE_COLLIDE = new Object2ObjectOpenCustomHashMap<>(
+    public static final Map<ArrayVoxelShape, ArrayVoxelShape> CACHE_COLLIDE = new Object2ObjectOpenCustomHashMap<>(
             VoxelShapeArrayHash.INSTANCE
     );
     // Maps a shape to the "canonical instance" of that shape and its side projections
@@ -33,10 +32,10 @@ public class BlockStateCacheImpl {
 
     // Get the cache from a blockstate. Mixin does not handle private inner classes too well, so method handles and
     // manual remapping it is
-    private static final LazyValue<Function<AbstractBlockState, BlockStateCacheAccess>> GET_CACHE =
-            new LazyValue<>(() -> {
+    private static final LazyLoadedValue<Function<BlockStateBase, BlockStateCacheAccess>> GET_CACHE =
+            new LazyLoadedValue<>(() -> {
                 try {
-                    Field cacheField = AbstractBlockState.class.getDeclaredField(Constants.blockstateCacheFieldName);
+                    Field cacheField = BlockStateBase.class.getDeclaredField(Constants.blockstateCacheFieldName);
                     cacheField.setAccessible(true);
                     MethodHandle getter = MethodHandles.lookup().unreflectGetter(cacheField);
                     return state -> {
@@ -55,13 +54,13 @@ public class BlockStateCacheImpl {
     private static final ThreadLocal<BlockStateCacheAccess> LAST_CACHE = new ThreadLocal<>();
 
     // Calls before the cache for <code>state</code> is (re-)populated
-    public static void deduplicateCachePre(AbstractBlockState state) {
-        LAST_CACHE.set(GET_CACHE.getValue().apply(state));
+    public static void deduplicateCachePre(BlockStateBase state) {
+        LAST_CACHE.set(GET_CACHE.get().apply(state));
     }
 
     // Calls after the cache for <code>state</code> is (re-)populated
-    public static void deduplicateCachePost(AbstractBlockState state) {
-        BlockStateCacheAccess newCache = GET_CACHE.getValue().apply(state);
+    public static void deduplicateCachePost(BlockStateBase state) {
+        BlockStateCacheAccess newCache = GET_CACHE.get().apply(state);
         if (newCache != null) {
             final BlockStateCacheAccess oldCache = LAST_CACHE.get();
             deduplicateCollisionShape(newCache, oldCache);
@@ -80,9 +79,9 @@ public class BlockStateCacheImpl {
             dedupedCollisionShape = oldCache.getCollisionShape();
         } else {
             dedupedCollisionShape = newCache.getCollisionShape();
-            if (dedupedCollisionShape instanceof VoxelShapeArray) {
+            if (dedupedCollisionShape instanceof ArrayVoxelShape) {
                 dedupedCollisionShape = CACHE_COLLIDE.computeIfAbsent(
-                        (VoxelShapeArray) dedupedCollisionShape, Function.identity()
+                        (ArrayVoxelShape) dedupedCollisionShape, Function.identity()
                 );
             }
         }
@@ -93,36 +92,36 @@ public class BlockStateCacheImpl {
     private static void deduplicateRenderShapes(
             BlockStateCacheAccess newCache, @Nullable BlockStateCacheAccess oldCache
     ) {
-        final VoxelShape newRenderShape = getRenderShape(newCache.getRenderShapes());
+        final VoxelShape newRenderShape = getRenderShape(newCache.getOcclusionShapes());
         if (newRenderShape == null) {
             return;
         }
         Pair<VoxelShape, VoxelShape[]> dedupedRenderShapes = null;
         if (oldCache != null) {
-            final VoxelShape oldRenderShape = getRenderShape(oldCache.getRenderShapes());
+            final VoxelShape oldRenderShape = getRenderShape(oldCache.getOcclusionShapes());
             if (VoxelShapeHash.INSTANCE.equals(newRenderShape, oldRenderShape)) {
-                dedupedRenderShapes = Pair.of(oldRenderShape, oldCache.getRenderShapes());
+                dedupedRenderShapes = Pair.of(oldRenderShape, oldCache.getOcclusionShapes());
             }
         }
         if (dedupedRenderShapes == null) {
             // Who thought that this was a good interface for putIfAbsent…
-            Pair<VoxelShape, VoxelShape[]> newPair = Pair.of(newRenderShape, newCache.getRenderShapes());
+            Pair<VoxelShape, VoxelShape[]> newPair = Pair.of(newRenderShape, newCache.getOcclusionShapes());
             dedupedRenderShapes = CACHE_PROJECT.putIfAbsent(newRenderShape, newPair);
             if (dedupedRenderShapes == null) {
                 dedupedRenderShapes = newPair;
             }
         }
         replaceInternals(dedupedRenderShapes.getLeft(), newRenderShape);
-        newCache.setRenderShapes(dedupedRenderShapes.getRight());
+        newCache.setOcclusionShapes(dedupedRenderShapes.getRight());
     }
 
     private static void replaceInternals(VoxelShape toKeep, VoxelShape toReplace) {
-        if (toKeep instanceof VoxelShapeArray && toReplace instanceof VoxelShapeArray) {
-            replaceInternals((VoxelShapeArray) toKeep, (VoxelShapeArray) toReplace);
+        if (toKeep instanceof ArrayVoxelShape && toReplace instanceof ArrayVoxelShape) {
+            replaceInternals((ArrayVoxelShape) toKeep, (ArrayVoxelShape) toReplace);
         }
     }
 
-    public static void replaceInternals(VoxelShapeArray toKeep, VoxelShapeArray toReplace) {
+    public static void replaceInternals(ArrayVoxelShape toKeep, ArrayVoxelShape toReplace) {
         if (toKeep == toReplace) {
             return;
         }
@@ -135,12 +134,12 @@ public class BlockStateCacheImpl {
         access(toReplace).setXPoints(access(toKeep).getXPoints());
         access(toReplace).setYPoints(access(toKeep).getYPoints());
         access(toReplace).setZPoints(access(toKeep).getZPoints());
-        accessVS(toReplace).setProjectionCache(accessVS(toKeep).getProjectionCache());
-        accessVS(toReplace).setPart(accessVS(toKeep).getPart());
+        accessVS(toReplace).setFaces(accessVS(toKeep).getFaces());
+        accessVS(toReplace).setShape(accessVS(toKeep).getShape());
     }
 
     @SuppressWarnings("ConstantConditions")
-    private static VSArrayAccess access(VoxelShapeArray a) {
+    private static VSArrayAccess access(ArrayVoxelShape a) {
         return (VSArrayAccess) (Object) a;
     }
 
@@ -152,8 +151,8 @@ public class BlockStateCacheImpl {
     private static VoxelShape getRenderShape(@Nullable VoxelShape[] projected) {
         if (projected != null) {
             for (VoxelShape side : projected) {
-                if (side instanceof SplitVoxelShape) {
-                    return ((VSSplitAccess) side).getShape();
+                if (side instanceof SliceShape) {
+                    return ((VSSplitAccess) side).getDelegate();
                 }
             }
         }

+ 16 - 16
common/src/main/java/malte0811/ferritecore/impl/Deduplicator.java

@@ -5,15 +5,15 @@ import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
 import malte0811.ferritecore.hash.LambdaBasedHash;
 import malte0811.ferritecore.mixin.dedupbakedquad.BakedQuadAccess;
 import malte0811.ferritecore.util.PredicateHelper;
-import net.minecraft.block.BlockState;
 import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.model.BakedQuad;
-import net.minecraft.client.renderer.model.IBakedModel;
-import net.minecraft.client.renderer.model.MultipartBakedModel;
-import net.minecraft.client.resources.ReloadListener;
-import net.minecraft.profiler.IProfiler;
-import net.minecraft.resources.IReloadableResourceManager;
-import net.minecraft.resources.IResourceManager;
+import net.minecraft.client.renderer.block.model.BakedQuad;
+import net.minecraft.client.resources.model.BakedModel;
+import net.minecraft.client.resources.model.MultiPartBakedModel;
+import net.minecraft.server.packs.resources.ReloadableResourceManager;
+import net.minecraft.server.packs.resources.ResourceManager;
+import net.minecraft.server.packs.resources.SimplePreparableReloadListener;
+import net.minecraft.util.profiling.ProfilerFiller;
+import net.minecraft.world.level.block.state.BlockState;
 import org.apache.commons.lang3.tuple.Pair;
 
 import java.util.Arrays;
@@ -26,7 +26,7 @@ import java.util.function.Predicate;
 public class Deduplicator {
     private static final Map<String, String> VARIANT_IDENTITIES = new ConcurrentHashMap<>();
     // Typedefs would be a nice thing to have
-    private static final Map<List<Pair<Predicate<BlockState>, IBakedModel>>, MultipartBakedModel> KNOWN_MULTIPART_MODELS = new ConcurrentHashMap<>();
+    private static final Map<List<Pair<Predicate<BlockState>, BakedModel>>, MultiPartBakedModel> KNOWN_MULTIPART_MODELS = new ConcurrentHashMap<>();
     private static final Map<List<Predicate<BlockState>>, Predicate<BlockState>> OR_PREDICATE_CACHE = new ConcurrentHashMap<>();
     private static final Map<List<Predicate<BlockState>>, Predicate<BlockState>> AND_PREDICATE_CACHE = new ConcurrentHashMap<>();
     private static final Object2ObjectOpenCustomHashMap<int[], int[]> BAKED_QUAD_CACHE = new Object2ObjectOpenCustomHashMap<>(
@@ -37,8 +37,8 @@ public class Deduplicator {
         return VARIANT_IDENTITIES.computeIfAbsent(variant, Function.identity());
     }
 
-    public static MultipartBakedModel makeMultipartModel(List<Pair<Predicate<BlockState>, IBakedModel>> selectors) {
-        return KNOWN_MULTIPART_MODELS.computeIfAbsent(selectors, MultipartBakedModel::new);
+    public static MultiPartBakedModel makeMultipartModel(List<Pair<Predicate<BlockState>, BakedModel>> selectors) {
+        return KNOWN_MULTIPART_MODELS.computeIfAbsent(selectors, MultiPartBakedModel::new);
     }
 
     public static Predicate<BlockState> or(List<Predicate<BlockState>> list) {
@@ -51,21 +51,21 @@ public class Deduplicator {
 
     public static void deduplicate(BakedQuad bq) {
         synchronized (BAKED_QUAD_CACHE) {
-            int[] deduped = BAKED_QUAD_CACHE.computeIfAbsent(bq.getVertexData(), Function.identity());
-            ((BakedQuadAccess) bq).setVertexData(deduped);
+            int[] deduped = BAKED_QUAD_CACHE.computeIfAbsent(bq.getVertices(), Function.identity());
+            ((BakedQuadAccess) bq).setVertices(deduped);
         }
     }
 
     public static void registerReloadListener() {
         // Register the reload listener s.t. its "sync" part runs after the model loader reload
-        ((IReloadableResourceManager) Minecraft.getInstance().getResourceManager()).addReloadListener(new ReloadListener<Unit>() {
+        ((ReloadableResourceManager) Minecraft.getInstance().getResourceManager()).registerReloadListener(new SimplePreparableReloadListener<Unit>() {
             @Override
-            protected Unit prepare(IResourceManager iResourceManager, IProfiler iProfiler) {
+            protected Unit prepare(ResourceManager iResourceManager, ProfilerFiller iProfiler) {
                 return Unit.INSTANCE;
             }
 
             @Override
-            protected void apply(Unit object, IResourceManager iResourceManager, IProfiler iProfiler) {
+            protected void apply(Unit object, ResourceManager iResourceManager, ProfilerFiller iProfiler) {
                 VARIANT_IDENTITIES.clear();
                 KNOWN_MULTIPART_MODELS.clear();
                 OR_PREDICATE_CACHE.clear();

+ 9 - 9
common/src/main/java/malte0811/ferritecore/impl/PropertyValueConditionImpl.java

@@ -2,10 +2,10 @@ package malte0811.ferritecore.impl;
 
 import com.google.common.base.Splitter;
 import malte0811.ferritecore.util.PredicateHelper;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.state.Property;
-import net.minecraft.state.StateContainer;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.block.state.StateDefinition;
+import net.minecraft.world.level.block.state.properties.Property;
 import org.apache.commons.lang3.tuple.Pair;
 
 import java.util.List;
@@ -19,11 +19,11 @@ public class PropertyValueConditionImpl {
     private static final Map<Pair<Property<?>, Comparable<?>>, Predicate<BlockState>> STATE_HAS_PROPERTY_CACHE = new ConcurrentHashMap<>();
 
     /**
-     * A copy of {@link net.minecraft.client.renderer.model.multipart.PropertyValueCondition#getPredicate(StateContainer)}
+     * A copy of {@link net.minecraft.client.renderer.block.model.multipart.KeyValueCondition#getPredicate(StateDefinition)}
      * since targeting the correct line is near impossible
      */
     public static Predicate<BlockState> getPredicate(
-            StateContainer<Block, BlockState> stateContainer, String key, String value, Splitter splitter
+            StateDefinition<Block, BlockState> stateContainer, String key, String value, Splitter splitter
     ) {
         Property<?> property = stateContainer.getProperty(key);
         if (property == null) {
@@ -64,9 +64,9 @@ public class PropertyValueConditionImpl {
 
     private static <T extends Comparable<T>>
     Predicate<BlockState> makePropertyPredicate(
-            StateContainer<Block, BlockState> container, Property<T> property, String subValue, String key, String value
+            StateDefinition<Block, BlockState> container, Property<T> property, String subValue, String key, String value
     ) {
-        Optional<T> optional = property.parseValue(subValue);
+        Optional<T> optional = property.getValue(subValue);
         if (!optional.isPresent()) {
             throw new RuntimeException(String.format(
                     "Unknown value '%s' for property '%s' on '%s' in '%s'",
@@ -79,7 +79,7 @@ public class PropertyValueConditionImpl {
                     pair -> {
                         Comparable<?> valueInt = pair.getRight();
                         Property<?> propInt = pair.getLeft();
-                        return state -> state.get(propInt).equals(valueInt);
+                        return state -> state.getValue(propInt).equals(valueInt);
                     }
             );
         }

+ 2 - 3
common/src/main/java/malte0811/ferritecore/impl/StateHolderImpl.java

@@ -4,8 +4,7 @@ import malte0811.ferritecore.classloading.FastImmutableMapDefiner;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
 import malte0811.ferritecore.fastmap.FastMap;
 import malte0811.ferritecore.mixin.config.FerriteConfig;
-import net.minecraft.state.Property;
-
+import net.minecraft.world.level.block.state.properties.Property;
 import java.util.Map;
 
 public class StateHolderImpl {
@@ -14,7 +13,7 @@ public class StateHolderImpl {
 
     /**
      * Set up the {@link FastMap} used by the given {@link FastMapStateHolder} to handle neighbors and property lookups.
-     * This is called in a loop for each {@link net.minecraft.state.StateContainer}, so all state holders of a given
+     * This is called in a loop for each {@link net.minecraft.world.level.block.state.StateDefinition}, so all state holders of a given
      * container will use the same {@link FastMap} instance.
      */
     public static <S>

+ 6 - 6
common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/AbstractBlockStateMixin.java

@@ -1,21 +1,21 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 
 import malte0811.ferritecore.impl.BlockStateCacheImpl;
-import net.minecraft.block.AbstractBlock;
+import net.minecraft.world.level.block.state.BlockBehaviour;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
 import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
 
-@Mixin(AbstractBlock.AbstractBlockState.class)
+@Mixin(BlockBehaviour.BlockStateBase.class)
 public class AbstractBlockStateMixin {
-    @Inject(method = "cacheState", at = @At("HEAD"))
+    @Inject(method = "initCache", at = @At("HEAD"))
     public void cacheStateHead(CallbackInfo ci) {
-        BlockStateCacheImpl.deduplicateCachePre((AbstractBlock.AbstractBlockState) (Object) this);
+        BlockStateCacheImpl.deduplicateCachePre((BlockBehaviour.BlockStateBase) (Object) this);
     }
 
-    @Inject(method = "cacheState", at = @At("TAIL"))
+    @Inject(method = "initCache", at = @At("TAIL"))
     public void cacheStateTail(CallbackInfo ci) {
-        BlockStateCacheImpl.deduplicateCachePost((AbstractBlock.AbstractBlockState) (Object) this);
+        BlockStateCacheImpl.deduplicateCachePost((BlockBehaviour.BlockStateBase) (Object) this);
     }
 }

+ 4 - 4
common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/BlockStateCacheAccess.java

@@ -1,13 +1,13 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 
-import net.minecraft.util.math.shapes.VoxelShape;
+import net.minecraft.world.phys.shapes.VoxelShape;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 import javax.annotation.Nullable;
 
-@Mixin(targets = "net.minecraft.block.AbstractBlock$AbstractBlockState$Cache")
+@Mixin(targets = "net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase$Cache")
 public interface BlockStateCacheAccess {
     @Accessor
     VoxelShape getCollisionShape();
@@ -18,9 +18,9 @@ public interface BlockStateCacheAccess {
 
     @Accessor
     @Nullable
-    VoxelShape[] getRenderShapes();
+    VoxelShape[] getOcclusionShapes();
 
     @Accessor
     @Mutable
-    void setRenderShapes(@Nullable VoxelShape[] newShapes);
+    void setOcclusionShapes(@Nullable VoxelShape[] newShapes);
 }

+ 8 - 8
common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSArrayAccess.java

@@ -1,27 +1,27 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 
 import it.unimi.dsi.fastutil.doubles.DoubleList;
-import net.minecraft.util.math.shapes.VoxelShapeArray;
+import net.minecraft.world.phys.shapes.ArrayVoxelShape;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
-@Mixin(VoxelShapeArray.class)
+@Mixin(ArrayVoxelShape.class)
 public interface VSArrayAccess {
-    @Accessor
+    @Accessor("xs")
     void setXPoints(DoubleList newPoints);
 
-    @Accessor
+    @Accessor("ys")
     void setYPoints(DoubleList newPoints);
 
-    @Accessor
+    @Accessor("zs")
     void setZPoints(DoubleList newPoints);
 
-    @Accessor
+    @Accessor("xs")
     DoubleList getXPoints();
 
-    @Accessor
+    @Accessor("ys")
     DoubleList getYPoints();
 
-    @Accessor
+    @Accessor("zs")
     DoubleList getZPoints();
 }

+ 9 - 9
common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSPBitSetAccess.java

@@ -1,31 +1,31 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 
-import net.minecraft.util.math.shapes.BitSetVoxelShapePart;
+import net.minecraft.world.phys.shapes.BitSetDiscreteVoxelShape;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 import java.util.BitSet;
 
-@Mixin(BitSetVoxelShapePart.class)
+@Mixin(BitSetDiscreteVoxelShape.class)
 public interface VSPBitSetAccess {
     @Accessor
-    BitSet getBitSet();
+    BitSet getStorage();
 
     @Accessor
-    int getStartX();
+    int getXMin();
 
     @Accessor
-    int getStartY();
+    int getYMin();
 
     @Accessor
-    int getStartZ();
+    int getZMin();
 
     @Accessor
-    int getEndX();
+    int getXMax();
 
     @Accessor
-    int getEndY();
+    int getYMax();
 
     @Accessor
-    int getEndZ();
+    int getZMax();
 }

+ 4 - 4
common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSPSplitAccess.java

@@ -1,14 +1,14 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 
-import net.minecraft.util.math.shapes.PartSplitVoxelShape;
-import net.minecraft.util.math.shapes.VoxelShapePart;
+import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
+import net.minecraft.world.phys.shapes.SubShape;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
-@Mixin(PartSplitVoxelShape.class)
+@Mixin(SubShape.class)
 public interface VSPSplitAccess {
     @Accessor
-    VoxelShapePart getPart();
+    DiscreteVoxelShape getParent();
 
     @Accessor
     int getStartX();

+ 2 - 2
common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSPartAccess.java

@@ -1,10 +1,10 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 
-import net.minecraft.util.math.shapes.VoxelShapePart;
+import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
-@Mixin(VoxelShapePart.class)
+@Mixin(DiscreteVoxelShape.class)
 public interface VSPartAccess {
     @Accessor
     int getXSize();

+ 5 - 9
common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VSSplitAccess.java

@@ -1,20 +1,16 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 
-import net.minecraft.util.Direction;
-import net.minecraft.util.math.shapes.SplitVoxelShape;
-import net.minecraft.util.math.shapes.VoxelShape;
+import net.minecraft.core.Direction;
+import net.minecraft.world.phys.shapes.SliceShape;
+import net.minecraft.world.phys.shapes.VoxelShape;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
-@Mixin(SplitVoxelShape.class)
+@Mixin(SliceShape.class)
 public interface VSSplitAccess {
     @Accessor
-    @Mutable
-    void setShape(VoxelShape newShape);
-
-    @Accessor
-    VoxelShape getShape();
+    VoxelShape getDelegate();
 
     @Accessor
     Direction.Axis getAxis();

+ 6 - 6
common/src/main/java/malte0811/ferritecore/mixin/blockstatecache/VoxelShapeAccess.java

@@ -1,7 +1,7 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 
-import net.minecraft.util.math.shapes.VoxelShape;
-import net.minecraft.util.math.shapes.VoxelShapePart;
+import net.minecraft.world.phys.shapes.DiscreteVoxelShape;
+import net.minecraft.world.phys.shapes.VoxelShape;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
@@ -11,16 +11,16 @@ import javax.annotation.Nullable;
 @Mixin(VoxelShape.class)
 public interface VoxelShapeAccess {
     @Accessor
-    VoxelShapePart getPart();
+    DiscreteVoxelShape getShape();
 
     @Accessor
     @Nullable
-    VoxelShape[] getProjectionCache();
+    VoxelShape[] getFaces();
 
     @Accessor
     @Mutable
-    void setPart(VoxelShapePart newPart);
+    void setShape(DiscreteVoxelShape newPart);
 
     @Accessor
-    void setProjectionCache(@Nullable VoxelShape[] newCache);
+    void setFaces(@Nullable VoxelShape[] newCache);
 }

+ 2 - 2
common/src/main/java/malte0811/ferritecore/mixin/dedupbakedquad/BakedQuadAccess.java

@@ -1,6 +1,6 @@
 package malte0811.ferritecore.mixin.dedupbakedquad;
 
-import net.minecraft.client.renderer.model.BakedQuad;
+import net.minecraft.client.renderer.block.model.BakedQuad;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
@@ -9,5 +9,5 @@ import org.spongepowered.asm.mixin.gen.Accessor;
 public interface BakedQuadAccess {
     @Accessor
     @Mutable
-    void setVertexData(int[] newVertexData);
+    void setVertices(int[] newVertexData);
 }

+ 5 - 5
common/src/main/java/malte0811/ferritecore/mixin/dedupbakedquad/SimpleModelBuilderMixin.java

@@ -1,9 +1,9 @@
 package malte0811.ferritecore.mixin.dedupbakedquad;
 
 import malte0811.ferritecore.impl.Deduplicator;
-import net.minecraft.client.renderer.model.BakedQuad;
-import net.minecraft.client.renderer.model.SimpleBakedModel;
-import net.minecraft.util.Direction;
+import net.minecraft.client.renderer.block.model.BakedQuad;
+import net.minecraft.client.resources.model.SimpleBakedModel;
+import net.minecraft.core.Direction;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
@@ -11,12 +11,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
 
 @Mixin(SimpleBakedModel.Builder.class)
 public class SimpleModelBuilderMixin {
-    @Inject(method = "addGeneralQuad", at = @At("HEAD"))
+    @Inject(method = "addUnculledFace", at = @At("HEAD"))
     public void deduplicate(BakedQuad quad, CallbackInfoReturnable<SimpleBakedModel.Builder> cir) {
         Deduplicator.deduplicate(quad);
     }
 
-    @Inject(method = "addFaceQuad", at = @At("HEAD"))
+    @Inject(method = "addCulledFace", at = @At("HEAD"))
     public void deduplicate(
             Direction direction, BakedQuad quad, CallbackInfoReturnable<SimpleBakedModel.Builder> cir
     ) {

+ 6 - 6
common/src/main/java/malte0811/ferritecore/mixin/dedupmultipart/MixinMultipartBuilder.java

@@ -1,9 +1,9 @@
 package malte0811.ferritecore.mixin.dedupmultipart;
 
 import malte0811.ferritecore.impl.Deduplicator;
-import net.minecraft.block.BlockState;
-import net.minecraft.client.renderer.model.IBakedModel;
-import net.minecraft.client.renderer.model.MultipartBakedModel;
+import net.minecraft.client.resources.model.BakedModel;
+import net.minecraft.client.resources.model.MultiPartBakedModel;
+import net.minecraft.world.level.block.state.BlockState;
 import org.apache.commons.lang3.tuple.Pair;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
@@ -12,13 +12,13 @@ import org.spongepowered.asm.mixin.injection.Redirect;
 import java.util.List;
 import java.util.function.Predicate;
 
-@Mixin(MultipartBakedModel.Builder.class)
+@Mixin(MultiPartBakedModel.Builder.class)
 public class MixinMultipartBuilder {
     @Redirect(
             method = "build",
-            at = @At(value = "NEW", target = "(Ljava/util/List;)Lnet/minecraft/client/renderer/model/MultipartBakedModel;")
+            at = @At(value = "NEW", target = "(Ljava/util/List;)Lnet/minecraft/client/resources/model/MultiPartBakedModel;")
     )
-    public MultipartBakedModel build(List<Pair<Predicate<BlockState>, IBakedModel>> selectors) {
+    public MultiPartBakedModel build(List<Pair<Predicate<BlockState>, BakedModel>> selectors) {
         return Deduplicator.makeMultipartModel(selectors);
     }
 }

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

@@ -5,8 +5,8 @@ import com.google.common.collect.Table;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
 import malte0811.ferritecore.fastmap.FastMap;
 import malte0811.ferritecore.impl.StateHolderImpl;
-import net.minecraft.state.Property;
-import net.minecraft.state.StateHolder;
+import net.minecraft.world.level.block.state.StateHolder;
+import net.minecraft.world.level.block.state.properties.Property;
 import org.spongepowered.asm.mixin.*;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Redirect;
@@ -18,13 +18,13 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
     @Mutable
     @Shadow
     @Final
-    private ImmutableMap<Property<?>, Comparable<?>> properties;
+    private ImmutableMap<Property<?>, Comparable<?>> values;
 
     private int globalTableIndex;
     private FastMap<S> globalTable;
 
     @Redirect(
-            method = "with",
+            method = "setValue",
             at = @At(
                     value = "INVOKE",
                     target = "Lcom/google/common/collect/Table;get(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
@@ -41,7 +41,7 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
      * @author malte0811
      */
     @Overwrite
-    public void func_235899_a_(Map<Map<Property<?>, Comparable<?>>, S> states) {
+    public void populateNeighbours(Map<Map<Property<?>, Comparable<?>>, S> states) {
         StateHolderImpl.populateNeighbors(states, this);
     }
 
@@ -57,12 +57,12 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
 
     @Override
     public ImmutableMap<Property<?>, Comparable<?>> getVanillaPropertyMap() {
-        return properties;
+        return values;
     }
 
     @Override
     public void replacePropertyMap(ImmutableMap<Property<?>, Comparable<?>> newMap) {
-        properties = newMap;
+        values = newMap;
     }
 
     @Override

+ 3 - 3
common/src/main/java/malte0811/ferritecore/mixin/mrl/ModelResourceLocationMixin.java

@@ -1,8 +1,8 @@
 package malte0811.ferritecore.mixin.mrl;
 
 import malte0811.ferritecore.impl.Deduplicator;
-import net.minecraft.client.renderer.model.ModelResourceLocation;
-import net.minecraft.util.ResourceLocation;
+import net.minecraft.client.resources.model.ModelResourceLocation;
+import net.minecraft.resources.ResourceLocation;
 import org.spongepowered.asm.mixin.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
@@ -19,7 +19,7 @@ public class ModelResourceLocationMixin {
     private String variant;
 
     @Inject(
-            method = "<init>(Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)V",
+            method = "<init>(Lnet/minecraft/resources/ResourceLocation;Ljava/lang/String;)V",
             at = @At("TAIL")
     )
     private void constructTail(ResourceLocation location, String variantIn, CallbackInfo ci) {

+ 1 - 1
common/src/main/java/malte0811/ferritecore/mixin/mrl/ResourceLocationAccess.java

@@ -1,6 +1,6 @@
 package malte0811.ferritecore.mixin.mrl;
 
-import net.minecraft.util.ResourceLocation;
+import net.minecraft.resources.ResourceLocation;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;

+ 7 - 7
common/src/main/java/malte0811/ferritecore/mixin/predicates/AndConditionMixin.java

@@ -2,11 +2,11 @@ package malte0811.ferritecore.mixin.predicates;
 
 import malte0811.ferritecore.impl.Deduplicator;
 import malte0811.ferritecore.util.PredicateHelper;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.client.renderer.model.multipart.AndCondition;
-import net.minecraft.client.renderer.model.multipart.ICondition;
-import net.minecraft.state.StateContainer;
+import net.minecraft.client.renderer.block.model.multipart.AndCondition;
+import net.minecraft.client.renderer.block.model.multipart.Condition;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.block.state.StateDefinition;
 import org.spongepowered.asm.mixin.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Overwrite;
@@ -18,14 +18,14 @@ import java.util.function.Predicate;
 public class AndConditionMixin {
     @Shadow
     @Final
-    private Iterable<? extends ICondition> conditions;
+    private Iterable<? extends Condition> conditions;
 
     /**
      * @reason Use cached result predicates
      * @author malte0811
      */
     @Overwrite
-    public Predicate<BlockState> getPredicate(StateContainer<Block, BlockState> stateContainer) {
+    public Predicate<BlockState> getPredicate(StateDefinition<Block, BlockState> stateContainer) {
         return Deduplicator.and(PredicateHelper.toCanonicalList(conditions, stateContainer));
     }
 }

+ 7 - 7
common/src/main/java/malte0811/ferritecore/mixin/predicates/OrConditionMixin.java

@@ -2,11 +2,11 @@ package malte0811.ferritecore.mixin.predicates;
 
 import malte0811.ferritecore.impl.Deduplicator;
 import malte0811.ferritecore.util.PredicateHelper;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.client.renderer.model.multipart.ICondition;
-import net.minecraft.client.renderer.model.multipart.OrCondition;
-import net.minecraft.state.StateContainer;
+import net.minecraft.client.renderer.block.model.multipart.Condition;
+import net.minecraft.client.renderer.block.model.multipart.OrCondition;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.block.state.StateDefinition;
 import org.spongepowered.asm.mixin.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Overwrite;
@@ -18,14 +18,14 @@ import java.util.function.Predicate;
 public class OrConditionMixin {
     @Shadow
     @Final
-    private Iterable<? extends ICondition> conditions;
+    private Iterable<? extends Condition> conditions;
 
     /**
      * @reason Use cached result predicates
      * @author malte0811
      */
     @Overwrite
-    public Predicate<BlockState> getPredicate(StateContainer<Block, BlockState> stateContainer) {
+    public Predicate<BlockState> getPredicate(StateDefinition<Block, BlockState> stateContainer) {
         return Deduplicator.or(PredicateHelper.toCanonicalList(conditions, stateContainer));
     }
 }

+ 8 - 8
common/src/main/java/malte0811/ferritecore/mixin/predicates/PropertyValueConditionMixin.java

@@ -2,10 +2,10 @@ package malte0811.ferritecore.mixin.predicates;
 
 import com.google.common.base.Splitter;
 import malte0811.ferritecore.impl.PropertyValueConditionImpl;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.client.renderer.model.multipart.PropertyValueCondition;
-import net.minecraft.state.StateContainer;
+import net.minecraft.client.renderer.block.model.multipart.KeyValueCondition;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.block.state.StateDefinition;
 import org.spongepowered.asm.mixin.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Overwrite;
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.Shadow;
 
 import java.util.function.Predicate;
 
-@Mixin(value = PropertyValueCondition.class, priority = 2000)
+@Mixin(value = KeyValueCondition.class, priority = 2000)
 public class PropertyValueConditionMixin {
     @Shadow
     @Final
@@ -23,7 +23,7 @@ public class PropertyValueConditionMixin {
     private String value;
     @Shadow
     @Final
-    private static Splitter SPLITTER;
+    private static Splitter PIPE_SPLITTER;
 
     /**
      * @reason Use cached predicates in the case of multiple specified values
@@ -33,7 +33,7 @@ public class PropertyValueConditionMixin {
      * @author malte0811
      */
     @Overwrite
-    public Predicate<BlockState> getPredicate(StateContainer<Block, BlockState> stateContainer) {
-        return PropertyValueConditionImpl.getPredicate(stateContainer, key, value, SPLITTER);
+    public Predicate<BlockState> getPredicate(StateDefinition<Block, BlockState> stateContainer) {
+        return PropertyValueConditionImpl.getPredicate(stateContainer, key, value, PIPE_SPLITTER);
     }
 }

+ 6 - 7
common/src/main/java/malte0811/ferritecore/util/PredicateHelper.java

@@ -1,21 +1,20 @@
 package malte0811.ferritecore.util;
 
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.client.renderer.model.multipart.ICondition;
-import net.minecraft.state.StateContainer;
-
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 import java.util.function.Predicate;
+import net.minecraft.client.renderer.block.model.multipart.Condition;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.block.state.StateDefinition;
 
 public class PredicateHelper {
     public static List<Predicate<BlockState>> toCanonicalList(
-            Iterable<? extends ICondition> conditions, StateContainer<Block, BlockState> stateContainer
+            Iterable<? extends Condition> conditions, StateDefinition<Block, BlockState> stateContainer
     ) {
         ArrayList<Predicate<BlockState>> list = new ArrayList<>();
-        for (ICondition cond : conditions) {
+        for (Condition cond : conditions) {
             list.add(cond.getPredicate(stateContainer));
         }
         canonize(list);

+ 4 - 4
common/src/test/java/malte0811/ferritecore/fastmap/FastMapTest.java

@@ -8,8 +8,8 @@ import it.unimi.dsi.fastutil.booleans.BooleanArrayList;
 import it.unimi.dsi.fastutil.booleans.BooleanList;
 import malte0811.ferritecore.classloading.FastImmutableMapDefiner;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
-import net.minecraft.state.*;
-import net.minecraft.util.Direction;
+import net.minecraft.core.Direction;
+import net.minecraft.world.level.block.state.properties.*;
 import org.junit.jupiter.api.*;
 
 import java.util.Collections;
@@ -99,7 +99,7 @@ public class FastMapTest {
             Stream<List<Pair<Property<?>, Comparable<?>>>> stream = Stream.of(Collections.emptyList());
 
             for (Property<?> property : properties) {
-                stream = stream.flatMap(baseList -> property.getAllowedValues().stream().map(value -> {
+                stream = stream.flatMap(baseList -> property.getPossibleValues().stream().map(value -> {
                     List<Pair<Property<?>, Comparable<?>>> withAdded = Lists.newArrayList(baseList);
                     withAdded.add(Pair.of(property, value));
                     return withAdded;
@@ -144,7 +144,7 @@ public class FastMapTest {
         private <T extends Comparable<T>>
         void testSwaps(int baseIndex, Property<T> toSwap, Map<Property<?>, Comparable<?>> baseMap) {
             Map<Property<?>, Comparable<?>> expected = new HashMap<>(baseMap);
-            for (T newValue : toSwap.getAllowedValues()) {
+            for (T newValue : toSwap.getPossibleValues()) {
                 Map<Property<?>, Comparable<?>> newMap = map.with(baseIndex, toSwap, newValue);
                 expected.put(toSwap, newValue);
                 Assertions.assertEquals(expected, newMap);

+ 1 - 1
common/src/test/java/malte0811/ferritecore/fastmap/MockFMStateHolder.java

@@ -2,7 +2,7 @@ package malte0811.ferritecore.fastmap;
 
 import com.google.common.collect.ImmutableMap;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 
 public class MockFMStateHolder<T> implements FastMapStateHolder<T> {
     private final FastMap<T> map;

+ 3 - 3
fabric/src/main/java/malte0811/ferritecore/mixin/fabric/HydrogenStateholderMixin.java

@@ -1,7 +1,7 @@
 package malte0811.ferritecore.mixin.fabric;
 
-import net.minecraft.state.Property;
-import net.minecraft.state.StateHolder;
+import net.minecraft.world.level.block.state.StateHolder;
+import net.minecraft.world.level.block.state.properties.Property;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
@@ -19,7 +19,7 @@ public class HydrogenStateholderMixin<S> {
      * This is a massive hack, but is currently probably the cleanest approach. If H gets the system for
      * disabling Mixins already implemented in Na/Li that system should be used instead!
      */
-    @Inject(method = "func_235899_a_", at = @At("RETURN"), cancellable = true)
+    @Inject(method = "populateNeighbours", at = @At("RETURN"), cancellable = true)
     public void postPopulateNeighbors(Map<Map<Property<?>, Comparable<?>>, S> map, CallbackInfo ci) {
         ci.cancel();
     }

+ 3 - 3
fabric/src/main/java/malte0811/ferritecore/mixin/fabric/MinecraftMixin.java

@@ -1,8 +1,8 @@
 package malte0811.ferritecore.mixin.fabric;
 
 import malte0811.ferritecore.impl.Deduplicator;
-import net.minecraft.client.GameConfiguration;
 import net.minecraft.client.Minecraft;
+import net.minecraft.client.main.GameConfig;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
@@ -14,10 +14,10 @@ public class MinecraftMixin {
             method = "<init>",
             at = @At(
                     value = "INVOKE",
-                    target = "Lnet/minecraft/client/renderer/ItemRenderer;<init>(Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/client/renderer/model/ModelManager;Lnet/minecraft/client/renderer/color/ItemColors;)V"
+                    target = "Lnet/minecraft/client/renderer/entity/ItemRenderer;<init>(Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/client/resources/model/ModelManager;Lnet/minecraft/client/color/item/ItemColors;)V"
             )
     )
-    private void injectAfterModels(GameConfiguration gameConfig, CallbackInfo ci) {
+    private void injectAfterModels(GameConfig gameConfig, CallbackInfo ci) {
         Deduplicator.registerReloadListener();
     }
 }

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

+ 1 - 1
summary.md

@@ -102,7 +102,7 @@ By default every blockstate using a multipart model gets its own instance of tha
 models are generally used for blocks with a lot of states this means a lot of instances, and a lot of wasted memory. The
 only input data for a multipart model is a `List<Pair<Predicate<BlockState>, IBakedModel>>`. The predicate is already
 deduplicated by point 4, so it is very easy to use the same instance for equivalent lists. This reduces the number of
-instance from about 200k to 1.5k (DW20 1.2.0).
+instances from about 200k to 1.5k (DW20 1.2.0).
 
 Saved memory: Close to 200 MB  
 CPU impact: Slight during loading, zero at runtime