From 43daaf0f6e123f0787c28b30f7c38d1f09a203ac Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 7 Feb 2019 15:37:24 +0200 Subject: [PATCH] Fixed creative mobe players can't break clouds blocks --- .../java/com/minelittlepony/unicopia/block/ICloudBlock.java | 4 ++++ .../java/com/minelittlepony/unicopia/item/UItemBlock.java | 4 ++-- .../com/minelittlepony/unicopia/item/UItemMultiTexture.java | 4 ++-- src/main/java/com/minelittlepony/unicopia/item/UItemSlab.java | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java index ca146dcc..d053f0a5 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/ICloudBlock.java @@ -29,6 +29,10 @@ public interface ICloudBlock { if (world.isRemote) { EntityPlayer player = UClient.instance().getPlayer(); + if (player.capabilities.isCreativeMode) { + return false; + } + if (!getCanInteract(state, player)) { return true; } diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItemBlock.java b/src/main/java/com/minelittlepony/unicopia/item/UItemBlock.java index 88c169ce..e7e8712c 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItemBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItemBlock.java @@ -21,8 +21,8 @@ public class UItemBlock extends UItemDecoration { @Override public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) { - if (!abilityTest.test(player)) { - return player.capabilities.isCreativeMode; + if (!(player.capabilities.isCreativeMode || abilityTest.test(player))) { + return false; } return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack); diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItemMultiTexture.java b/src/main/java/com/minelittlepony/unicopia/item/UItemMultiTexture.java index e3668641..1ca937db 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItemMultiTexture.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItemMultiTexture.java @@ -22,8 +22,8 @@ public class UItemMultiTexture extends ItemMultiTexture { @Override public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) { - if (!abilityTest.test(player)) { - return player.capabilities.isCreativeMode; + if (!(player.capabilities.isCreativeMode || abilityTest.test(player))) { + return false; } return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack); diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItemSlab.java b/src/main/java/com/minelittlepony/unicopia/item/UItemSlab.java index 3980de52..99a135df 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItemSlab.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItemSlab.java @@ -22,8 +22,8 @@ public class UItemSlab extends ItemSlab { @Override public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) { - if (!abilityTest.test(player)) { - return player.capabilities.isCreativeMode; + if (!(player.capabilities.isCreativeMode || abilityTest.test(player))) { + return false; } return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack);