Skip to content

Commit

Permalink
Change PlatformHooks#onChunkHolderTicketChange to take ChunkHolder
Browse files Browse the repository at this point in the history
This makes compatibility on Paper easier to implement
as NewChunkHolder is not always available.
  • Loading branch information
Spottedleaf committed Oct 24, 2024
1 parent bf2cd1c commit 9adfb25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ public void processTicketLevelUpdate(final List<ChunkProgressionTask> 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;
Expand Down

0 comments on commit 9adfb25

Please sign in to comment.