Search in sources :

Example 66 with EnumHand

use of net.minecraft.util.EnumHand in project Guide-API by TeamAmeriFrance.

the class EventHandler method renderOverlay.

@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void renderOverlay(RenderGameOverlayEvent.Pre event) {
    if (event.getType() != RenderGameOverlayEvent.ElementType.CROSSHAIRS)
        return;
    RayTraceResult rayTrace = Minecraft.getMinecraft().objectMouseOver;
    if (rayTrace == null || rayTrace.typeOfHit != RayTraceResult.Type.BLOCK)
        return;
    EntityPlayer player = Minecraft.getMinecraft().player;
    World world = Minecraft.getMinecraft().world;
    ItemStack held = ItemStack.EMPTY;
    Book book = null;
    for (EnumHand hand : EnumHand.values()) {
        ItemStack heldStack = player.getHeldItem(hand);
        if (heldStack.getItem() instanceof IGuideItem) {
            held = heldStack;
            book = ((IGuideItem) heldStack.getItem()).getBook(heldStack);
            break;
        }
    }
    if (book == null)
        return;
    IBlockState state = world.getBlockState(rayTrace.getBlockPos());
    String linkedEntry = null;
    if (state.getBlock() instanceof IGuideLinked) {
        IGuideLinked linked = (IGuideLinked) state.getBlock();
        ResourceLocation entryKey = linked.getLinkedEntry(world, rayTrace.getBlockPos(), player, held);
        if (entryKey != null) {
            for (CategoryAbstract category : book.getCategoryList()) {
                if (category.entries.containsKey(entryKey)) {
                    linkedEntry = category.getEntry(entryKey).getLocalizedName();
                    break;
                }
            }
        }
    }
    if (!Strings.isNullOrEmpty(linkedEntry)) {
        FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
        ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
        int drawX = scaledResolution.getScaledWidth() / 2 + 10;
        int drawY = scaledResolution.getScaledHeight() / 2 - 8;
        Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(held, drawX, drawY);
        drawY -= 2;
        drawX += 20;
        fontRenderer.drawStringWithShadow(TextFormatting.WHITE + linkedEntry, drawX, drawY, 0);
        fontRenderer.drawStringWithShadow(TextFormatting.WHITE.toString() + TextFormatting.ITALIC.toString() + TextHelper.localize("text.linked.open"), drawX, drawY + 12, 0);
    }
    if (state.getBlock() instanceof IInfoRenderer.Block) {
        IInfoRenderer infoRenderer = ((IInfoRenderer.Block) state.getBlock()).getInfoRenderer(book, world, rayTrace.getBlockPos(), state, rayTrace, player);
        if (book == ((IInfoRenderer.Block) state.getBlock()).getBook() && infoRenderer != null)
            infoRenderer.drawInformation(book, world, rayTrace.getBlockPos(), state, rayTrace, player);
    }
    Multimap<Class<? extends Block>, IInfoRenderer> bookRenderers = GuideAPI.getInfoRenderers().get(book);
    if (bookRenderers == null)
        return;
    Collection<IInfoRenderer> renderers = bookRenderers.get(state.getBlock().getClass());
    for (IInfoRenderer renderer : renderers) renderer.drawInformation(book, world, rayTrace.getBlockPos(), state, rayTrace, player);
}
Also used : IGuideLinked(amerifrance.guideapi.api.IGuideLinked) IBlockState(net.minecraft.block.state.IBlockState) RayTraceResult(net.minecraft.util.math.RayTraceResult) World(net.minecraft.world.World) IInfoRenderer(amerifrance.guideapi.api.IInfoRenderer) ScaledResolution(net.minecraft.client.gui.ScaledResolution) CategoryAbstract(amerifrance.guideapi.api.impl.abstraction.CategoryAbstract) Book(amerifrance.guideapi.api.impl.Book) EnumHand(net.minecraft.util.EnumHand) ResourceLocation(net.minecraft.util.ResourceLocation) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Block(net.minecraft.block.Block) FontRenderer(net.minecraft.client.gui.FontRenderer) ItemStack(net.minecraft.item.ItemStack) IGuideItem(amerifrance.guideapi.api.IGuideItem) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 67 with EnumHand

use of net.minecraft.util.EnumHand in project LogisticsPipes by RS485.

the class ItemLogisticsPipe method onItemUse.

@Nonnull
@Override
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    Block block = LPBlocks.pipe;
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block worldBlock = iblockstate.getBlock();
    if (!worldBlock.isReplaceable(worldIn, pos)) {
        pos = pos.offset(facing);
    }
    ItemStack itemstack = player.getHeldItem(hand);
    if (itemstack.isEmpty()) {
        return EnumActionResult.FAIL;
    }
    if (!dummyPipe.isMultiBlock()) {
        if (player.canPlayerEdit(pos, facing, itemstack) && worldIn.mayPlace(block, pos, false, facing, null)) {
            CoreUnroutedPipe pipe = LogisticsBlockGenericPipe.createPipe(this);
            if (pipe == null) {
                LogisticsPipes.log.log(Level.WARN, "Pipe failed to create during placement at {0},{1},{2}", new Object[] { pos.getX(), pos.getY(), pos.getZ() });
                return EnumActionResult.PASS;
            }
            if (LogisticsBlockGenericPipe.placePipe(pipe, worldIn, pos, block, null)) {
                IBlockState state = worldIn.getBlockState(pos);
                if (state.getBlock() == block) {
                    // setTileEntityNBT(world, player, pos, stack);
                    block.onBlockPlacedBy(worldIn, pos, state, player, itemstack);
                    if (player instanceof EntityPlayerMP)
                        CriteriaTriggers.PLACED_BLOCK.trigger((EntityPlayerMP) player, pos, itemstack);
                    IBlockState newBlockState = worldIn.getBlockState(pos);
                    SoundType soundtype = newBlockState.getBlock().getSoundType(newBlockState, worldIn, pos, player);
                    worldIn.playSound(player, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
                    itemstack.shrink(1);
                }
            }
            return EnumActionResult.SUCCESS;
        } else {
            return EnumActionResult.FAIL;
        }
    } else {
        CoreMultiBlockPipe multiPipe = (CoreMultiBlockPipe) dummyPipe;
        boolean isFreeSpace = true;
        DoubleCoordinates placeAt = new DoubleCoordinates(pos);
        LPPositionSet<DoubleCoordinatesType<CoreMultiBlockPipe.SubBlockTypeForShare>> globalPos = new LPPositionSet<>(DoubleCoordinatesType.class);
        globalPos.add(new DoubleCoordinatesType<>(placeAt, CoreMultiBlockPipe.SubBlockTypeForShare.NON_SHARE));
        LPPositionSet<DoubleCoordinatesType<CoreMultiBlockPipe.SubBlockTypeForShare>> positions = multiPipe.getSubBlocks();
        ITubeOrientation orientation = multiPipe.getTubeOrientation(player, pos.getX(), pos.getZ());
        if (orientation == null) {
            return EnumActionResult.FAIL;
        }
        orientation.rotatePositions(positions);
        positions.stream().map(iPos -> iPos.add(placeAt)).forEach(globalPos::add);
        globalPos.addToAll(orientation.getOffset());
        placeAt.add(orientation.getOffset());
        for (DoubleCoordinatesType<CoreMultiBlockPipe.SubBlockTypeForShare> iPos : globalPos) {
            if (!player.canPlayerEdit(iPos.getBlockPos(), facing, itemstack) || !worldIn.mayPlace(block, iPos.getBlockPos(), false, facing, null)) {
                TileEntity tile = worldIn.getTileEntity(iPos.getBlockPos());
                boolean canPlace = false;
                if (tile instanceof LogisticsTileGenericSubMultiBlock) {
                    if (CoreMultiBlockPipe.canShare(((LogisticsTileGenericSubMultiBlock) tile).getSubTypes(), iPos.getType())) {
                        canPlace = true;
                    }
                }
                if (!canPlace) {
                    isFreeSpace = false;
                    break;
                }
            }
        }
        if (isFreeSpace) {
            CoreUnroutedPipe pipe = LogisticsBlockGenericPipe.createPipe(this);
            if (pipe == null) {
                LogisticsPipes.log.log(Level.WARN, "Pipe failed to create during placement at {0},{1},{2}", new Object[] { pos.getX(), pos.getY(), pos.getZ() });
                return EnumActionResult.SUCCESS;
            }
            if (LogisticsBlockGenericPipe.placePipe(pipe, worldIn, placeAt.getBlockPos(), block, orientation)) {
                IBlockState state = worldIn.getBlockState(placeAt.getBlockPos());
                if (state.getBlock() == block) {
                    // setTileEntityNBT(world, player, pos, stack);
                    block.onBlockPlacedBy(worldIn, pos, state, player, itemstack);
                    if (player instanceof EntityPlayerMP)
                        CriteriaTriggers.PLACED_BLOCK.trigger((EntityPlayerMP) player, placeAt.getBlockPos(), itemstack);
                    IBlockState newBlockState = worldIn.getBlockState(placeAt.getBlockPos());
                    SoundType soundtype = newBlockState.getBlock().getSoundType(newBlockState, worldIn, placeAt.getBlockPos(), player);
                    worldIn.playSound(player, placeAt.getBlockPos(), soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
                    itemstack.shrink(1);
                }
            }
            return EnumActionResult.SUCCESS;
        } else {
            return EnumActionResult.FAIL;
        }
    }
}
Also used : SoundType(net.minecraft.block.SoundType) DoubleCoordinatesType(network.rs485.logisticspipes.world.DoubleCoordinatesType) Getter(lombok.Getter) LogisticsPipes(logisticspipes.LogisticsPipes) EnumHand(net.minecraft.util.EnumHand) Level(org.apache.logging.log4j.Level) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) ItemStack(net.minecraft.item.ItemStack) Block(net.minecraft.block.Block) CriteriaTriggers(net.minecraft.advancements.CriteriaTriggers) Side(net.minecraftforge.fml.relauncher.Side) LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock) CoreUnroutedPipe(logisticspipes.pipes.basic.CoreUnroutedPipe) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nonnull(javax.annotation.Nonnull) SoundCategory(net.minecraft.util.SoundCategory) SoundType(net.minecraft.block.SoundType) CoreMultiBlockPipe(logisticspipes.pipes.basic.CoreMultiBlockPipe) LogisticsBlockGenericPipe(logisticspipes.pipes.basic.LogisticsBlockGenericPipe) World(net.minecraft.world.World) ITubeOrientation(logisticspipes.interfaces.ITubeOrientation) EnumFacing(net.minecraft.util.EnumFacing) BlockPos(net.minecraft.util.math.BlockPos) LPPositionSet(logisticspipes.utils.LPPositionSet) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates) IBlockState(net.minecraft.block.state.IBlockState) LPBlocks(logisticspipes.LPBlocks) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EnumActionResult(net.minecraft.util.EnumActionResult) IIconProvider(logisticspipes.renderer.IIconProvider) TileEntity(net.minecraft.tileentity.TileEntity) CoreUnroutedPipe(logisticspipes.pipes.basic.CoreUnroutedPipe) IBlockState(net.minecraft.block.state.IBlockState) LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates) ITubeOrientation(logisticspipes.interfaces.ITubeOrientation) TileEntity(net.minecraft.tileentity.TileEntity) DoubleCoordinatesType(network.rs485.logisticspipes.world.DoubleCoordinatesType) CoreMultiBlockPipe(logisticspipes.pipes.basic.CoreMultiBlockPipe) LPPositionSet(logisticspipes.utils.LPPositionSet) Block(net.minecraft.block.Block) LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) ItemStack(net.minecraft.item.ItemStack) Nonnull(javax.annotation.Nonnull)

Example 68 with EnumHand

use of net.minecraft.util.EnumHand in project BuildCraft by BuildCraft.

the class ItemSchematicSingle method onItemUseFirst.

@Override
public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) {
    if (world.isRemote) {
        return EnumActionResult.PASS;
    }
    ItemStack stack = player.getHeldItem(hand);
    if (player.isSneaking()) {
        NBTTagCompound itemData = NBTUtilBC.getItemData(StackUtil.asNonNull(stack));
        itemData.removeTag(NBT_KEY);
        if (itemData.hasNoTags()) {
            stack.setTagCompound(null);
        }
        stack.setItemDamage(DAMAGE_CLEAN);
        return EnumActionResult.SUCCESS;
    }
    int damage = stack.getItemDamage();
    if (damage != DAMAGE_USED) {
        IBlockState state = world.getBlockState(pos);
        ISchematicBlock schematicBlock = SchematicBlockManager.getSchematicBlock(new SchematicBlockContext(world, pos, pos, state, state.getBlock()));
        if (schematicBlock.isAir()) {
            return EnumActionResult.FAIL;
        }
        NBTUtilBC.getItemData(stack).setTag(NBT_KEY, SchematicBlockManager.writeToNBT(schematicBlock));
        stack.setItemDamage(DAMAGE_USED);
        return EnumActionResult.SUCCESS;
    } else {
        BlockPos placePos = pos;
        boolean replaceable = world.getBlockState(pos).getBlock().isReplaceable(world, pos);
        if (!replaceable) {
            placePos = placePos.offset(side);
        }
        if (!world.mayPlace(world.getBlockState(pos).getBlock(), placePos, false, side, null)) {
            return EnumActionResult.FAIL;
        }
        if (replaceable && !world.isAirBlock(placePos)) {
            world.setBlockToAir(placePos);
        }
        try {
            ISchematicBlock schematicBlock = getSchematic(stack);
            if (schematicBlock != null) {
                if (!schematicBlock.isBuilt(world, placePos) && schematicBlock.canBuild(world, placePos)) {
                    List<FluidStack> requiredFluids = schematicBlock.computeRequiredFluids();
                    List<ItemStack> requiredItems = schematicBlock.computeRequiredItems();
                    if (requiredFluids.isEmpty()) {
                        InventoryWrapper itemTransactor = new InventoryWrapper(player.inventory);
                        if (StackUtil.mergeSameItems(requiredItems).stream().noneMatch(s -> itemTransactor.extract(extracted -> StackUtil.canMerge(s, extracted), s.getCount(), s.getCount(), true).isEmpty())) {
                            if (schematicBlock.build(world, placePos)) {
                                StackUtil.mergeSameItems(requiredItems).forEach(s -> itemTransactor.extract(extracted -> StackUtil.canMerge(s, extracted), s.getCount(), s.getCount(), false));
                                SoundUtil.playBlockPlace(world, placePos);
                                player.swingArm(hand);
                                return EnumActionResult.SUCCESS;
                            }
                        } else {
                            player.sendStatusMessage(new TextComponentString("Not enough items. Total needed: " + StackUtil.mergeSameItems(requiredItems).stream().map(s -> s.getTextComponent().getFormattedText() + " x " + s.getCount()).collect(Collectors.joining(", "))), true);
                        }
                    } else {
                        player.sendStatusMessage(new TextComponentString("Schematic requires fluids"), true);
                    }
                }
            }
        } catch (InvalidInputDataException e) {
            player.sendStatusMessage(new TextComponentString("Invalid schematic: " + e.getMessage()), true);
            e.printStackTrace();
        }
        return EnumActionResult.FAIL;
    }
}
Also used : TIntObjectHashMap(gnu.trove.map.hash.TIntObjectHashMap) EnumHand(net.minecraft.util.EnumHand) ItemBC_Neptune(buildcraft.lib.item.ItemBC_Neptune) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ItemStack(net.minecraft.item.ItemStack) NBTUtilBC(buildcraft.lib.misc.NBTUtilBC) SchematicBlockContext(buildcraft.api.schematics.SchematicBlockContext) SchematicBlockManager(buildcraft.builders.snapshot.SchematicBlockManager) Side(net.minecraftforge.fml.relauncher.Side) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nonnull(javax.annotation.Nonnull) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) BCLog(buildcraft.api.core.BCLog) World(net.minecraft.world.World) InvalidInputDataException(buildcraft.api.core.InvalidInputDataException) EnumFacing(net.minecraft.util.EnumFacing) BlockPos(net.minecraft.util.math.BlockPos) Collectors(java.util.stream.Collectors) ActionResult(net.minecraft.util.ActionResult) TextComponentString(net.minecraft.util.text.TextComponentString) IBlockState(net.minecraft.block.state.IBlockState) List(java.util.List) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EnumActionResult(net.minecraft.util.EnumActionResult) ISchematicBlock(buildcraft.api.schematics.ISchematicBlock) StackUtil(buildcraft.lib.misc.StackUtil) FluidStack(net.minecraftforge.fluids.FluidStack) InventoryWrapper(buildcraft.lib.inventory.InventoryWrapper) SoundUtil(buildcraft.lib.misc.SoundUtil) InvalidInputDataException(buildcraft.api.core.InvalidInputDataException) IBlockState(net.minecraft.block.state.IBlockState) InventoryWrapper(buildcraft.lib.inventory.InventoryWrapper) FluidStack(net.minecraftforge.fluids.FluidStack) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) TextComponentString(net.minecraft.util.text.TextComponentString) ISchematicBlock(buildcraft.api.schematics.ISchematicBlock) SchematicBlockContext(buildcraft.api.schematics.SchematicBlockContext) BlockPos(net.minecraft.util.math.BlockPos) ItemStack(net.minecraft.item.ItemStack)

Example 69 with EnumHand

use of net.minecraft.util.EnumHand in project BaseMetals by MinecraftModDevelopmentMods.

the class ItemMMDCrackHammer method onItemUse.

@Override
public EnumActionResult onItemUse(final EntityPlayer player, final World w, final BlockPos coord, final EnumHand hand, final EnumFacing facing, final float partialX, final float partialY, final float partialZ) {
    final ItemStack item = player.getHeldItemMainhand();
    if (facing != EnumFacing.UP) {
        return EnumActionResult.PASS;
    }
    /*List<EntityItem> entities = */
    AxisAlignedBB boundingBox = new AxisAlignedBB(coord.getX(), coord.getY() + 1, coord.getZ(), coord.getX() + 1, coord.getY() + 2, coord.getZ() + 1);
    List<EntityItem> entities = w.getEntitiesWithinAABB(EntityItem.class, boundingBox).stream().filter(elem -> (elem.getItem() != null)).filter(elem -> (CrusherRecipeRegistry.getRecipeForInputItem(elem.getItem()) != null)).collect(Collectors.toList());
    if (!entities.isEmpty()) {
        ItemStack targetItem = entities.get(0).getItem();
        ICrusherRecipe recipe = CrusherRecipeRegistry.getRecipeForInputItem(targetItem);
        if (hardnessCheck(targetItem)) {
            return EnumActionResult.PASS;
        }
        maybeDoCrack(recipe, targetItem, item, entities.get(0), player, w);
        w.playSound(player, coord, SoundEvents.BLOCK_GRAVEL_BREAK, SoundCategory.BLOCKS, 0.5F, 0.5F + (itemRand.nextFloat() * 0.3F));
        return EnumActionResult.SUCCESS;
    }
    return EnumActionResult.PASS;
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) Materials(com.mcmoddev.lib.init.Materials) Item(net.minecraft.item.Item) ICrusherRecipe(com.mcmoddev.lib.registry.recipe.ICrusherRecipe) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) EnumHand(net.minecraft.util.EnumHand) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) ITooltipFlag(net.minecraft.client.util.ITooltipFlag) HashSet(java.util.HashSet) ItemStack(net.minecraft.item.ItemStack) Block(net.minecraft.block.Block) IMMDObject(com.mcmoddev.lib.material.IMMDObject) SoundCategory(net.minecraft.util.SoundCategory) Options(com.mcmoddev.lib.util.ConfigBase.Options) EntityItem(net.minecraft.entity.item.EntityItem) Entity(net.minecraft.entity.Entity) SoundEvents(net.minecraft.init.SoundEvents) MMDToolEffects(com.mcmoddev.basemetals.items.MMDToolEffects) World(net.minecraft.world.World) Set(java.util.Set) EnumFacing(net.minecraft.util.EnumFacing) BlockPos(net.minecraft.util.math.BlockPos) Collectors(java.util.stream.Collectors) Names(com.mcmoddev.lib.data.Names) IBlockState(net.minecraft.block.state.IBlockState) List(java.util.List) Material(net.minecraft.block.material.Material) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EnumActionResult(net.minecraft.util.EnumActionResult) CrusherRecipeRegistry(com.mcmoddev.lib.registry.CrusherRecipeRegistry) ItemBlock(net.minecraft.item.ItemBlock) ICrusherRecipe(com.mcmoddev.lib.registry.recipe.ICrusherRecipe) ItemStack(net.minecraft.item.ItemStack) EntityItem(net.minecraft.entity.item.EntityItem)

Example 70 with EnumHand

use of net.minecraft.util.EnumHand in project Tropicraft by Tropicraft.

the class TropicraftGuiHandler method getClientGuiElement.

@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
    if (id == 0) {
        EnumHand hand = EnumHand.values()[x];
        ItemStack held = player.getHeldItem(hand);
        if (held != null && held.getItem() instanceof ItemScubaChestplateGear) {
            return new GuiScubaHarness(new ContainerScubaHarness(player.inventory, held.getCapability(ScubaCapabilities.getGearCapability(), null), hand));
        }
    }
    return null;
}
Also used : EnumHand(net.minecraft.util.EnumHand) ItemScubaChestplateGear(net.tropicraft.core.common.item.scuba.ItemScubaChestplateGear) ItemStack(net.minecraft.item.ItemStack)

Aggregations

EnumHand (net.minecraft.util.EnumHand)117 ItemStack (net.minecraft.item.ItemStack)62 EntityPlayer (net.minecraft.entity.player.EntityPlayer)55 BlockPos (net.minecraft.util.math.BlockPos)45 EnumFacing (net.minecraft.util.EnumFacing)32 Vec3d (net.minecraft.util.math.Vec3d)24 World (net.minecraft.world.World)24 Entity (net.minecraft.entity.Entity)23 RayTraceResult (net.minecraft.util.math.RayTraceResult)21 EntityLivingBase (net.minecraft.entity.EntityLivingBase)19 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)19 Item (net.minecraft.item.Item)18 CPacketPlayerTryUseItemOnBlock (net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock)18 IBlockState (net.minecraft.block.state.IBlockState)17 TileEntity (net.minecraft.tileentity.TileEntity)16 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)15 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)14 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)13 List (java.util.List)12 Block (net.minecraft.block.Block)11