mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-12-17 23:48:00 +01:00
Fixed creative mobe players can't break clouds blocks
This commit is contained in:
parent
91109ba8bb
commit
43daaf0f6e
4 changed files with 10 additions and 6 deletions
|
@ -29,6 +29,10 @@ public interface ICloudBlock {
|
||||||
if (world.isRemote) {
|
if (world.isRemote) {
|
||||||
EntityPlayer player = UClient.instance().getPlayer();
|
EntityPlayer player = UClient.instance().getPlayer();
|
||||||
|
|
||||||
|
if (player.capabilities.isCreativeMode) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!getCanInteract(state, player)) {
|
if (!getCanInteract(state, player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,8 @@ public class UItemBlock extends UItemDecoration {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) {
|
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) {
|
||||||
if (!abilityTest.test(player)) {
|
if (!(player.capabilities.isCreativeMode || abilityTest.test(player))) {
|
||||||
return player.capabilities.isCreativeMode;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack);
|
return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack);
|
||||||
|
|
|
@ -22,8 +22,8 @@ public class UItemMultiTexture extends ItemMultiTexture {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) {
|
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) {
|
||||||
if (!abilityTest.test(player)) {
|
if (!(player.capabilities.isCreativeMode || abilityTest.test(player))) {
|
||||||
return player.capabilities.isCreativeMode;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack);
|
return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack);
|
||||||
|
|
|
@ -22,8 +22,8 @@ public class UItemSlab extends ItemSlab {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) {
|
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) {
|
||||||
if (!abilityTest.test(player)) {
|
if (!(player.capabilities.isCreativeMode || abilityTest.test(player))) {
|
||||||
return player.capabilities.isCreativeMode;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack);
|
return super.canPlaceBlockOnSide(worldIn, pos, side, player, stack);
|
||||||
|
|
Loading…
Reference in a new issue