diff --git a/gradle.properties b/gradle.properties index 9515f6dfa..450d92fe3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,14 +2,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=20w19a -yarn_mappings=20w19a+build.1 -loader_version=0.8.2+build.194 +minecraft_version=1.16.1 +yarn_mappings=1.16.1+build.1 +loader_version=0.8.8+build.202 # Mod Properties mod_version=0.5.0 maven_group=me.jellysquid.mods archives_base_name=lithium-fabric cf_project_id=360438 cf_project_name=Lithium -cf_game_version=1.16-Snapshot - +cf_game_version=1.16.1 \ No newline at end of file diff --git a/src/main/java/me/jellysquid/mods/lithium/common/ai/WeightedListIterable.java b/src/main/java/me/jellysquid/mods/lithium/common/ai/WeightedListIterable.java index deb9c6951..e9a150e07 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/ai/WeightedListIterable.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/ai/WeightedListIterable.java @@ -26,9 +26,9 @@ static Iterable cast(WeightedList list) { * @param The value type stored in each list entry */ class ListIterator implements Iterator { - private final Iterator.Entry> inner; + private final Iterator> inner; - public ListIterator(Iterator.Entry> inner) { + public ListIterator(Iterator> inner) { this.inner = inner; } diff --git a/src/main/java/me/jellysquid/mods/lithium/common/entity/LithiumEntityCollisions.java b/src/main/java/me/jellysquid/mods/lithium/common/entity/LithiumEntityCollisions.java index 8c977579f..79611dee9 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/entity/LithiumEntityCollisions.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/entity/LithiumEntityCollisions.java @@ -184,8 +184,8 @@ public static boolean isBoxFullyWithinWorldBorder(WorldBorder border, Box box) { double wboxMaxX = Math.ceil(border.getBoundEast()); double wboxMaxZ = Math.ceil(border.getBoundSouth()); - return box.x1 >= wboxMinX && box.x1 < wboxMaxX && box.z1 >= wboxMinZ && box.z1 < wboxMaxZ && - box.x2 >= wboxMinX && box.x2 < wboxMaxX && box.z2 >= wboxMinZ && box.z2 < wboxMaxZ; + return box.minX >= wboxMinX && box.minX < wboxMaxX && box.minZ >= wboxMinZ && box.minZ < wboxMaxZ && + box.maxX >= wboxMinX && box.maxX < wboxMaxX && box.maxZ >= wboxMinZ && box.maxZ < wboxMaxZ; } private static boolean canEntityCollideWithWorldBorder(CollisionView world, Entity entity) { diff --git a/src/main/java/me/jellysquid/mods/lithium/common/entity/movement/BlockCollisionSweeper.java b/src/main/java/me/jellysquid/mods/lithium/common/entity/movement/BlockCollisionSweeper.java index 542328a94..9f6fd2ac3 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/entity/movement/BlockCollisionSweeper.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/entity/movement/BlockCollisionSweeper.java @@ -104,12 +104,12 @@ public VoxelShape getCollidedShape() { * with the {@param box}. */ private static CuboidBlockIterator createVolumeIteratorForCollision(Box box) { - int minX = MathHelper.floor(box.x1 - EPSILON) - 1; - int maxX = MathHelper.floor(box.x2 + EPSILON) + 1; - int minY = MathHelper.floor(box.y1 - EPSILON) - 1; - int maxY = MathHelper.floor(box.y2 + EPSILON) + 1; - int minZ = MathHelper.floor(box.z1 - EPSILON) - 1; - int maxZ = MathHelper.floor(box.z2 + EPSILON) + 1; + int minX = MathHelper.floor(box.minX - EPSILON) - 1; + int maxX = MathHelper.floor(box.maxX + EPSILON) + 1; + int minY = MathHelper.floor(box.minY - EPSILON) - 1; + int maxY = MathHelper.floor(box.maxY + EPSILON) + 1; + int minZ = MathHelper.floor(box.minZ - EPSILON) - 1; + int maxZ = MathHelper.floor(box.maxZ + EPSILON) + 1; return new CuboidBlockIterator(minX, minY, minZ, maxX, maxY, maxZ); } diff --git a/src/main/java/me/jellysquid/mods/lithium/common/shapes/VoxelShapeEmpty.java b/src/main/java/me/jellysquid/mods/lithium/common/shapes/VoxelShapeEmpty.java index a600fa566..914fc6dbd 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/shapes/VoxelShapeEmpty.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/shapes/VoxelShapeEmpty.java @@ -31,12 +31,12 @@ protected boolean contains(double x, double y, double z) { } @Override - public double getMinimum(Direction.Axis axis) { + public double getMin(Direction.Axis axis) { return Double.POSITIVE_INFINITY; } @Override - public double getMaximum(Direction.Axis axis) { + public double getMax(Direction.Axis axis) { return Double.NEGATIVE_INFINITY; } diff --git a/src/main/java/me/jellysquid/mods/lithium/common/shapes/VoxelShapeSimpleCube.java b/src/main/java/me/jellysquid/mods/lithium/common/shapes/VoxelShapeSimpleCube.java index 017868d94..4c22f5701 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/shapes/VoxelShapeSimpleCube.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/shapes/VoxelShapeSimpleCube.java @@ -23,22 +23,22 @@ public class VoxelShapeSimpleCube extends VoxelShape implements VoxelShapeExtended { private static final double EPSILON = 1.0E-7D; - private final double x1, y1, z1, x2, y2, z2; + private final double minX, minY, minZ, maxX, maxY, maxZ; - public VoxelShapeSimpleCube(VoxelSet voxels, double x1, double y1, double z1, double x2, double y2, double z2) { + public VoxelShapeSimpleCube(VoxelSet voxels, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { super(voxels); - this.x1 = x1; - this.y1 = y1; - this.z1 = z1; - this.x2 = x2; - this.y2 = y2; - this.z2 = z2; + this.minX = minX; + this.minY = minY; + this.minZ = minZ; + this.maxX = maxX; + this.maxY = maxY; + this.maxZ = maxZ; } @Override public VoxelShape offset(double x, double y, double z) { - return new VoxelShapeSimpleCube(this.voxels, this.x1 + x, this.y1 + y, this.z1 + z, this.x2 + x, this.y2 + y, this.z2 + z); + return new VoxelShapeSimpleCube(this.voxels, this.minX + x, this.minY + y, this.minZ + z, this.maxX + x, this.maxY + y, this.maxZ + z); } @Override @@ -59,11 +59,11 @@ public double calculateMaxDistance(AxisCycleDirection cycleDirection, Box box, d private double calculatePenetration(AxisCycleDirection dir, Box box, double maxDist) { switch (dir) { case NONE: - return this.calculatePenetration(this.x1, this.x2, box.x1, box.x2, maxDist); + return this.calculatePenetration(this.minX, this.maxX, box.minX, box.maxX, maxDist); case FORWARD: - return this.calculatePenetration(this.z1, this.z2, box.z1, box.z2, maxDist); + return this.calculatePenetration(this.minZ, this.maxZ, box.minZ, box.maxZ, maxDist); case BACKWARD: - return this.calculatePenetration(this.y1, this.y2, box.y1, box.y2, maxDist); + return this.calculatePenetration(this.minY, this.maxY, box.minY, box.maxY, maxDist); default: throw new IllegalArgumentException(); } @@ -72,11 +72,11 @@ private double calculatePenetration(AxisCycleDirection dir, Box box, double maxD private boolean intersects(AxisCycleDirection dir, Box box) { switch (dir) { case NONE: - return lessThan(this.y1, box.y2) && lessThan(box.y1, this.y2) && lessThan(this.z1, box.z2) && lessThan(box.z1, this.z2); + return lessThan(this.minY, box.maxY) && lessThan(box.minY, this.maxY) && lessThan(this.minZ, box.maxZ) && lessThan(box.minZ, this.maxZ); case FORWARD: - return lessThan(this.x1, box.x2) && lessThan(box.x1, this.x2) && lessThan(this.y1, box.y2) && lessThan(box.y1, this.y2); + return lessThan(this.minX, box.maxX) && lessThan(box.minX, this.maxX) && lessThan(this.minY, box.maxY) && lessThan(box.minY, this.maxY); case BACKWARD: - return lessThan(this.z1, box.z2) && lessThan(box.z1, this.z2) && lessThan(this.x1, box.x2) && lessThan(box.x1, this.x2); + return lessThan(this.minZ, box.maxZ) && lessThan(box.minZ, this.maxZ) && lessThan(this.minX, box.maxX) && lessThan(box.minX, this.maxX); default: throw new IllegalArgumentException(); } @@ -117,17 +117,17 @@ public List getBoundingBoxes() { @Override public Box getBoundingBox() { - return new Box(this.x1, this.y1, this.z1, this.x2, this.y2, this.z2); + return new Box(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); } @Override - public double getMinimum(Direction.Axis axis) { - return axis.choose(this.x1, this.y1, this.z1); + public double getMin(Direction.Axis axis) { + return axis.choose(this.minX, this.minY, this.minZ); } @Override - public double getMaximum(Direction.Axis axis) { - return axis.choose(this.x2, this.y2, this.z2); + public double getMax(Direction.Axis axis) { + return axis.choose(this.maxX, this.maxY, this.maxZ); } @Override @@ -138,11 +138,11 @@ protected double getPointPosition(Direction.Axis axis, int index) { switch (axis) { case X: - return (index == 0) ? this.x1 : this.x2; + return (index == 0) ? this.minX : this.maxX; case Y: - return (index == 0) ? this.y1 : this.y2; + return (index == 0) ? this.minY : this.maxY; case Z: - return (index == 0) ? this.z1 : this.z2; + return (index == 0) ? this.minZ : this.maxZ; } throw new IllegalArgumentException(); @@ -152,11 +152,11 @@ protected double getPointPosition(Direction.Axis axis, int index) { protected DoubleList getPointPositions(Direction.Axis axis) { switch (axis) { case X: - return DoubleArrayList.wrap(new double[]{this.x1, this.x2}); + return DoubleArrayList.wrap(new double[]{this.minX, this.maxX}); case Y: - return DoubleArrayList.wrap(new double[]{this.y1, this.y2}); + return DoubleArrayList.wrap(new double[]{this.minY, this.maxY}); case Z: - return DoubleArrayList.wrap(new double[]{this.z1, this.z2}); + return DoubleArrayList.wrap(new double[]{this.minZ, this.maxZ}); } throw new IllegalArgumentException(); @@ -164,21 +164,21 @@ protected DoubleList getPointPositions(Direction.Axis axis) { @Override protected boolean contains(double x, double y, double z) { - return (x >= this.x1) && (x < this.x2) && (y >= this.y1) && (y < this.y2) && (z >= this.z1) && (z < this.z2); + return (x >= this.minX) && (x < this.maxX) && (y >= this.minY) && (y < this.maxY) && (z >= this.minZ) && (z < this.maxZ); } @Override public boolean isEmpty() { - return ((this.x1 + EPSILON) > this.x2) || ((this.y1 + EPSILON) > this.y2) || ((this.z1 + EPSILON) > this.z2); + return ((this.minX + EPSILON) > this.maxX) || ((this.minY + EPSILON) > this.maxY) || ((this.minZ + EPSILON) > this.maxZ); } @Override protected int getCoordIndex(Direction.Axis axis, double coord) { - if (coord < this.getMinimum(axis)) { + if (coord < this.getMin(axis)) { return -1; } - if (coord >= this.getMaximum(axis)) { + if (coord >= this.getMax(axis)) { return 1; } @@ -191,8 +191,8 @@ private static boolean lessThan(double a, double b) { @Override public boolean intersects(Box box, double x, double y, double z) { - return (box.x1 < (this.x2 + x)) && (box.x2 > (this.x1 + x)) && - (box.y1 < (this.y2 + y)) && (box.y2 > (this.y1 + y)) && - (box.z1 < (this.z2 + z)) && (box.z2 > (this.z1 + z)); + return (box.minX < (this.maxX + x)) && (box.maxX > (this.minX + x)) && + (box.minY < (this.maxY + y)) && (box.maxY > (this.minY + y)) && + (box.minZ < (this.maxZ + z)) && (box.maxZ > (this.minZ + z)); } } diff --git a/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java b/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java index 4cde8f843..6cc055eaa 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java @@ -14,6 +14,7 @@ import java.util.Arrays; import java.util.function.Function; +import java.util.function.Predicate; import static it.unimi.dsi.fastutil.Hash.FAST_LOAD_FACTOR; @@ -94,8 +95,14 @@ private void resize(int neededCapacity) { } @Override - public boolean accepts(T obj) { - return this.table.containsKey(obj); + public boolean accepts(Predicate predicate) { + for (int i = 0; i < this.size; ++i) { + if (predicate.test(this.entries[i])) { + return true; + } + } + + return false; } @Override diff --git a/src/main/java/me/jellysquid/mods/lithium/common/world/interests/PointOfInterestTypeHelper.java b/src/main/java/me/jellysquid/mods/lithium/common/world/interests/PointOfInterestTypeHelper.java index 1865d3b32..57054d632 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/world/interests/PointOfInterestTypeHelper.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/world/interests/PointOfInterestTypeHelper.java @@ -17,13 +17,7 @@ public static void init(Set types) { } public static boolean shouldScan(ChunkSection section) { - for (BlockState state : TYPES) { - if (section.method_19523(state)) { - return true; - } - } - - return false; + return section.method_19523(TYPES::contains); } } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/goal/MixinGoalSelector.java b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/goal/MixinGoalSelector.java index cb5e29850..88cce7ab7 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/goal/MixinGoalSelector.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/goal/MixinGoalSelector.java @@ -3,7 +3,7 @@ import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; import net.minecraft.entity.ai.goal.Goal; import net.minecraft.entity.ai.goal.GoalSelector; -import net.minecraft.entity.ai.goal.WeightedGoal; +import net.minecraft.entity.ai.goal.PrioritizedGoal; import net.minecraft.util.profiler.Profiler; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.At; @@ -26,7 +26,7 @@ public abstract class MixinGoalSelector { @Mutable @Shadow @Final - private Set goals; + private Set goals; @Shadow @Final @@ -34,7 +34,7 @@ public abstract class MixinGoalSelector { @Shadow @Final - private Map goalsByControl; + private Map goalsByControl; /** * Replace the goal set with an optimized collection type which performs better for iteration. @@ -79,7 +79,7 @@ private void updateGoalStates() { * Attempts to stop all goals which are running and either shouldn't continue or no longer have available controls. */ private void stopGoals() { - for (WeightedGoal goal : this.goals) { + for (PrioritizedGoal goal : this.goals) { // Filter out goals which are not running if (!goal.isRunning()) { continue; @@ -97,7 +97,7 @@ private void stopGoals() { */ private void cleanupControls() { for (Goal.Control control : CONTROLS) { - WeightedGoal goal = this.goalsByControl.get(control); + PrioritizedGoal goal = this.goalsByControl.get(control); // If the control has been acquired by a goal, check if the goal should still be running // If the goal should not be running anymore, release the control held by it @@ -111,7 +111,7 @@ private void cleanupControls() { * Attempts to start all goals which are not-already running, can be started, and have their controls available. */ private void startGoals() { - for (WeightedGoal goal : this.goals) { + for (PrioritizedGoal goal : this.goals) { // Filter out goals which are already running or can't be started if (goal.isRunning() || !goal.canStart()) { continue; @@ -124,7 +124,7 @@ private void startGoals() { // Hand over controls to this goal and stop any goals which depended on those controls for (Goal.Control control : goal.getControls()) { - WeightedGoal otherGoal = this.getGoalOccupyingControl(control); + PrioritizedGoal otherGoal = this.getGoalOccupyingControl(control); if (otherGoal != null) { otherGoal.stop(); @@ -144,7 +144,7 @@ private void tickGoals() { this.profiler.get().push("goalTick"); // Tick all currently running goals - for (WeightedGoal goal : this.goals) { + for (PrioritizedGoal goal : this.goals) { if (goal.isRunning()) { goal.tick(); } @@ -156,7 +156,7 @@ private void tickGoals() { /** * Returns true if any controls of the specified goal are disabled. */ - private boolean areControlsDisabled(WeightedGoal goal) { + private boolean areControlsDisabled(PrioritizedGoal goal) { for (Goal.Control control : goal.getControls()) { if (this.isControlDisabled(control)) { return true; @@ -170,13 +170,13 @@ private boolean areControlsDisabled(WeightedGoal goal) { * Returns true if all controls for the specified goal are either available (not acquired by another goal) or replaceable * (acquired by another goal, but eligible for replacement) and not disabled for the entity. */ - private boolean areGoalControlsAvailable(WeightedGoal goal) { + private boolean areGoalControlsAvailable(PrioritizedGoal goal) { for (Goal.Control control : goal.getControls()) { if (this.isControlDisabled(control)) { return false; } - WeightedGoal occupied = this.getGoalOccupyingControl(control); + PrioritizedGoal occupied = this.getGoalOccupyingControl(control); if (occupied != null && !occupied.canBeReplacedBy(goal)) { return false; @@ -196,14 +196,14 @@ private boolean isControlDisabled(Goal.Control control) { /** * Returns the goal which is currently holding the specified control, or null if no goal is. */ - private WeightedGoal getGoalOccupyingControl(Goal.Control control) { + private PrioritizedGoal getGoalOccupyingControl(Goal.Control control) { return this.goalsByControl.get(control); } /** * Changes the goal which is currently holding onto a control. */ - private void setGoalOccupyingControl(Goal.Control control, WeightedGoal goal) { + private void setGoalOccupyingControl(Goal.Control control, PrioritizedGoal goal) { this.goalsByControl.put(control, goal); } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/nearby_entity_tracking/MixinWorld.java b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/nearby_entity_tracking/MixinWorld.java index 12d648de2..c72aeccbd 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/nearby_entity_tracking/MixinWorld.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/nearby_entity_tracking/MixinWorld.java @@ -2,18 +2,16 @@ import me.jellysquid.mods.lithium.common.entity.tracker.EntityTrackerEngine; import me.jellysquid.mods.lithium.common.entity.tracker.EntityTrackerEngineProvider; -import net.minecraft.class_5269; import net.minecraft.util.profiler.Profiler; +import net.minecraft.util.registry.RegistryKey; +import net.minecraft.world.MutableWorldProperties; import net.minecraft.world.World; -import net.minecraft.world.chunk.ChunkManager; -import net.minecraft.world.dimension.Dimension; import net.minecraft.world.dimension.DimensionType; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.function.BiFunction; import java.util.function.Supplier; /** @@ -27,7 +25,7 @@ public class MixinWorld implements EntityTrackerEngineProvider { * Initialize the {@link EntityTrackerEngine} which all entities of the world will interact with. */ @Inject(method = "", at = @At("RETURN")) - private void init(class_5269 levelProperties, DimensionType dimensionType, BiFunction chunkManagerProvider, Supplier profiler, boolean isClient, CallbackInfo ci) { + private void init(MutableWorldProperties mutableWorldProperties, RegistryKey registryKey, RegistryKey registryKey2, DimensionType dimensionType, Supplier profiler, boolean bl, boolean bl2, long l, CallbackInfo ci) { this.tracker = new EntityTrackerEngine(); } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/pathing/MixinLandPathNodeMaker.java b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/pathing/MixinLandPathNodeMaker.java index 4e65e530a..cde520df4 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/pathing/MixinLandPathNodeMaker.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/pathing/MixinLandPathNodeMaker.java @@ -21,11 +21,8 @@ * cache which stores the result of this complicated code path. This provides a significant speed-up in path-finding * code and should be relatively safe. */ -@SuppressWarnings("ConstantConditions") @Mixin(LandPathNodeMaker.class) public abstract class MixinLandPathNodeMaker { - private static final PathNodeType[] NODE_TYPES = PathNodeType.values(); - // This is not thread-safe! private static final Reference2ReferenceMap commonTypes = new Reference2ReferenceOpenHashMap<>(); private static final Reference2ReferenceMap neighborTypes = new Reference2ReferenceOpenHashMap<>(); @@ -131,9 +128,9 @@ public static PathNodeType getCommonNodeType(BlockView blockView, BlockPos block // Retrieve the fluid state from the block state to avoid a second lookup FluidState fluid = blockState.getFluidState(); - if (fluid.matches(FluidTags.WATER)) { + if (fluid.isIn(FluidTags.WATER)) { return PathNodeType.WATER; - } else if (fluid.matches(FluidTags.LAVA)) { + } else if (fluid.isIn(FluidTags.LAVA)) { return PathNodeType.LAVA; } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/raid/MixinPickupBannerAsLeaderGoal.java b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/raid/MixinPickupBannerAsLeaderGoal.java index 265ab868b..ed7938525 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/raid/MixinPickupBannerAsLeaderGoal.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/raid/MixinPickupBannerAsLeaderGoal.java @@ -1,8 +1,8 @@ package me.jellysquid.mods.lithium.mixin.ai.raid; -import net.minecraft.entity.raid.Raid; import net.minecraft.entity.raid.RaiderEntity; import net.minecraft.item.ItemStack; +import net.minecraft.village.raid.Raid; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; @@ -12,7 +12,7 @@ public class MixinPickupBannerAsLeaderGoal { // The call to Raid#getOminousBanner() is very expensive, so cache it and re-use it during AI ticking private static final ItemStack CACHED_OMINOUS_BANNER = Raid.getOminousBanner(); - @Redirect(method = "canStart", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/raid/Raid;getOminousBanner()Lnet/minecraft/item/ItemStack;")) + @Redirect(method = "canStart", at = @At(value = "INVOKE", target = "Lnet/minecraft/village/raid/Raid;getOminousBanner()Lnet/minecraft/item/ItemStack;")) private ItemStack getOminousBanner() { return CACHED_OMINOUS_BANNER; } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/raid/MixinRaid.java b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/raid/MixinRaid.java index 6f593f0db..1622ada91 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/raid/MixinRaid.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/raid/MixinRaid.java @@ -1,8 +1,8 @@ package me.jellysquid.mods.lithium.mixin.ai.raid; import net.minecraft.entity.boss.ServerBossBar; -import net.minecraft.entity.raid.Raid; import net.minecraft.util.math.MathHelper; +import net.minecraft.village.raid.Raid; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/task/MixinWeightedList.java b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/task/MixinWeightedList.java index 123f68f7e..4fdbcd172 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/ai/task/MixinWeightedList.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/ai/task/MixinWeightedList.java @@ -13,7 +13,7 @@ public class MixinWeightedList implements WeightedListIterable { @Shadow @Final - protected List.Entry> entries; + protected List> entries; @Override public Iterator iterator() { diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/alloc/enum_values/MixinLivingEntity.java b/src/main/java/me/jellysquid/mods/lithium/mixin/alloc/enum_values/MixinLivingEntity.java index ae249c82e..f1ef75e92 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/alloc/enum_values/MixinLivingEntity.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/alloc/enum_values/MixinLivingEntity.java @@ -6,7 +6,6 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; -@SuppressWarnings("InvalidMemberReference") @Mixin(LivingEntity.class) public class MixinLivingEntity { private static final EquipmentSlot[] SLOTS = EquipmentSlot.values(); @@ -14,7 +13,7 @@ public class MixinLivingEntity { /** * @reason Avoid cloning enum values */ - @Redirect(method = {"tick", "writeCustomDataToTag"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EquipmentSlot;values()[Lnet/minecraft/entity/EquipmentSlot;")) + @Redirect(method = "method_30129", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EquipmentSlot;values()[Lnet/minecraft/entity/EquipmentSlot;")) private EquipmentSlot[] redirectEquipmentSlotsClone() { return SLOTS; } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/block/flatten_states/MixinFluidStateImpl.java b/src/main/java/me/jellysquid/mods/lithium/mixin/block/flatten_states/MixinFluidStateImpl.java deleted file mode 100644 index e4054b3fd..000000000 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/block/flatten_states/MixinFluidStateImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package me.jellysquid.mods.lithium.mixin.block.flatten_states; - -import com.google.common.collect.ImmutableMap; -import net.minecraft.fluid.Fluid; -import net.minecraft.fluid.FluidState; -import net.minecraft.fluid.FluidStateImpl; -import net.minecraft.state.property.Property; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -/** - * The methods in {@link FluidState} involve a lot of indirection through the BlockState/Fluid classes and require - * property lookups in order to compute the returned value. This shows up as a hot spot in some areas (namely fluid - * ticking and world generation). - *

- * Since these are constant for any given fluid state, we can cache them nearby for improved performance and eliminate - * the overhead. - */ -@Mixin(FluidStateImpl.class) -public abstract class MixinFluidStateImpl implements FluidState { - private float height; - private int level; - private boolean isEmpty; - private boolean isStill; - - @Inject(method = "", at = @At("RETURN")) - private void init(Fluid fluid, ImmutableMap, Comparable> properties, CallbackInfo ci) { - this.isEmpty = fluid.isEmpty(); - - this.level = fluid.getLevel(this); - this.height = fluid.getHeight(this); - this.isStill = fluid.isStill(this); - } - - @Override - public boolean isStill() { - return this.isStill; - } - - @Override - public boolean isEmpty() { - return this.isEmpty; - } - - @Override - public float getHeight() { - return this.height; - } - - @Override - public int getLevel() { - return this.level; - } -} diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/chunk/serialization/MixinPalettedContainer.java b/src/main/java/me/jellysquid/mods/lithium/mixin/chunk/serialization/MixinPalettedContainer.java index 8de775e0f..a72829c3b 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/chunk/serialization/MixinPalettedContainer.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/chunk/serialization/MixinPalettedContainer.java @@ -134,7 +134,7 @@ public void write(CompoundTag rootTag, String paletteKey, String dataKey) { */ @Inject(method = "count", at = @At("HEAD"), cancellable = true) public void count(PalettedContainer.CountConsumer consumer, CallbackInfo ci) { - int len = (1 << this.data.getElementBits()); + int len = (1 << this.paletteSize); // Do not allocate huge arrays if we're using a large palette if (len > 4096) { diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/gen/chunk_region/MixinChunkRegion.java b/src/main/java/me/jellysquid/mods/lithium/mixin/gen/chunk_region/MixinChunkRegion.java index d56971320..d2db71b65 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/gen/chunk_region/MixinChunkRegion.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/gen/chunk_region/MixinChunkRegion.java @@ -21,7 +21,7 @@ public abstract class MixinChunkRegion { @Shadow @Final - private ChunkPos field_23788; + private ChunkPos lowerCorner; @Shadow @Final @@ -35,8 +35,8 @@ public abstract class MixinChunkRegion { @Inject(method = "", at = @At("RETURN")) private void init(ServerWorld world, List chunks, CallbackInfo ci) { - this.minChunkX = this.field_23788.x; - this.minChunkZ = this.field_23788.z; + this.minChunkX = this.lowerCorner.x; + this.minChunkZ = this.lowerCorner.z; this.chunksArr = chunks.toArray(new Chunk[0]); } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/math/fast_util/MixinBox.java b/src/main/java/me/jellysquid/mods/lithium/mixin/math/fast_util/MixinBox.java index 767a0788c..2fc4bc54f 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/math/fast_util/MixinBox.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/math/fast_util/MixinBox.java @@ -9,7 +9,6 @@ @Mixin(Box.class) public class MixinBox { - static { assert Direction.Axis.X.ordinal() == 0; assert Direction.Axis.Y.ordinal() == 1; @@ -19,27 +18,27 @@ public class MixinBox { @Shadow @Final - public double x1; + public double minX; @Shadow @Final - public double y1; + public double minY; @Shadow @Final - public double y2; + public double minZ; @Shadow @Final - public double z1; + public double maxX; @Shadow @Final - public double x2; + public double maxY; @Shadow @Final - public double z2; + public double maxZ; /** * @reason Simplify the code to better help the JVM optimize it @@ -49,11 +48,11 @@ public class MixinBox { public double getMin(Direction.Axis axis) { switch (axis.ordinal()) { case 0: //X - return this.x1; + return this.minX; case 1: //Y - return this.y1; + return this.minY; case 2: //Z - return this.z1; + return this.minZ; } throw new IllegalArgumentException(); @@ -67,11 +66,11 @@ public double getMin(Direction.Axis axis) { public double getMax(Direction.Axis axis) { switch (axis.ordinal()) { case 0: //X - return this.x2; + return this.maxX; case 1: //Y - return this.y2; + return this.maxY; case 2: //Z - return this.z2; + return this.maxZ; } throw new IllegalArgumentException(); diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_init/MixinPointOfInterestStorage.java b/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_init/MixinPointOfInterestStorage.java index 4b5c95cc4..34ec56e6c 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_init/MixinPointOfInterestStorage.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_init/MixinPointOfInterestStorage.java @@ -1,6 +1,7 @@ package me.jellysquid.mods.lithium.mixin.poi.fast_init; import com.mojang.datafixers.DataFixer; +import com.mojang.serialization.Codec; import me.jellysquid.mods.lithium.common.world.interests.PointOfInterestTypeHelper; import net.minecraft.datafixer.DataFixTypes; import net.minecraft.util.math.BlockPos; @@ -17,11 +18,12 @@ import java.io.File; import java.util.function.BiConsumer; +import java.util.function.Function; @Mixin(PointOfInterestStorage.class) public abstract class MixinPointOfInterestStorage extends SerializingRegionBasedStorage { - public MixinPointOfInterestStorage(File file, DataFixer fixer, boolean flag) { - super(file, PointOfInterestSet::serialize, PointOfInterestSet::new, PointOfInterestSet::new, fixer, DataFixTypes.POI_CHUNK, flag); + public MixinPointOfInterestStorage(File directory, Function> function, Function function2, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean bl) { + super(directory, function, function2, dataFixer, dataFixTypes, bl); } @Shadow diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_retrieval/MixinPointOfInterestStorage.java b/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_retrieval/MixinPointOfInterestStorage.java index 4c97e3188..cea317de8 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_retrieval/MixinPointOfInterestStorage.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_retrieval/MixinPointOfInterestStorage.java @@ -1,6 +1,7 @@ package me.jellysquid.mods.lithium.mixin.poi.fast_retrieval; import com.mojang.datafixers.DataFixer; +import com.mojang.serialization.Codec; import me.jellysquid.mods.lithium.common.util.Collector; import me.jellysquid.mods.lithium.common.world.interests.PointOfInterestActions; import me.jellysquid.mods.lithium.common.world.interests.RegionBasedStorageExtended; @@ -17,13 +18,14 @@ import java.io.File; import java.util.*; +import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Stream; @Mixin(PointOfInterestStorage.class) public abstract class MixinPointOfInterestStorage extends SerializingRegionBasedStorage { - public MixinPointOfInterestStorage(File file, DataFixer fixer, boolean flag) { - super(file, PointOfInterestSet::serialize, PointOfInterestSet::new, PointOfInterestSet::new, fixer, DataFixTypes.POI_CHUNK, flag); + public MixinPointOfInterestStorage(File directory, Function> function, Function function2, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean bl) { + super(directory, function, function2, dataFixer, dataFixTypes, bl); } /** diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_retrieval/MixinSerializingRegionBasedStorage.java b/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_retrieval/MixinSerializingRegionBasedStorage.java index 9f601da9b..be67b8403 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_retrieval/MixinSerializingRegionBasedStorage.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/poi/fast_retrieval/MixinSerializingRegionBasedStorage.java @@ -1,18 +1,16 @@ package me.jellysquid.mods.lithium.mixin.poi.fast_retrieval; import com.mojang.datafixers.DataFixer; -import com.mojang.datafixers.Dynamic; +import com.mojang.serialization.Codec; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; import me.jellysquid.mods.lithium.common.util.Collector; import me.jellysquid.mods.lithium.common.util.collections.ListeningLong2ObjectOpenHashMap; import me.jellysquid.mods.lithium.common.world.interests.RegionBasedStorageExtended; import net.minecraft.datafixer.DataFixTypes; -import net.minecraft.util.dynamic.DynamicSerializable; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkSectionPos; import net.minecraft.world.storage.SerializingRegionBasedStorage; -import net.minecraft.world.storage.StorageSerializer; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mutable; @@ -25,13 +23,12 @@ import java.util.BitSet; import java.util.Objects; import java.util.Optional; -import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Stream; @SuppressWarnings("OptionalUsedAsFieldOrParameterType") // We don't get a choice, this is Minecraft's doing! @Mixin(SerializingRegionBasedStorage.class) -public abstract class MixinSerializingRegionBasedStorage implements RegionBasedStorageExtended { +public abstract class MixinSerializingRegionBasedStorage implements RegionBasedStorageExtended { @Mutable @Shadow @Final @@ -46,7 +43,7 @@ public abstract class MixinSerializingRegionBasedStorage columns; @Inject(method = "", at = @At("RETURN")) - private void init(File file, StorageSerializer class_5128_1, BiFunction, R> serializer, Function deserializer, DataFixer fixer, DataFixTypes type, boolean sync, CallbackInfo ci) { + private void init(File directory, Function> function, Function function2, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean sync, CallbackInfo ci) { this.columns = new Long2ObjectOpenHashMap<>(); this.loadedElements = new ListeningLong2ObjectOpenHashMap<>(this::onEntryAdded, this::onEntryRemoved); } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/shapes/specialized_shapes/MixinVoxelShapes.java b/src/main/java/me/jellysquid/mods/lithium/mixin/shapes/specialized_shapes/MixinVoxelShapes.java index 81c75907c..35c35dc18 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/shapes/specialized_shapes/MixinVoxelShapes.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/shapes/specialized_shapes/MixinVoxelShapes.java @@ -71,6 +71,6 @@ public abstract class MixinVoxelShapes { */ @Overwrite public static VoxelShape cuboid(Box box) { - return new VoxelShapeSimpleCube(FULL_CUBE_VOXELS, box.x1, box.y1, box.z1, box.x2, box.y2, box.z2); + return new VoxelShapeSimpleCube(FULL_CUBE_VOXELS, box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ); } } diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/world/chunk_access/MixinServerChunkManager.java b/src/main/java/me/jellysquid/mods/lithium/mixin/world/chunk_access/MixinServerChunkManager.java index 1d3287f0c..46ea8a0db 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/world/chunk_access/MixinServerChunkManager.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/world/chunk_access/MixinServerChunkManager.java @@ -59,6 +59,9 @@ public abstract class MixinServerChunkManager { @Shadow protected abstract boolean isMissingForLevel(ChunkHolder holder, int maxLevel); + @Shadow + @Final + private Thread serverThread; private long time; @Inject(method = "tick()Z", at = @At("HEAD")) @@ -72,6 +75,10 @@ private void preTick(CallbackInfoReturnable cir) { */ @Overwrite public Chunk getChunk(int x, int z, ChunkStatus status, boolean create) { + if (Thread.currentThread() != this.serverThread) { + return this.getChunkOffThread(x, z, status, create); + } + // Store a local reference to the cached keys array in order to prevent bounds checks later long[] cacheKeys = this.cacheKeys; @@ -103,6 +110,12 @@ public Chunk getChunk(int x, int z, ChunkStatus status, boolean create) { return chunk; } + private Chunk getChunkOffThread(int x, int z, ChunkStatus status, boolean create) { + return CompletableFuture.supplyAsync(() -> { + return this.getChunk(x, z, status, create); + }, this.mainThreadExecutor).join(); + } + /** * Retrieves a chunk from the storages, blocking to work on other tasks if the requested chunk needs to be loaded * from disk or generated in real-time. @@ -202,7 +215,7 @@ private Chunk getChunkBlocking(int x, int z, ChunkStatus status, boolean create) private void createChunkLoadTicket(int x, int z, int level) { ChunkPos chunkPos = new ChunkPos(x, z); - this.ticketManager.addTicketWithLevel(ChunkTicketType.UNKNOWN, chunkPos, level, chunkPos); + this.ticketManager.addTicketWithLevel(ChunkTicketType.field_14032, chunkPos, level, chunkPos); } /** diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/world/chunk_access/MixinWorld.java b/src/main/java/me/jellysquid/mods/lithium/mixin/world/chunk_access/MixinWorld.java index 1d3be4e5e..29f061e95 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/world/chunk_access/MixinWorld.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/world/chunk_access/MixinWorld.java @@ -1,29 +1,19 @@ package me.jellysquid.mods.lithium.mixin.world.chunk_access; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.BlockView; -import net.minecraft.world.CollisionView; -import net.minecraft.world.World; -import net.minecraft.world.WorldView; +import net.minecraft.world.*; import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.ChunkManager; import net.minecraft.world.chunk.ChunkStatus; import net.minecraft.world.chunk.WorldChunk; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; /** * Implement the interface members of {@link WorldView} and {@link CollisionView} directly to avoid complicated * method invocations between interface boundaries, helping the JVM to inline and optimize code. */ @Mixin(World.class) -public abstract class MixinWorld implements WorldView, CollisionView { - @Shadow - @Final - protected ChunkManager chunkManager; - +public abstract class MixinWorld implements WorldAccess { /** * @reason Remove dynamic-dispatch and inline call * @author JellySquid @@ -59,7 +49,7 @@ public BlockView getExistingChunk(int chunkX, int chunkZ) { } private Chunk getChunkLithium(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { - Chunk chunk = this.chunkManager.getChunk(chunkX, chunkZ, leastStatus, create); + Chunk chunk = this.getChunkManager().getChunk(chunkX, chunkZ, leastStatus, create); if (chunk == null && create) { throw new IllegalStateException("Should always be able to create a chunk!"); diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/world/fire_checks/MixinWorld.java b/src/main/java/me/jellysquid/mods/lithium/mixin/world/fire_checks/MixinWorld.java deleted file mode 100644 index 8f496f6e9..000000000 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/world/fire_checks/MixinWorld.java +++ /dev/null @@ -1,67 +0,0 @@ -package me.jellysquid.mods.lithium.mixin.world.fire_checks; - -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.tag.BlockTags; -import net.minecraft.util.math.Box; -import net.minecraft.util.math.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.ChunkSection; -import net.minecraft.world.chunk.ChunkStatus; -import net.minecraft.world.chunk.WorldChunk; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(World.class) -public abstract class MixinWorld { - @Shadow - public abstract Chunk getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create); - - /** - * This implementation avoids repeatedly fetching chunks from the world by hoisting it from the y-iteration step. - * Additionally, the check whether an area of chunks is loaded upfront is removed and moved down into the loop by - * checking if a chunk is null. - * - * @reason Use optimized function - * @author JellySquid - */ - @Overwrite - public boolean doesAreaContainFireSource(Box box) { - int minX = MathHelper.floor(box.x1); - int maxX = MathHelper.floor(box.x2); - int minY = MathHelper.floor(box.y1); - int maxY = MathHelper.floor(box.y2); - int minZ = MathHelper.floor(box.z1); - int maxZ = MathHelper.floor(box.z2); - - for (int x = minX; x <= maxX; ++x) { - for (int z = minZ; z <= maxZ; ++z) { - Chunk chunk = this.getChunk(x >> 4, z >> 4, ChunkStatus.FULL, false); - - if (chunk == null) { - continue; - } - - for (int y = minY; y <= maxY; ++y) { - if (y < 0 || y >= 256) { - continue; - } - - ChunkSection section = chunk.getSectionArray()[y >> 4]; - - if (section != null) { - BlockState blockState = section.getBlockState(x & 15, y & 15, z & 15); - - if (blockState.isIn(BlockTags.FIRE) || blockState.getBlock() == Blocks.LAVA) { - return true; - } - } - } - } - } - - return false; - } -} diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/world/mob_spawning/MixinBiome.java b/src/main/java/me/jellysquid/mods/lithium/mixin/world/mob_spawning/MixinBiome.java index 0a7c11d78..f9fc577fc 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/world/mob_spawning/MixinBiome.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/world/mob_spawning/MixinBiome.java @@ -2,7 +2,7 @@ import com.google.common.collect.Maps; import me.jellysquid.mods.lithium.common.util.collections.HashedList; -import net.minecraft.entity.EntityCategory; +import net.minecraft.entity.SpawnGroup; import net.minecraft.world.biome.Biome; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -20,11 +20,11 @@ public class MixinBiome { @Mutable @Shadow @Final - private Map> spawns; + private Map> spawns; /** * Re-initialize the spawn category lists with a much faster backing collection type for enum keys. This provides - * a modest speed-up for mob spawning as {@link Biome#getEntitySpawnList(EntityCategory)} is a rather hot method. + * a modest speed-up for mob spawning as {@link Biome#getEntitySpawnList(SpawnGroup)} is a rather hot method. *

* Additionally, the list containing each spawn entry is modified to include a hash table for lookups, making them * O(1) instead of O(n) and providing another boost when lists get large. Since a simple wrapper type is used, this @@ -32,9 +32,9 @@ public class MixinBiome { */ @Inject(method = "", at = @At("RETURN")) private void reinit(Biome.Settings settings, CallbackInfo ci) { - Map> spawns = Maps.newEnumMap(EntityCategory.class); + Map> spawns = Maps.newEnumMap(SpawnGroup.class); - for (Map.Entry> entry : this.spawns.entrySet()) { + for (Map.Entry> entry : this.spawns.entrySet()) { spawns.put(entry.getKey(), HashedList.wrapper(entry.getValue())); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ce05f4452..b9fd611b2 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -25,6 +25,6 @@ "accessWidener": "lithium.accesswidener", "depends": { "fabricloader": ">=0.8.0", - "minecraft": "1.16-alpha.20.19.a" + "minecraft": "1.16.1" } } diff --git a/src/main/resources/lithium.mixins.json b/src/main/resources/lithium.mixins.json index a52920072..82086f575 100644 --- a/src/main/resources/lithium.mixins.json +++ b/src/main/resources/lithium.mixins.json @@ -34,7 +34,6 @@ "alloc.enum_values.MixinPistonHandler", "biome.MixinVoronoiBiomeAccessType", "block.flatten_states.MixinAbstractBlockState", - "block.flatten_states.MixinFluidStateImpl", "block.piston_shapes.MixinPistonHeadBlock", "cached_hashcode.MixinBlockNeighborGroup", "chunk.no_locking.MixinPalettedContainer", @@ -77,7 +76,6 @@ "world.chunk_ticking.MixinPlayerChunkWatchingManager", "world.chunk_ticking.MixinThreadedAnvilChunkStorage", "world.explosions.MixinExplosion", - "world.fire_checks.MixinWorld", "world.layer_caching.MixinBiomeLayerSampler", "world.layer_caching.MixinCachingLayerContext", "world.layer_caching.MixinParentedLayer",