generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
8 changed files
with
59 additions
and
63 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -27,3 +27,7 @@ bin/ | |
# fabric | ||
|
||
run/ | ||
|
||
# log | ||
|
||
logs/ |
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
31 changes: 0 additions & 31 deletions
31
src/main/java/io/github/plusls/gravestone/mixin/ChunkDeltaRecordMixin.java
This file was deleted.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
src/main/java/io/github/plusls/gravestone/mixin/MixinChunkDeltaUpdateS2CPacket.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,32 @@ | ||
package io.github.plusls.gravestone.mixin; | ||
|
||
import io.github.plusls.gravestone.GravestoneMod; | ||
import io.github.plusls.gravestone.block.FakeBlock; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.network.Packet; | ||
import net.minecraft.network.listener.ClientPlayPacketListener; | ||
import net.minecraft.network.packet.s2c.play.ChunkDeltaUpdateS2CPacket; | ||
import net.minecraft.world.chunk.ChunkSection; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ChunkDeltaUpdateS2CPacket.class) | ||
public abstract class MixinChunkDeltaUpdateS2CPacket implements Packet<ClientPlayPacketListener> { | ||
|
||
// hook BlockState packet | ||
@Redirect(method = "<init>(Lnet/minecraft/util/math/ChunkSectionPos;Lit/unimi/dsi/fastutil/shorts/ShortSet;Lnet/minecraft/world/chunk/ChunkSection;Z)V", | ||
at = @At(value = "INVOKE", | ||
target = "Lnet/minecraft/world/chunk/ChunkSection;getBlockState(III)Lnet/minecraft/block/BlockState;", | ||
ordinal = 0)) | ||
private BlockState redirectGetBlockState(ChunkSection section, int x, int y, int z) { | ||
BlockState blockState = section.getBlockState(x, y, z); | ||
Block block = blockState.getBlock(); | ||
if (block instanceof FakeBlock) { | ||
GravestoneMod.LOGGER.info("ChunkDeltaUpdateS2CPacket hook BlockState packet"); | ||
blockState = ((FakeBlock) block).getClientBlockState(blockState); | ||
} | ||
return blockState; | ||
} | ||
} |
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
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
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