Disabled single component panels for non-creative-mode players for BTMMoon

This commit is contained in:
malte0811 2017-11-17 14:59:02 +01:00
parent 2df8bc4f29
commit 7bf9561534

View file

@ -180,6 +180,7 @@ public class ItemPanelComponent extends Item implements INetGUIItem {
*/
@Nonnull
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (player.isCreative()&&player.isSneaking()) {
IBlockState iblockstate = worldIn.getBlockState(pos);
Block block = iblockstate.getBlock();
@ -199,6 +200,9 @@ public class ItemPanelComponent extends Item implements INetGUIItem {
} else {
return EnumActionResult.FAIL;
}
} else {
return onItemRightClick(worldIn, player, hand).getType();
}
}
private void placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {