Compare commits

...

1 commit

Author SHA1 Message Date
malte0811 7bf9561534 Disabled single component panels for non-creative-mode players for BTMMoon 2017-11-17 14:59:02 +01:00

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) {