Skip to content

Commit 02e6f0e

Browse files
committed
Added NoGlitchBlocks
1 parent ebbe98a commit 02e6f0e

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.lambda.mixin.world;
2+
3+
import com.lambda.client.module.modules.player.NoGlitchBlocks;
4+
import net.minecraft.block.state.IBlockState;
5+
import net.minecraft.item.ItemBlock;
6+
import net.minecraft.util.math.BlockPos;
7+
import net.minecraft.world.World;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.Redirect;
11+
12+
@Mixin(ItemBlock.class)
13+
public class MixinItemBlock {
14+
@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"))
15+
private boolean setVoid(World instance, BlockPos p_setBlockState_1_, IBlockState p_setBlockState_2_, int p_setBlockState_3_) {
16+
if (NoGlitchBlocks.INSTANCE.isEnabled()) {
17+
return true;
18+
} else {
19+
return instance.setBlockState(p_setBlockState_1_, p_setBlockState_2_, p_setBlockState_3_);
20+
}
21+
}
22+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.lambda.client.module.modules.player
2+
3+
import com.lambda.client.module.Category
4+
import com.lambda.client.module.Module
5+
6+
object NoGlitchBlocks : Module(
7+
name = "NoGlitchBlocks",
8+
description = "Syncs block interactions for strict environments",
9+
category = Category.PLAYER
10+
) {
11+
}

src/main/resources/mixins.lambda.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"world.MixinBlockSoulSand",
8181
"world.MixinBlockWeb",
8282
"world.MixinGetCollisionBB",
83+
"world.MixinItemBlock",
8384
"world.MixinWorld"
8485
]
8586
}

0 commit comments

Comments
 (0)