diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/alloc/chunk_ticking/ChunkTicketManagerMixin.java b/src/main/java/me/jellysquid/mods/lithium/mixin/alloc/chunk_ticking/ChunkTicketManagerMixin.java deleted file mode 100644 index 84f2d7335..000000000 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/alloc/chunk_ticking/ChunkTicketManagerMixin.java +++ /dev/null @@ -1,60 +0,0 @@ -package me.jellysquid.mods.lithium.mixin.alloc.chunk_ticking; - -import it.unimi.dsi.fastutil.longs.Long2ObjectMap; -import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; -import it.unimi.dsi.fastutil.objects.ObjectIterator; -import net.minecraft.server.world.ChunkTicket; -import net.minecraft.server.world.ChunkTicketManager; -import net.minecraft.util.collection.SortedArraySet; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -import java.util.function.Predicate; - -@Mixin(ChunkTicketManager.class) -public abstract class ChunkTicketManagerMixin { - @Shadow - private long age; - - @Shadow - @Final - Long2ObjectOpenHashMap>> ticketsByPosition; - - @Shadow - @Final - private ChunkTicketManager.TicketDistanceLevelPropagator distanceFromTicketTracker; - - @Shadow - private static int getLevel(SortedArraySet> sortedArraySet) { - throw new UnsupportedOperationException(); - } - - /** - * @reason Remove lambda allocation in every iteration - * @author JellySquid - */ - @Overwrite - public void purge() { - ++this.age; - - ObjectIterator>>> iterator = - this.ticketsByPosition.long2ObjectEntrySet().fastIterator(); - Predicate> predicate = (chunkTicket) -> chunkTicket.isExpired(this.age); - - while (iterator.hasNext()) { - Long2ObjectMap.Entry>> entry = iterator.next(); - SortedArraySet> value = entry.getValue(); - - if (value.removeIf(predicate)) { - this.distanceFromTicketTracker.updateLevel(entry.getLongKey(), getLevel(entry.getValue()), false); - } - - if (value.isEmpty()) { - iterator.remove(); - } - } - - } -} diff --git a/src/main/resources/lithium.mixins.json b/src/main/resources/lithium.mixins.json index 61eb315a0..52499ab6d 100644 --- a/src/main/resources/lithium.mixins.json +++ b/src/main/resources/lithium.mixins.json @@ -35,7 +35,6 @@ "ai.task.replace_streams.WeightedListMixin", "alloc.chunk_random.ServerWorldMixin", "alloc.chunk_random.WorldMixin", - "alloc.chunk_ticking.ChunkTicketManagerMixin", "alloc.chunk_ticking.ServerChunkManagerMixin", "alloc.composter.ComposterMixin$ComposterBlockComposterInventoryMixin", "alloc.composter.ComposterMixin$ComposterBlockDummyInventoryMixin",