Package api.item.items
Class PlaceAsBlockItem
java.lang.Object
net.minecraft.src.Item
api.item.items.PlaceAsBlockItem
- Direct Known Subclasses:
BedItem,BrickItem,BucketItem,ClusterBlockItem,CrudeUnfiredBrickItem,ItemBlock,ItemReed,LegacyCandleItem,LegacyGrateItem,LegacySlatsItem,LegacyWickerPaneItem,OreChunkItemGold,OreChunkItemIron,RedstoneItem,RedstoneRepeaterItem,UnfiredNetherBrickItem
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected booleanFields inherited from class net.minecraft.src.Item
appleGold, appleRed, arrow, axeDiamond, axeGold, axeIron, axeStone, axeWood, bakedPotato, BASE_CHICKEN_ITEM_FOOD_VALUE, BASE_HERBIVORE_ITEM_FOOD_VALUE, BASE_PIG_ITEM_FOOD_VALUE, bed, beefCooked, beefRaw, bFull3D, blazePowder, blazeRod, boat, bone, book, bootsChain, bootsDiamond, bootsGold, bootsIron, bootsLeather, bow, bowlEmpty, bowlSoup, bread, brewingStand, brick, bucketEmpty, bucketLava, bucketMilk, bucketWater, cake, carrot, carrotOnAStick, cauldron, chickenCooked, chickenRaw, clay, coal, comparator, compass, cookie, defaultFurnaceBurnTime, diamond, doorIron, doorWood, dyePowder, egg, emerald, emptyMap, enchantedBook, enderPearl, expBottle, eyeOfEnder, feather, fermentedSpiderEye, field_111210_e, FILTERABLE_FINE, FILTERABLE_NARROW, FILTERABLE_NO_PROPERTIES, FILTERABLE_SMALL, FILTERABLE_SOLID_BLOCK, FILTERABLE_THIN, fireballCharge, firework, fireworkCharge, fishCooked, fishingRod, fishRaw, flint, flintAndSteel, flowerPot, ghastTear, glassBottle, glowstone, goldenCarrot, goldNugget, gunpowder, hasSubtypes, helmetChain, helmetDiamond, helmetGold, helmetIron, helmetLeather, hoeDiamond, hoeGold, hoeIron, hoeStone, hoeWood, horseArmorDiamond, horseArmorGold, horseArmorIron, iconString, ingotGold, ingotIron, isInceratedInCrucible, itemFrame, itemIcon, itemID, itemRand, itemsList, leash, leather, legsChain, legsDiamond, legsGold, legsIron, legsLeather, magmaCream, map, maxStackSize, melon, melonSeeds, minecartCrate, minecartEmpty, minecartHopper, minecartPowered, minecartTnt, modID, modIDSetter, monsterPlacer, nameTag, netherQuartz, netherrackBrick, netherStalkSeeds, netherStar, painting, paper, pickaxeDiamond, pickaxeGold, pickaxeIron, pickaxeStone, pickaxeWood, plateChain, plateDiamond, plateGold, plateIron, plateLeather, pocketSundial, poisonousPotato, porkCooked, porkRaw, potato, potion, pumpkinPie, pumpkinSeeds, record11, record13, recordBlocks, recordCat, recordChirp, recordFar, recordMall, recordMellohi, recordStal, recordStrad, recordWait, recordWard, redstone, redstoneRepeater, reed, rottenFlesh, saddle, seeds, shears, shovelDiamond, shovelGold, shovelIron, shovelStone, shovelWood, sign, silk, skull, slimeBall, snowball, speckledMelon, spiderEye, stick, sugar, suppressConflictWarnings, swordDiamond, swordGold, swordIron, swordStone, swordWood, wheat, writableBook, writtenBook -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPlaceAsBlockItem(int iItemID) This constructor should only be called by ItemBlock child classPlaceAsBlockItem(int iItemID, int iBlockID) PlaceAsBlockItem(int iItemID, int iBlockID, int iBlockMetadata) PlaceAsBlockItem(int iItemID, int iBlockID, int iBlockMetadata, String sItemName) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanItemBeUsedByPlayer(World world, int i, int j, int k, int iFacing, EntityPlayer player, ItemStack stack) Method which replaces canPlaceItemBlockOnSide() in ItemBlock.booleancanPlaceItemBlockOnSide(World world, int i, int j, int k, int iFacing, EntityPlayer player, ItemStack stack) intintgetBlockIDToPlace(int iItemDamage, int iFacing, float fClickX, float fClickY, float fClickZ) intgetBlockIDToPlace(World world, int itemDamage, int facing, float clickX, float clickY, float clickZ) intgetMetadata(int iItemDamage) Returns the metadata of the block which this Item (ItemBlock) can placeintgetTargetFacingPlacedByBlockDispenser(int iDispenserFacing) protected booleanisTargetFreeOfObstructingEntities(World world, int i, int j, int k) booleanonItemUse(ItemStack itemStack, EntityPlayer player, World world, int i, int j, int k, int iFacing, float fClickX, float fClickY, float fClickZ) Callback for item usage.booleanonItemUsedByBlockDispenser(ItemStack stack, World world, int i, int j, int k, int iFacing) This method should return true if the item is successfully placed (in which case the BD will consume the corresponding item in its inventory), false otherwise.protected voidplayPlaceSound(World world, int i, int j, int k, Block block) setAssociatedBlockID(int iBlockID) Methods inherited from class net.minecraft.src.Item
addInformation, canHarvestBlock, canItemEditBlocks, createItemAsEntityInWorld, doesConsumeContainerItemWhenCrafted, doesContainerItemLeaveCraftingGrid, doZombiesConsume, getAnimationIcon, getBuoyancy, getCampfireBurnTime, getCanBeFedDirectlyIntoBrickOven, getCanBeFedDirectlyIntoCampfire, getCanItemBeSetOnFireOnUse, getCanItemStartFireOnUse, getChickenFoodValue, getColorFromItemStack, getContainerItem, getCreativeTab, getCustomItemEntity, getExhaustionOnUsedToHarvestBlock, getFurnaceBurnTime, getHasSubtypes, getHerbivoreFoodValue, getHopperFilterIcon, getIconFromDamage, getIconFromDamageForRenderPass, getIconIndex, getIconString, getInfernalMaxEnchantmentCost, getInfernalMaxNumEnchants, getIsRepairable, getItemAttributeModifiers, getItemDisplayName, getItemEnchantability, getItemRightClickCooldown, getItemStackDisplayName, getItemStackLimit, getItemUseAction, getItemUseWarmupDuration, getMaxDamage, getMaxItemUseDuration, getModId, getMovingObjectPositionFromPlayer, getPigFoodValue, getPotionEffect, getRarity, getShareTag, getSpriteNumber, getStatName, getStrVsBlock, getSubItems, getUnlocalizedName, getUnlocalizedName, getUnlocalizedNameInefficiently, getWolfHealAmount, hasContainerItem, hasCustomItemEntity, hasEffect, hideFromEMI, hitEntity, ignoreDamageWhenComparingDuringUse, initializeStackOnGiveCommand, isConsumedInCrafting, isDamageable, isDamagedInCrafting, isEfficientVsBlock, isEnchantmentApplicable, isFull3D, isIncineratedInCrucible, isItemTool, isMap, isMultiUsePerClick, isPotionIngredient, isWolfFood, itemInteractionForEntity, onBlockDestroyed, onBrokenInCrafting, onCreated, onDamagedInCrafting, onEaten, onItemRightClick, onPlayerStoppedUsing, onUpdate, onUsedInCrafting, onUsedInCrafting, registerIcons, requiresMultipleRenderPasses, setAllAxesToBeEffectiveVsBlock, setAllPicksToBeEffectiveVsBlock, setAllShovelsToBeEffectiveVsBlock, setAsBasicChickenFood, setAsBasicHerbivoreFood, setAsBasicPigFood, setBuoyancy, setBuoyant, setChickenFoodValue, setContainerItem, setCreativeTab, setCustomItemEntity, setFull3D, setfurnaceburntime, setfurnaceburntime, setHasSubtypes, setHerbivoreFoodValue, setIncineratedInCrucible, setInfernalMaxEnchantmentCost, setInfernalMaxNumEnchants, setItemRightClickCooldown, setMaxDamage, setMaxStackSize, setModID, setNeutralBuoyant, setNonBuoyant, setNotIncineratedInCrucible, setPigFoodValue, setPotionEffect, setTextureName, setUnlocalizedName, shouldApplyAttributesWhenHeld, shouldApplyAttributesWhenWorn, shouldRotateAroundWhenRendering, updateUsingItem
-
Field Details
-
blockID
protected int blockID -
blockMetadata
protected int blockMetadata -
requireNoEntitiesInTargetBlock
protected boolean requireNoEntitiesInTargetBlock
-
-
Constructor Details
-
PlaceAsBlockItem
public PlaceAsBlockItem(int iItemID, int iBlockID) -
PlaceAsBlockItem
public PlaceAsBlockItem(int iItemID, int iBlockID, int iBlockMetadata) -
PlaceAsBlockItem
-
PlaceAsBlockItem
protected PlaceAsBlockItem(int iItemID) This constructor should only be called by ItemBlock child class
-
-
Method Details
-
onItemUse
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int i, int j, int k, int iFacing, float fClickX, float fClickY, float fClickZ) Description copied from class:ItemCallback for item usage. If the item does something special on right clicking, he will have one of those. Return True if something happen and false if it don't. This is for ITEMS, not BLOCKS -
getMetadata
public int getMetadata(int iItemDamage) Description copied from class:ItemReturns the metadata of the block which this Item (ItemBlock) can place- Overrides:
getMetadatain classItem
-
canItemBeUsedByPlayer
public boolean canItemBeUsedByPlayer(World world, int i, int j, int k, int iFacing, EntityPlayer player, ItemStack stack) Description copied from class:ItemMethod which replaces canPlaceItemBlockOnSide() in ItemBlock. Allows the client to prevent item usage before it is relayed to the server by returning false. Only called on client.- Overrides:
canItemBeUsedByPlayerin classItem
-
onItemUsedByBlockDispenser
public boolean onItemUsedByBlockDispenser(ItemStack stack, World world, int i, int j, int k, int iFacing) Description copied from class:ItemThis method should return true if the item is successfully placed (in which case the BD will consume the corresponding item in its inventory), false otherwise. Co-ordinates specify the BD position.- Overrides:
onItemUsedByBlockDispenserin classItem
-
getBlockID
public int getBlockID() -
canPlaceItemBlockOnSide
public boolean canPlaceItemBlockOnSide(World world, int i, int j, int k, int iFacing, EntityPlayer player, ItemStack stack) -
setAssociatedBlockID
-
getBlockIDToPlace
public int getBlockIDToPlace(World world, int itemDamage, int facing, float clickX, float clickY, float clickZ) -
getBlockIDToPlace
public int getBlockIDToPlace(int iItemDamage, int iFacing, float fClickX, float fClickY, float fClickZ) -
isTargetFreeOfObstructingEntities
-
playPlaceSound
-
getTargetFacingPlacedByBlockDispenser
public int getTargetFacingPlacedByBlockDispenser(int iDispenserFacing)
-