From 9adfb2514dd936cf6783c958aba0aae532f33b92 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Wed, 23 Oct 2024 21:33:54 -0700 Subject: [PATCH] Change PlatformHooks#onChunkHolderTicketChange to take ChunkHolder This makes compatibility on Paper easier to implement as NewChunkHolder is not always available. --- .../java/ca/spottedleaf/moonrise/common/PlatformHooks.java | 4 ++-- .../patches/chunk_system/scheduling/NewChunkHolder.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/ca/spottedleaf/moonrise/common/PlatformHooks.java b/src/main/java/ca/spottedleaf/moonrise/common/PlatformHooks.java index f70a4f28..525cab23 100644 --- a/src/main/java/ca/spottedleaf/moonrise/common/PlatformHooks.java +++ b/src/main/java/ca/spottedleaf/moonrise/common/PlatformHooks.java @@ -1,9 +1,9 @@ package ca.spottedleaf.moonrise.common; -import ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder; import com.mojang.datafixers.DataFixer; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.level.ChunkHolder; import net.minecraft.server.level.GenerationChunkHolder; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; @@ -44,7 +44,7 @@ public static PlatformHooks get() { public boolean allowAsyncTicketUpdates(); - public void onChunkHolderTicketChange(final ServerLevel world, final NewChunkHolder holder, final int oldLevel, final int newLevel); + public void onChunkHolderTicketChange(final ServerLevel world, final ChunkHolder holder, final int oldLevel, final int newLevel); public void chunkUnloadFromWorld(final LevelChunk chunk); diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java index 381631e4..eafa4e6d 100644 --- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java +++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java @@ -1078,7 +1078,7 @@ public void processTicketLevelUpdate(final List scheduledT } // Don't really have a choice but to place this hook here - PlatformHooks.get().onChunkHolderTicketChange(this.world, this, oldLevel, newLevel); + PlatformHooks.get().onChunkHolderTicketChange(this.world, this.vanillaChunkHolder, oldLevel, newLevel); } static final int NEIGHBOUR_RADIUS = 2;