mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-26 15:06:42 +01:00
Merge pull request #6911 from IThundxr/mc1.20.1/deployer-fix
Fix deployers not replacing replacable blocks like water
This commit is contained in:
commit
1dc32f94e7
1 changed files with 1 additions and 2 deletions
|
@ -9,7 +9,6 @@ import net.minecraft.world.item.BlockItem;
|
||||||
|
|
||||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
|
|
||||||
import net.minecraft.world.level.block.Blocks;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
@ -22,7 +21,7 @@ public class BlockItemMixin {
|
||||||
@Inject(method = "place", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "place", at = @At("HEAD"), cancellable = true)
|
||||||
private void create$fixDeployerPlacement(BlockPlaceContext pContext, CallbackInfoReturnable<InteractionResult> cir) {
|
private void create$fixDeployerPlacement(BlockPlaceContext pContext, CallbackInfoReturnable<InteractionResult> cir) {
|
||||||
BlockState state = pContext.getLevel().getBlockState(((UseOnContextAccessor) pContext).create$getHitResult().getBlockPos());
|
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);
|
cir.setReturnValue(InteractionResult.PASS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue