-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38ea67a
commit 8b6a07b
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/me/senseiwells/replay/mixin/compat/carpet/ChunkMapMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package me.senseiwells.replay.mixin.compat.carpet; | ||
|
||
import carpet.patches.EntityPlayerMPFake; | ||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
import net.minecraft.server.level.ChunkMap; | ||
import net.minecraft.server.level.ServerPlayer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(ChunkMap.class) | ||
public class ChunkMapMixin { | ||
@ModifyExpressionValue( | ||
method = "isChunkTracked", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/server/network/PlayerChunkSender;isPending(J)Z" | ||
) | ||
) | ||
private boolean isChunkPending(boolean original, ServerPlayer player) { | ||
return original && !(player instanceof EntityPlayerMPFake); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters