Skip to content

Commit

Permalink
Fix #6906
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 18, 2024
1 parent 11787d8 commit 84911a3
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import net.minecraft.world.item.context.BlockPlaceContext;

import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;

import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -22,7 +21,7 @@ public class BlockItemMixin {
@Inject(method = "place", at = @At("HEAD"), cancellable = true)
private void create$fixDeployerPlacement(BlockPlaceContext pContext, CallbackInfoReturnable<InteractionResult> cir) {
BlockState state = pContext.getLevel().getBlockState(((UseOnContextAccessor) pContext).create$getHitResult().getBlockPos());
if (state != Blocks.AIR.defaultBlockState() && pContext.getPlayer() instanceof DeployerFakePlayer) {
if (!state.canBeReplaced() && pContext.getPlayer() instanceof DeployerFakePlayer) {
cir.setReturnValue(InteractionResult.PASS);
}
}
Expand Down

0 comments on commit 84911a3

Please sign in to comment.