Skip to content

Commit

Permalink
fix: send block updates when chunk post-processing
Browse files Browse the repository at this point in the history
Fixes #222
  • Loading branch information
ishland committed Sep 19, 2023
1 parent af65d62 commit 51cb30a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.ishland.c2me.notickvd.mixin;

import net.minecraft.block.Block;
import net.minecraft.world.chunk.WorldChunk;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(WorldChunk.class)
public class MixinWorldChunk {

@ModifyArg(method = "runPostProcessing", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z"))
private int notifyListenersWhenPostProcessing(int flags) {
// if (true) return flags;
flags &= ~Block.NO_REDRAW; // clear NO_REDRAW
flags |= Block.NOTIFY_LISTENERS; // set NOTIFY_LISTENERS
return flags;
}

}
3 changes: 2 additions & 1 deletion c2me-notickvd/src/main/resources/c2me-notickvd.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"MixinPlayerManager",
"MixinServerChunkManager",
"MixinThreadedAnvilChunkStorage",
"MixinWorld"
"MixinWorld",
"MixinWorldChunk"
]
}

0 comments on commit 51cb30a

Please sign in to comment.