diff --git a/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/ticking_chunk_alloc/ChunkHolderMixin.java b/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/ticking_chunk_alloc/ChunkHolderMixin.java deleted file mode 100644 index 2ea7c2de..00000000 --- a/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/ticking_chunk_alloc/ChunkHolderMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.embeddedt.modernfix.common.mixin.perf.ticking_chunk_alloc; - -import com.mojang.datafixers.util.Either; -import net.minecraft.server.level.ChunkHolder; -import net.minecraft.world.level.chunk.LevelChunk; -import org.embeddedt.modernfix.util.EitherUtil; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -import java.util.concurrent.CompletableFuture; - -@Mixin(value = ChunkHolder.class, priority = 500) -public abstract class ChunkHolderMixin { - @Shadow public abstract CompletableFuture> getTickingChunkFuture(); - - @Shadow public abstract CompletableFuture> getFullChunkFuture(); - - /** - * @author embeddedt - * @reason avoid Optional allocation - */ - @Overwrite - public LevelChunk getTickingChunk() { - CompletableFuture> completableFuture = this.getTickingChunkFuture(); - Either either = completableFuture.getNow(null); - return either == null ? null : EitherUtil.leftOrNull(either); - } - - /** - * @author embeddedt - * @reason avoid Optional allocation - */ - @Overwrite - public LevelChunk getFullChunk() { - CompletableFuture> completableFuture = this.getFullChunkFuture(); - Either either = completableFuture.getNow(null); - return either == null ? null : EitherUtil.leftOrNull(either); - } -}