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
 ### 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
     build.dependsOn signJar
 
 
     dependencies {
     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.FerriteCoreEntrySetAccess;
 import com.google.common.collect.UnmodifiableIterator;
 import com.google.common.collect.UnmodifiableIterator;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
 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.NotNull;
 import org.jetbrains.annotations.Nullable;
 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.FerriteCoreImmutableMapAccess;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ImmutableSet;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.annotations.Nullable;
 
 
 public class FastMapEntryImmutableMap extends FerriteCoreImmutableMapAccess<Property<?>, Comparable<?>> {
 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 com.google.common.collect.UnmodifiableIterator;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 
 
 import java.util.Map;
 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.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
 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.LogManager;
 import org.apache.logging.log4j.Logger;
 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_PREFIX = "/googleaccess/";
     public static String GOOGLE_ACCESS_SUFFIX = ".class_manual";
     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 {
             // Try to create a Java 9+ style class definer
             // Try to create a Java 9+ style class definer
             // These are all public methods, but just don't exist in Java 8
             // 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
      * 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.
      * 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 {
         try {
             // Load these in the app classloader!
             // Load these in the app classloader!
             defineInAppClassloader("com.google.common.collect.FerriteCoreEntrySetAccess");
             defineInAppClassloader("com.google.common.collect.FerriteCoreEntrySetAccess");
@@ -72,7 +72,7 @@ public class FastImmutableMapDefiner {
 
 
     public static ImmutableMap<Property<?>, Comparable<?>> makeMap(FastMapStateHolder<?> state) {
     public static ImmutableMap<Property<?>, Comparable<?>> makeMap(FastMapStateHolder<?> state) {
         try {
         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) {
         } catch (Error e) {
             throw e;
             throw e;
         } catch (Throwable x) {
         } catch (Throwable x) {
@@ -87,7 +87,7 @@ public class FastImmutableMapDefiner {
         byte[] classBytes = new byte[byteInput.available()];
         byte[] classBytes = new byte[byteInput.available()];
         final int bytesRead = byteInput.read(classBytes);
         final int bytesRead = byteInput.read(classBytes);
         Preconditions.checkState(bytesRead == classBytes.length);
         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());
         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 com.google.common.collect.ImmutableMap;
 import malte0811.ferritecore.fastmap.FastMap;
 import malte0811.ferritecore.fastmap.FastMap;
-import net.minecraft.state.Property;
+import net.minecraft.world.level.block.state.properties.Property;
 
 
 public interface FastMapStateHolder<S> {
 public interface FastMapStateHolder<S> {
     FastMap<S> getStateMap();
     FastMap<S> getStateMap();

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

@@ -1,8 +1,8 @@
 package malte0811.ferritecore.fastmap;
 package malte0811.ferritecore.fastmap;
 
 
 import com.google.common.base.Preconditions;
 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
  * 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) {
     public BinaryFastMapKey(Property<T> property, int mapFactor) {
         super(property);
         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(numValues() <= addedFactor);
         Preconditions.checkState(addedFactor < 2 * numValues());
         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);
         Preconditions.checkState(setBitInBaseFactor + setBitInAddedFactor <= 31);
         firstBitInValue = (byte) setBitInBaseFactor;
         firstBitInValue = (byte) setBitInBaseFactor;
         firstBitAfterValue = (byte) (setBitInBaseFactor + setBitInAddedFactor);
         firstBitAfterValue = (byte) (setBitInBaseFactor + setBitInAddedFactor);

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

@@ -1,6 +1,6 @@
 package malte0811.ferritecore.fastmap;
 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
  * 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.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap;
-import net.minecraft.state.Property;
-
 import javax.annotation.Nullable;
 import javax.annotation.Nullable;
+import net.minecraft.world.level.block.state.properties.Property;
 import java.util.*;
 import java.util.*;
 
 
 /**
 /**

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

@@ -1,6 +1,6 @@
 package malte0811.ferritecore.fastmap;
 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
  * 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.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap;
 import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
 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 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.*;
 import java.util.*;
 
 
 /**
 /**
@@ -21,7 +20,7 @@ import java.util.*;
  */
  */
 public abstract class PropertyIndexer<T extends Comparable<T>> {
 public abstract class PropertyIndexer<T extends Comparable<T>> {
     private static final Map<Property<?>, PropertyIndexer<?>> KNOWN_INDEXERS = new Object2ObjectOpenCustomHashMap<>(
     private static final Map<Property<?>, PropertyIndexer<?>> KNOWN_INDEXERS = new Object2ObjectOpenCustomHashMap<>(
-            Util.identityHashStrategy()
+            Util.identityStrategy()
     );
     );
 
 
     private final Property<T> property;
     private final Property<T> property;
@@ -52,7 +51,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
 
 
     protected PropertyIndexer(Property<T> property) {
     protected PropertyIndexer(Property<T> property) {
         this.property = property;
         this.property = property;
-        this.numValues = property.getAllowedValues().size();
+        this.numValues = property.getPossibleValues().size();
     }
     }
 
 
     public Property<T> getProperty() {
     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
      * Checks if this indexer is valid, i.e. iterates over the correct set of values in the correct order
      */
      */
     protected boolean isValid() {
     protected boolean isValid() {
-        Collection<T> allowed = getProperty().getAllowedValues();
+        Collection<T> allowed = getProperty().getPossibleValues();
         int index = 0;
         int index = 0;
         for (T val : allowed) {
         for (T val : allowed) {
             if (toIndex(val) != index || !val.equals(byIndex(index))) {
             if (toIndex(val) != index || !val.equals(byIndex(index))) {
@@ -113,7 +112,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
 
 
         protected IntIndexer(IntegerProperty property) {
         protected IntIndexer(IntegerProperty property) {
             super(property);
             super(property);
-            this.min = property.getAllowedValues().stream().min(Comparator.naturalOrder()).orElse(0);
+            this.min = property.getPossibleValues().stream().min(Comparator.naturalOrder()).orElse(0);
         }
         }
 
 
         @Override
         @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> {
             extends PropertyIndexer<E> {
         private final int ordinalOffset;
         private final int ordinalOffset;
         private final E[] enumValues;
         private final E[] enumValues;
 
 
         protected EnumIndexer(EnumProperty<E> property) {
         protected EnumIndexer(EnumProperty<E> property) {
             super(property);
             super(property);
-            this.ordinalOffset = property.getAllowedValues()
+            this.ordinalOffset = property.getPossibleValues()
                     .stream()
                     .stream()
                     .mapToInt(Enum::ordinal)
                     .mapToInt(Enum::ordinal)
                     .min()
                     .min()
@@ -180,7 +179,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
         }
         }
 
 
         static boolean isApplicable(Property<?> prop) {
         static boolean isApplicable(Property<?> prop) {
-            Collection<?> values = prop.getAllowedValues();
+            Collection<?> values = prop.getPossibleValues();
             if (values.size() != ORDER.length) {
             if (values.size() != ORDER.length) {
                 return false;
                 return false;
             }
             }
@@ -223,7 +222,7 @@ public abstract class PropertyIndexer<T extends Comparable<T>> {
 
 
         protected GenericIndexer(Property<T> property) {
         protected GenericIndexer(Property<T> property) {
             super(property);
             super(property);
-            this.values = ImmutableList.copyOf(property.getAllowedValues());
+            this.values = ImmutableList.copyOf(property.getPossibleValues());
             ImmutableMap.Builder<Comparable<?>, Integer> toValueIndex = ImmutableMap.builder();
             ImmutableMap.Builder<Comparable<?>, Integer> toValueIndex = ImmutableMap.builder();
             for (int i = 0; i < this.values.size(); i++) {
             for (int i = 0; i < this.values.size(); i++) {
                 toValueIndex.put(this.values.get(i), 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 it.unimi.dsi.fastutil.Hash;
 import malte0811.ferritecore.mixin.blockstatecache.VSArrayAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VSArrayAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
 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;
 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();
     public static final VoxelShapeArrayHash INSTANCE = new VoxelShapeArrayHash();
 
 
     @Override
     @Override
-    public int hashCode(VoxelShapeArray o) {
+    public int hashCode(ArrayVoxelShape o) {
         VSArrayAccess access = access(o);
         VSArrayAccess access = access(o);
         return 31 * Objects.hash(access.getXPoints(), access.getYPoints(), access.getZPoints())
         return 31 * Objects.hash(access.getXPoints(), access.getYPoints(), access.getZPoints())
                 + VoxelShapePartHash.INSTANCE.hashCode(getPart(o));
                 + VoxelShapePartHash.INSTANCE.hashCode(getPart(o));
     }
     }
 
 
     @Override
     @Override
-    public boolean equals(VoxelShapeArray a, VoxelShapeArray b) {
+    public boolean equals(ArrayVoxelShape a, ArrayVoxelShape b) {
         if (a == b) {
         if (a == b) {
             return true;
             return true;
         } else if (a == null || b == null) {
         } else if (a == null || b == null) {
@@ -35,11 +35,11 @@ public class VoxelShapeArrayHash implements Hash.Strategy<VoxelShapeArray> {
     }
     }
 
 
     @SuppressWarnings("ConstantConditions")
     @SuppressWarnings("ConstantConditions")
-    private static VSArrayAccess access(VoxelShapeArray a) {
+    private static VSArrayAccess access(ArrayVoxelShape a) {
         return (VSArrayAccess) (Object) 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 it.unimi.dsi.fastutil.Hash;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
 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 class VoxelShapeHash implements Hash.Strategy<VoxelShape> {
     public static final VoxelShapeHash INSTANCE = new VoxelShapeHash();
     public static final VoxelShapeHash INSTANCE = new VoxelShapeHash();
 
 
     @Override
     @Override
     public int hashCode(VoxelShape o) {
     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 {
         } else {
             //TODO VSCube?
             //TODO VSCube?
             return o.hashCode();
             return o.hashCode();
@@ -32,13 +32,13 @@ public class VoxelShapeHash implements Hash.Strategy<VoxelShape> {
             return false;
             return false;
         } else if (a.getClass() != b.getClass()) {
         } else if (a.getClass() != b.getClass()) {
             return false;
             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(
             return VoxelShapePartHash.INSTANCE.equals(
-                    ((VoxelShapeAccess) a).getPart(), ((VoxelShapeAccess) b).getPart()
+                    ((VoxelShapeAccess) a).getShape(), ((VoxelShapeAccess) b).getShape()
             );
             );
         } else {
         } else {
             return a.equals(b);
             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.VSPBitSetAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VSPSplitAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VSPSplitAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VSPartAccess;
 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;
 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();
     public static final VoxelShapePartHash INSTANCE = new VoxelShapePartHash();
 
 
     @Override
     @Override
-    public int hashCode(VoxelShapePart o) {
+    public int hashCode(DiscreteVoxelShape o) {
         VSPartAccess generalAccess = (VSPartAccess) o;
         VSPartAccess generalAccess = (VSPartAccess) o;
         int result = generalAccess.getXSize();
         int result = generalAccess.getXSize();
         result = 31 * result + generalAccess.getYSize();
         result = 31 * result + generalAccess.getYSize();
         result = 31 * result + generalAccess.getZSize();
         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.getStartX();
             result = 31 * result + access.getStartY();
             result = 31 * result + access.getStartY();
             result = 31 * result + access.getStartZ();
             result = 31 * result + access.getStartZ();
             result = 31 * result + access.getEndX();
             result = 31 * result + access.getEndX();
             result = 31 * result + access.getEndY();
             result = 31 * result + access.getEndY();
             result = 31 * result + access.getEndZ();
             result = 31 * result + access.getEndZ();
-            result = 31 * result + hashCode(access.getPart());
+            result = 31 * result + hashCode(access.getParent());
             return result;
             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;
             return result;
         } else {
         } else {
             return 31 * result + Objects.hashCode(o);
             return 31 * result + Objects.hashCode(o);
@@ -45,7 +45,7 @@ public class VoxelShapePartHash implements Hash.Strategy<VoxelShapePart> {
     }
     }
 
 
     @Override
     @Override
-    public boolean equals(VoxelShapePart a, VoxelShapePart b) {
+    public boolean equals(DiscreteVoxelShape a, DiscreteVoxelShape b) {
         if (a == b) {
         if (a == b) {
             return true;
             return true;
         } else if (a == null || b == null) {
         } else if (a == null || b == null) {
@@ -61,38 +61,38 @@ public class VoxelShapePartHash implements Hash.Strategy<VoxelShapePart> {
         ) {
         ) {
             return false;
             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() &&
             return accessA.getEndX() == accessB.getEndX() &&
                     accessA.getEndY() == accessB.getEndY() &&
                     accessA.getEndY() == accessB.getEndY() &&
                     accessA.getEndZ() == accessB.getEndZ() &&
                     accessA.getEndZ() == accessB.getEndZ() &&
                     accessA.getStartX() == accessB.getStartX() &&
                     accessA.getStartX() == accessB.getStartX() &&
                     accessA.getStartY() == accessB.getStartY() &&
                     accessA.getStartY() == accessB.getStartY() &&
                     accessA.getStartZ() == accessB.getStartZ() &&
                     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 {
         } else {
             return a.equals(b);
             return a.equals(b);
         }
         }
     }
     }
 
 
     @SuppressWarnings("ConstantConditions")
     @SuppressWarnings("ConstantConditions")
-    private static VSPSplitAccess access(PartSplitVoxelShape part) {
+    private static VSPSplitAccess access(SubShape part) {
         return (VSPSplitAccess) (Object) part;
         return (VSPSplitAccess) (Object) part;
     }
     }
 
 
     @SuppressWarnings("ConstantConditions")
     @SuppressWarnings("ConstantConditions")
-    private static VSPBitSetAccess access(BitSetVoxelShapePart part) {
+    private static VSPBitSetAccess access(BitSetDiscreteVoxelShape part) {
         return (VSPBitSetAccess) (Object) 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 it.unimi.dsi.fastutil.Hash;
 import malte0811.ferritecore.mixin.blockstatecache.VSSplitAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VSSplitAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
 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;
 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();
     public static final VoxelShapeSplitHash INSTANCE = new VoxelShapeSplitHash();
 
 
     @Override
     @Override
-    public int hashCode(SplitVoxelShape o) {
+    public int hashCode(SliceShape o) {
         VSSplitAccess access = access(o);
         VSSplitAccess access = access(o);
         int result = Objects.hashCode(access.getAxis());
         int result = Objects.hashCode(access.getAxis());
         result = 31 * result + VoxelShapePartHash.INSTANCE.hashCode(getPart(o));
         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;
         return result;
     }
     }
 
 
     @Override
     @Override
-    public boolean equals(SplitVoxelShape a, SplitVoxelShape b) {
+    public boolean equals(SliceShape a, SliceShape b) {
         if (a == b) {
         if (a == b) {
             return true;
             return true;
         } else if (a == null || b == null) {
         } else if (a == null || b == null) {
@@ -31,15 +31,15 @@ public class VoxelShapeSplitHash implements Hash.Strategy<SplitVoxelShape> {
         VSSplitAccess accessA = access(a);
         VSSplitAccess accessA = access(a);
         VSSplitAccess accessB = access(b);
         VSSplitAccess accessB = access(b);
         return Objects.equals(accessA.getAxis(), accessB.getAxis()) &&
         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));
                 VoxelShapePartHash.INSTANCE.equals(getPart(a), getPart(b));
     }
     }
 
 
-    private static VSSplitAccess access(SplitVoxelShape a) {
+    private static VSSplitAccess access(SliceShape a) {
         return (VSSplitAccess) 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.VSSplitAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
 import malte0811.ferritecore.mixin.blockstatecache.VoxelShapeAccess;
 import malte0811.ferritecore.util.Constants;
 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 org.apache.commons.lang3.tuple.Pair;
 
 
 import javax.annotation.Nullable;
 import javax.annotation.Nullable;
@@ -21,10 +22,8 @@ import java.lang.reflect.Field;
 import java.util.Map;
 import java.util.Map;
 import java.util.function.Function;
 import java.util.function.Function;
 
 
-import static net.minecraft.block.AbstractBlock.AbstractBlockState;
-
 public class BlockStateCacheImpl {
 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
             VoxelShapeArrayHash.INSTANCE
     );
     );
     // Maps a shape to the "canonical instance" of that shape and its side projections
     // 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
     // Get the cache from a blockstate. Mixin does not handle private inner classes too well, so method handles and
     // manual remapping it is
     // 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 {
                 try {
-                    Field cacheField = AbstractBlockState.class.getDeclaredField(Constants.blockstateCacheFieldName);
+                    Field cacheField = BlockStateBase.class.getDeclaredField(Constants.blockstateCacheFieldName);
                     cacheField.setAccessible(true);
                     cacheField.setAccessible(true);
                     MethodHandle getter = MethodHandles.lookup().unreflectGetter(cacheField);
                     MethodHandle getter = MethodHandles.lookup().unreflectGetter(cacheField);
                     return state -> {
                     return state -> {
@@ -55,13 +54,13 @@ public class BlockStateCacheImpl {
     private static final ThreadLocal<BlockStateCacheAccess> LAST_CACHE = new ThreadLocal<>();
     private static final ThreadLocal<BlockStateCacheAccess> LAST_CACHE = new ThreadLocal<>();
 
 
     // Calls before the cache for <code>state</code> is (re-)populated
     // 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
     // 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) {
         if (newCache != null) {
             final BlockStateCacheAccess oldCache = LAST_CACHE.get();
             final BlockStateCacheAccess oldCache = LAST_CACHE.get();
             deduplicateCollisionShape(newCache, oldCache);
             deduplicateCollisionShape(newCache, oldCache);
@@ -80,9 +79,9 @@ public class BlockStateCacheImpl {
             dedupedCollisionShape = oldCache.getCollisionShape();
             dedupedCollisionShape = oldCache.getCollisionShape();
         } else {
         } else {
             dedupedCollisionShape = newCache.getCollisionShape();
             dedupedCollisionShape = newCache.getCollisionShape();
-            if (dedupedCollisionShape instanceof VoxelShapeArray) {
+            if (dedupedCollisionShape instanceof ArrayVoxelShape) {
                 dedupedCollisionShape = CACHE_COLLIDE.computeIfAbsent(
                 dedupedCollisionShape = CACHE_COLLIDE.computeIfAbsent(
-                        (VoxelShapeArray) dedupedCollisionShape, Function.identity()
+                        (ArrayVoxelShape) dedupedCollisionShape, Function.identity()
                 );
                 );
             }
             }
         }
         }
@@ -93,36 +92,36 @@ public class BlockStateCacheImpl {
     private static void deduplicateRenderShapes(
     private static void deduplicateRenderShapes(
             BlockStateCacheAccess newCache, @Nullable BlockStateCacheAccess oldCache
             BlockStateCacheAccess newCache, @Nullable BlockStateCacheAccess oldCache
     ) {
     ) {
-        final VoxelShape newRenderShape = getRenderShape(newCache.getRenderShapes());
+        final VoxelShape newRenderShape = getRenderShape(newCache.getOcclusionShapes());
         if (newRenderShape == null) {
         if (newRenderShape == null) {
             return;
             return;
         }
         }
         Pair<VoxelShape, VoxelShape[]> dedupedRenderShapes = null;
         Pair<VoxelShape, VoxelShape[]> dedupedRenderShapes = null;
         if (oldCache != null) {
         if (oldCache != null) {
-            final VoxelShape oldRenderShape = getRenderShape(oldCache.getRenderShapes());
+            final VoxelShape oldRenderShape = getRenderShape(oldCache.getOcclusionShapes());
             if (VoxelShapeHash.INSTANCE.equals(newRenderShape, oldRenderShape)) {
             if (VoxelShapeHash.INSTANCE.equals(newRenderShape, oldRenderShape)) {
-                dedupedRenderShapes = Pair.of(oldRenderShape, oldCache.getRenderShapes());
+                dedupedRenderShapes = Pair.of(oldRenderShape, oldCache.getOcclusionShapes());
             }
             }
         }
         }
         if (dedupedRenderShapes == null) {
         if (dedupedRenderShapes == null) {
             // Who thought that this was a good interface for putIfAbsent…
             // 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);
             dedupedRenderShapes = CACHE_PROJECT.putIfAbsent(newRenderShape, newPair);
             if (dedupedRenderShapes == null) {
             if (dedupedRenderShapes == null) {
                 dedupedRenderShapes = newPair;
                 dedupedRenderShapes = newPair;
             }
             }
         }
         }
         replaceInternals(dedupedRenderShapes.getLeft(), newRenderShape);
         replaceInternals(dedupedRenderShapes.getLeft(), newRenderShape);
-        newCache.setRenderShapes(dedupedRenderShapes.getRight());
+        newCache.setOcclusionShapes(dedupedRenderShapes.getRight());
     }
     }
 
 
     private static void replaceInternals(VoxelShape toKeep, VoxelShape toReplace) {
     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) {
         if (toKeep == toReplace) {
             return;
             return;
         }
         }
@@ -135,12 +134,12 @@ public class BlockStateCacheImpl {
         access(toReplace).setXPoints(access(toKeep).getXPoints());
         access(toReplace).setXPoints(access(toKeep).getXPoints());
         access(toReplace).setYPoints(access(toKeep).getYPoints());
         access(toReplace).setYPoints(access(toKeep).getYPoints());
         access(toReplace).setZPoints(access(toKeep).getZPoints());
         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")
     @SuppressWarnings("ConstantConditions")
-    private static VSArrayAccess access(VoxelShapeArray a) {
+    private static VSArrayAccess access(ArrayVoxelShape a) {
         return (VSArrayAccess) (Object) a;
         return (VSArrayAccess) (Object) a;
     }
     }
 
 
@@ -152,8 +151,8 @@ public class BlockStateCacheImpl {
     private static VoxelShape getRenderShape(@Nullable VoxelShape[] projected) {
     private static VoxelShape getRenderShape(@Nullable VoxelShape[] projected) {
         if (projected != null) {
         if (projected != null) {
             for (VoxelShape side : projected) {
             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.hash.LambdaBasedHash;
 import malte0811.ferritecore.mixin.dedupbakedquad.BakedQuadAccess;
 import malte0811.ferritecore.mixin.dedupbakedquad.BakedQuadAccess;
 import malte0811.ferritecore.util.PredicateHelper;
 import malte0811.ferritecore.util.PredicateHelper;
-import net.minecraft.block.BlockState;
 import net.minecraft.client.Minecraft;
 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 org.apache.commons.lang3.tuple.Pair;
 
 
 import java.util.Arrays;
 import java.util.Arrays;
@@ -26,7 +26,7 @@ import java.util.function.Predicate;
 public class Deduplicator {
 public class Deduplicator {
     private static final Map<String, String> VARIANT_IDENTITIES = new ConcurrentHashMap<>();
     private static final Map<String, String> VARIANT_IDENTITIES = new ConcurrentHashMap<>();
     // Typedefs would be a nice thing to have
     // 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>> OR_PREDICATE_CACHE = new ConcurrentHashMap<>();
     private static final Map<List<Predicate<BlockState>>, Predicate<BlockState>> AND_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<>(
     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());
         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) {
     public static Predicate<BlockState> or(List<Predicate<BlockState>> list) {
@@ -51,21 +51,21 @@ public class Deduplicator {
 
 
     public static void deduplicate(BakedQuad bq) {
     public static void deduplicate(BakedQuad bq) {
         synchronized (BAKED_QUAD_CACHE) {
         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() {
     public static void registerReloadListener() {
         // Register the reload listener s.t. its "sync" part runs after the model loader reload
         // 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
             @Override
-            protected Unit prepare(IResourceManager iResourceManager, IProfiler iProfiler) {
+            protected Unit prepare(ResourceManager iResourceManager, ProfilerFiller iProfiler) {
                 return Unit.INSTANCE;
                 return Unit.INSTANCE;
             }
             }
 
 
             @Override
             @Override
-            protected void apply(Unit object, IResourceManager iResourceManager, IProfiler iProfiler) {
+            protected void apply(Unit object, ResourceManager iResourceManager, ProfilerFiller iProfiler) {
                 VARIANT_IDENTITIES.clear();
                 VARIANT_IDENTITIES.clear();
                 KNOWN_MULTIPART_MODELS.clear();
                 KNOWN_MULTIPART_MODELS.clear();
                 OR_PREDICATE_CACHE.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 com.google.common.base.Splitter;
 import malte0811.ferritecore.util.PredicateHelper;
 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 org.apache.commons.lang3.tuple.Pair;
 
 
 import java.util.List;
 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<>();
     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
      * since targeting the correct line is near impossible
      */
      */
     public static Predicate<BlockState> getPredicate(
     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);
         Property<?> property = stateContainer.getProperty(key);
         if (property == null) {
         if (property == null) {
@@ -64,9 +64,9 @@ public class PropertyValueConditionImpl {
 
 
     private static <T extends Comparable<T>>
     private static <T extends Comparable<T>>
     Predicate<BlockState> makePropertyPredicate(
     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()) {
         if (!optional.isPresent()) {
             throw new RuntimeException(String.format(
             throw new RuntimeException(String.format(
                     "Unknown value '%s' for property '%s' on '%s' in '%s'",
                     "Unknown value '%s' for property '%s' on '%s' in '%s'",
@@ -79,7 +79,7 @@ public class PropertyValueConditionImpl {
                     pair -> {
                     pair -> {
                         Comparable<?> valueInt = pair.getRight();
                         Comparable<?> valueInt = pair.getRight();
                         Property<?> propInt = pair.getLeft();
                         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.ducks.FastMapStateHolder;
 import malte0811.ferritecore.fastmap.FastMap;
 import malte0811.ferritecore.fastmap.FastMap;
 import malte0811.ferritecore.mixin.config.FerriteConfig;
 import malte0811.ferritecore.mixin.config.FerriteConfig;
-import net.minecraft.state.Property;
-
+import net.minecraft.world.level.block.state.properties.Property;
 import java.util.Map;
 import java.util.Map;
 
 
 public class StateHolderImpl {
 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.
      * 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.
      * container will use the same {@link FastMap} instance.
      */
      */
     public static <S>
     public static <S>

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

@@ -1,21 +1,21 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 package malte0811.ferritecore.mixin.blockstatecache;
 
 
 import malte0811.ferritecore.impl.BlockStateCacheImpl;
 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.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
 import org.spongepowered.asm.mixin.injection.Inject;
 import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
 import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
 
 
-@Mixin(AbstractBlock.AbstractBlockState.class)
+@Mixin(BlockBehaviour.BlockStateBase.class)
 public class AbstractBlockStateMixin {
 public class AbstractBlockStateMixin {
-    @Inject(method = "cacheState", at = @At("HEAD"))
+    @Inject(method = "initCache", at = @At("HEAD"))
     public void cacheStateHead(CallbackInfo ci) {
     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) {
     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;
 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.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 
 import javax.annotation.Nullable;
 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 {
 public interface BlockStateCacheAccess {
     @Accessor
     @Accessor
     VoxelShape getCollisionShape();
     VoxelShape getCollisionShape();
@@ -18,9 +18,9 @@ public interface BlockStateCacheAccess {
 
 
     @Accessor
     @Accessor
     @Nullable
     @Nullable
-    VoxelShape[] getRenderShapes();
+    VoxelShape[] getOcclusionShapes();
 
 
     @Accessor
     @Accessor
     @Mutable
     @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;
 package malte0811.ferritecore.mixin.blockstatecache;
 
 
 import it.unimi.dsi.fastutil.doubles.DoubleList;
 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.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 
-@Mixin(VoxelShapeArray.class)
+@Mixin(ArrayVoxelShape.class)
 public interface VSArrayAccess {
 public interface VSArrayAccess {
-    @Accessor
+    @Accessor("xs")
     void setXPoints(DoubleList newPoints);
     void setXPoints(DoubleList newPoints);
 
 
-    @Accessor
+    @Accessor("ys")
     void setYPoints(DoubleList newPoints);
     void setYPoints(DoubleList newPoints);
 
 
-    @Accessor
+    @Accessor("zs")
     void setZPoints(DoubleList newPoints);
     void setZPoints(DoubleList newPoints);
 
 
-    @Accessor
+    @Accessor("xs")
     DoubleList getXPoints();
     DoubleList getXPoints();
 
 
-    @Accessor
+    @Accessor("ys")
     DoubleList getYPoints();
     DoubleList getYPoints();
 
 
-    @Accessor
+    @Accessor("zs")
     DoubleList getZPoints();
     DoubleList getZPoints();
 }
 }

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

@@ -1,31 +1,31 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 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.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 
 import java.util.BitSet;
 import java.util.BitSet;
 
 
-@Mixin(BitSetVoxelShapePart.class)
+@Mixin(BitSetDiscreteVoxelShape.class)
 public interface VSPBitSetAccess {
 public interface VSPBitSetAccess {
     @Accessor
     @Accessor
-    BitSet getBitSet();
+    BitSet getStorage();
 
 
     @Accessor
     @Accessor
-    int getStartX();
+    int getXMin();
 
 
     @Accessor
     @Accessor
-    int getStartY();
+    int getYMin();
 
 
     @Accessor
     @Accessor
-    int getStartZ();
+    int getZMin();
 
 
     @Accessor
     @Accessor
-    int getEndX();
+    int getXMax();
 
 
     @Accessor
     @Accessor
-    int getEndY();
+    int getYMax();
 
 
     @Accessor
     @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;
 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.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 
-@Mixin(PartSplitVoxelShape.class)
+@Mixin(SubShape.class)
 public interface VSPSplitAccess {
 public interface VSPSplitAccess {
     @Accessor
     @Accessor
-    VoxelShapePart getPart();
+    DiscreteVoxelShape getParent();
 
 
     @Accessor
     @Accessor
     int getStartX();
     int getStartX();

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

@@ -1,10 +1,10 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 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.Mixin;
 import org.spongepowered.asm.mixin.gen.Accessor;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 
-@Mixin(VoxelShapePart.class)
+@Mixin(DiscreteVoxelShape.class)
 public interface VSPartAccess {
 public interface VSPartAccess {
     @Accessor
     @Accessor
     int getXSize();
     int getXSize();

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

@@ -1,20 +1,16 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 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.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
 import org.spongepowered.asm.mixin.gen.Accessor;
 
 
-@Mixin(SplitVoxelShape.class)
+@Mixin(SliceShape.class)
 public interface VSSplitAccess {
 public interface VSSplitAccess {
     @Accessor
     @Accessor
-    @Mutable
-    void setShape(VoxelShape newShape);
-
-    @Accessor
-    VoxelShape getShape();
+    VoxelShape getDelegate();
 
 
     @Accessor
     @Accessor
     Direction.Axis getAxis();
     Direction.Axis getAxis();

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

@@ -1,7 +1,7 @@
 package malte0811.ferritecore.mixin.blockstatecache;
 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.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
 import org.spongepowered.asm.mixin.gen.Accessor;
@@ -11,16 +11,16 @@ import javax.annotation.Nullable;
 @Mixin(VoxelShape.class)
 @Mixin(VoxelShape.class)
 public interface VoxelShapeAccess {
 public interface VoxelShapeAccess {
     @Accessor
     @Accessor
-    VoxelShapePart getPart();
+    DiscreteVoxelShape getShape();
 
 
     @Accessor
     @Accessor
     @Nullable
     @Nullable
-    VoxelShape[] getProjectionCache();
+    VoxelShape[] getFaces();
 
 
     @Accessor
     @Accessor
     @Mutable
     @Mutable
-    void setPart(VoxelShapePart newPart);
+    void setShape(DiscreteVoxelShape newPart);
 
 
     @Accessor
     @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;
 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.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
 import org.spongepowered.asm.mixin.gen.Accessor;
@@ -9,5 +9,5 @@ import org.spongepowered.asm.mixin.gen.Accessor;
 public interface BakedQuadAccess {
 public interface BakedQuadAccess {
     @Accessor
     @Accessor
     @Mutable
     @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;
 package malte0811.ferritecore.mixin.dedupbakedquad;
 
 
 import malte0811.ferritecore.impl.Deduplicator;
 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.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
 import org.spongepowered.asm.mixin.injection.Inject;
@@ -11,12 +11,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
 
 
 @Mixin(SimpleBakedModel.Builder.class)
 @Mixin(SimpleBakedModel.Builder.class)
 public class SimpleModelBuilderMixin {
 public class SimpleModelBuilderMixin {
-    @Inject(method = "addGeneralQuad", at = @At("HEAD"))
+    @Inject(method = "addUnculledFace", at = @At("HEAD"))
     public void deduplicate(BakedQuad quad, CallbackInfoReturnable<SimpleBakedModel.Builder> cir) {
     public void deduplicate(BakedQuad quad, CallbackInfoReturnable<SimpleBakedModel.Builder> cir) {
         Deduplicator.deduplicate(quad);
         Deduplicator.deduplicate(quad);
     }
     }
 
 
-    @Inject(method = "addFaceQuad", at = @At("HEAD"))
+    @Inject(method = "addCulledFace", at = @At("HEAD"))
     public void deduplicate(
     public void deduplicate(
             Direction direction, BakedQuad quad, CallbackInfoReturnable<SimpleBakedModel.Builder> cir
             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;
 package malte0811.ferritecore.mixin.dedupmultipart;
 
 
 import malte0811.ferritecore.impl.Deduplicator;
 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.apache.commons.lang3.tuple.Pair;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 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.List;
 import java.util.function.Predicate;
 import java.util.function.Predicate;
 
 
-@Mixin(MultipartBakedModel.Builder.class)
+@Mixin(MultiPartBakedModel.Builder.class)
 public class MixinMultipartBuilder {
 public class MixinMultipartBuilder {
     @Redirect(
     @Redirect(
             method = "build",
             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);
         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.ducks.FastMapStateHolder;
 import malte0811.ferritecore.fastmap.FastMap;
 import malte0811.ferritecore.fastmap.FastMap;
 import malte0811.ferritecore.impl.StateHolderImpl;
 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.*;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Redirect;
 import org.spongepowered.asm.mixin.injection.Redirect;
@@ -18,13 +18,13 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
     @Mutable
     @Mutable
     @Shadow
     @Shadow
     @Final
     @Final
-    private ImmutableMap<Property<?>, Comparable<?>> properties;
+    private ImmutableMap<Property<?>, Comparable<?>> values;
 
 
     private int globalTableIndex;
     private int globalTableIndex;
     private FastMap<S> globalTable;
     private FastMap<S> globalTable;
 
 
     @Redirect(
     @Redirect(
-            method = "with",
+            method = "setValue",
             at = @At(
             at = @At(
                     value = "INVOKE",
                     value = "INVOKE",
                     target = "Lcom/google/common/collect/Table;get(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
                     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
      * @author malte0811
      */
      */
     @Overwrite
     @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);
         StateHolderImpl.populateNeighbors(states, this);
     }
     }
 
 
@@ -57,12 +57,12 @@ public abstract class FastMapStateHolderMixin<O, S> implements FastMapStateHolde
 
 
     @Override
     @Override
     public ImmutableMap<Property<?>, Comparable<?>> getVanillaPropertyMap() {
     public ImmutableMap<Property<?>, Comparable<?>> getVanillaPropertyMap() {
-        return properties;
+        return values;
     }
     }
 
 
     @Override
     @Override
     public void replacePropertyMap(ImmutableMap<Property<?>, Comparable<?>> newMap) {
     public void replacePropertyMap(ImmutableMap<Property<?>, Comparable<?>> newMap) {
-        properties = newMap;
+        values = newMap;
     }
     }
 
 
     @Override
     @Override

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

@@ -1,8 +1,8 @@
 package malte0811.ferritecore.mixin.mrl;
 package malte0811.ferritecore.mixin.mrl;
 
 
 import malte0811.ferritecore.impl.Deduplicator;
 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.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.Mutable;
@@ -19,7 +19,7 @@ public class ModelResourceLocationMixin {
     private String variant;
     private String variant;
 
 
     @Inject(
     @Inject(
-            method = "<init>(Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)V",
+            method = "<init>(Lnet/minecraft/resources/ResourceLocation;Ljava/lang/String;)V",
             at = @At("TAIL")
             at = @At("TAIL")
     )
     )
     private void constructTail(ResourceLocation location, String variantIn, CallbackInfo ci) {
     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;
 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.Mixin;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.Mutable;
 import org.spongepowered.asm.mixin.gen.Accessor;
 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.impl.Deduplicator;
 import malte0811.ferritecore.util.PredicateHelper;
 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.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Overwrite;
 import org.spongepowered.asm.mixin.Overwrite;
@@ -18,14 +18,14 @@ import java.util.function.Predicate;
 public class AndConditionMixin {
 public class AndConditionMixin {
     @Shadow
     @Shadow
     @Final
     @Final
-    private Iterable<? extends ICondition> conditions;
+    private Iterable<? extends Condition> conditions;
 
 
     /**
     /**
      * @reason Use cached result predicates
      * @reason Use cached result predicates
      * @author malte0811
      * @author malte0811
      */
      */
     @Overwrite
     @Overwrite
-    public Predicate<BlockState> getPredicate(StateContainer<Block, BlockState> stateContainer) {
+    public Predicate<BlockState> getPredicate(StateDefinition<Block, BlockState> stateContainer) {
         return Deduplicator.and(PredicateHelper.toCanonicalList(conditions, 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.impl.Deduplicator;
 import malte0811.ferritecore.util.PredicateHelper;
 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.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Overwrite;
 import org.spongepowered.asm.mixin.Overwrite;
@@ -18,14 +18,14 @@ import java.util.function.Predicate;
 public class OrConditionMixin {
 public class OrConditionMixin {
     @Shadow
     @Shadow
     @Final
     @Final
-    private Iterable<? extends ICondition> conditions;
+    private Iterable<? extends Condition> conditions;
 
 
     /**
     /**
      * @reason Use cached result predicates
      * @reason Use cached result predicates
      * @author malte0811
      * @author malte0811
      */
      */
     @Overwrite
     @Overwrite
-    public Predicate<BlockState> getPredicate(StateContainer<Block, BlockState> stateContainer) {
+    public Predicate<BlockState> getPredicate(StateDefinition<Block, BlockState> stateContainer) {
         return Deduplicator.or(PredicateHelper.toCanonicalList(conditions, 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 com.google.common.base.Splitter;
 import malte0811.ferritecore.impl.PropertyValueConditionImpl;
 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.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Overwrite;
 import org.spongepowered.asm.mixin.Overwrite;
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.Shadow;
 
 
 import java.util.function.Predicate;
 import java.util.function.Predicate;
 
 
-@Mixin(value = PropertyValueCondition.class, priority = 2000)
+@Mixin(value = KeyValueCondition.class, priority = 2000)
 public class PropertyValueConditionMixin {
 public class PropertyValueConditionMixin {
     @Shadow
     @Shadow
     @Final
     @Final
@@ -23,7 +23,7 @@ public class PropertyValueConditionMixin {
     private String value;
     private String value;
     @Shadow
     @Shadow
     @Final
     @Final
-    private static Splitter SPLITTER;
+    private static Splitter PIPE_SPLITTER;
 
 
     /**
     /**
      * @reason Use cached predicates in the case of multiple specified values
      * @reason Use cached predicates in the case of multiple specified values
@@ -33,7 +33,7 @@ public class PropertyValueConditionMixin {
      * @author malte0811
      * @author malte0811
      */
      */
     @Overwrite
     @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;
 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.ArrayList;
 import java.util.Comparator;
 import java.util.Comparator;
 import java.util.List;
 import java.util.List;
 import java.util.function.Predicate;
 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 class PredicateHelper {
     public static List<Predicate<BlockState>> toCanonicalList(
     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<>();
         ArrayList<Predicate<BlockState>> list = new ArrayList<>();
-        for (ICondition cond : conditions) {
+        for (Condition cond : conditions) {
             list.add(cond.getPredicate(stateContainer));
             list.add(cond.getPredicate(stateContainer));
         }
         }
         canonize(list);
         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 it.unimi.dsi.fastutil.booleans.BooleanList;
 import malte0811.ferritecore.classloading.FastImmutableMapDefiner;
 import malte0811.ferritecore.classloading.FastImmutableMapDefiner;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
 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 org.junit.jupiter.api.*;
 
 
 import java.util.Collections;
 import java.util.Collections;
@@ -99,7 +99,7 @@ public class FastMapTest {
             Stream<List<Pair<Property<?>, Comparable<?>>>> stream = Stream.of(Collections.emptyList());
             Stream<List<Pair<Property<?>, Comparable<?>>>> stream = Stream.of(Collections.emptyList());
 
 
             for (Property<?> property : properties) {
             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);
                     List<Pair<Property<?>, Comparable<?>>> withAdded = Lists.newArrayList(baseList);
                     withAdded.add(Pair.of(property, value));
                     withAdded.add(Pair.of(property, value));
                     return withAdded;
                     return withAdded;
@@ -144,7 +144,7 @@ public class FastMapTest {
         private <T extends Comparable<T>>
         private <T extends Comparable<T>>
         void testSwaps(int baseIndex, Property<T> toSwap, Map<Property<?>, Comparable<?>> baseMap) {
         void testSwaps(int baseIndex, Property<T> toSwap, Map<Property<?>, Comparable<?>> baseMap) {
             Map<Property<?>, Comparable<?>> expected = new HashMap<>(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);
                 Map<Property<?>, Comparable<?>> newMap = map.with(baseIndex, toSwap, newValue);
                 expected.put(toSwap, newValue);
                 expected.put(toSwap, newValue);
                 Assertions.assertEquals(expected, newMap);
                 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 com.google.common.collect.ImmutableMap;
 import malte0811.ferritecore.ducks.FastMapStateHolder;
 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> {
 public class MockFMStateHolder<T> implements FastMapStateHolder<T> {
     private final FastMap<T> map;
     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;
 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.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
 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
      * 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!
      * 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) {
     public void postPopulateNeighbors(Map<Map<Property<?>, Comparable<?>>, S> map, CallbackInfo ci) {
         ci.cancel();
         ci.cancel();
     }
     }

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

@@ -1,8 +1,8 @@
 package malte0811.ferritecore.mixin.fabric;
 package malte0811.ferritecore.mixin.fabric;
 
 
 import malte0811.ferritecore.impl.Deduplicator;
 import malte0811.ferritecore.impl.Deduplicator;
-import net.minecraft.client.GameConfiguration;
 import net.minecraft.client.Minecraft;
 import net.minecraft.client.Minecraft;
+import net.minecraft.client.main.GameConfig;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
 import org.spongepowered.asm.mixin.injection.Inject;
@@ -14,10 +14,10 @@ public class MinecraftMixin {
             method = "<init>",
             method = "<init>",
             at = @At(
             at = @At(
                     value = "INVOKE",
                     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();
         Deduplicator.registerReloadListener();
     }
     }
 }
 }

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

@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 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
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
 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
 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
 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
 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  
 Saved memory: Close to 200 MB  
 CPU impact: Slight during loading, zero at runtime  
 CPU impact: Slight during loading, zero at runtime