Skip to content

Commit d6cbd97

Browse files
committed
Fix NoGhostBlocks in singleplayer
1 parent 827ef82 commit d6cbd97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/lambda/mixin/world/MixinItemBlock.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.lambda.client.module.modules.player.NoGhostBlocks;
44
import net.minecraft.block.state.IBlockState;
5+
import net.minecraft.client.Minecraft;
56
import net.minecraft.item.ItemBlock;
67
import net.minecraft.util.math.BlockPos;
78
import net.minecraft.world.World;
@@ -11,9 +12,12 @@
1112

1213
@Mixin(ItemBlock.class)
1314
public class MixinItemBlock {
15+
16+
private final Minecraft mc = Minecraft.getMinecraft();
17+
1418
@Redirect(method = "placeBlockAt", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;I)Z"))
1519
private boolean ignoreSetBlockState(World instance, BlockPos p_setBlockState_1_, IBlockState p_setBlockState_2_, int p_setBlockState_3_) {
16-
if (NoGhostBlocks.INSTANCE.isEnabled()) {
20+
if (NoGhostBlocks.INSTANCE.isEnabled() && !mc.isSingleplayer()) {
1721
return true;
1822
} else {
1923
return instance.setBlockState(p_setBlockState_1_, p_setBlockState_2_, p_setBlockState_3_);

0 commit comments

Comments
 (0)