public class BlockDoublePlant extends BlockBush implements IGrowable, IShearable
Modifier and Type | Class and Description |
---|---|
static class |
BlockDoublePlant.EnumBlockHalf |
static class |
BlockDoublePlant.EnumPlantType |
Block.EnumOffsetType, Block.SoundType
Modifier and Type | Field and Description |
---|---|
static PropertyEnum<EnumFacing> |
field_181084_N |
static PropertyEnum<BlockDoublePlant.EnumBlockHalf> |
HALF |
static PropertyEnum<BlockDoublePlant.EnumPlantType> |
VARIANT |
BLOCK_STATE_IDS, blockHardness, blockMaterial, blockParticleGravity, blockRegistry, blockResistance, blockState, capturedDrops, captureDrops, delegate, enableStats, field_181083_K, fullBlock, harvesters, isBlockContainer, lightOpacity, lightValue, maxX, maxY, maxZ, minX, minY, minZ, needsRandomTick, RANDOM, SLIME_SOUND, slipperiness, soundTypeAnvil, soundTypeCloth, soundTypeGlass, soundTypeGrass, soundTypeGravel, soundTypeLadder, soundTypeMetal, soundTypePiston, soundTypeSand, soundTypeSnow, soundTypeStone, soundTypeWood, stepSound, translucent, useNeighborBrightness
Constructor and Description |
---|
BlockDoublePlant() |
Modifier and Type | Method and Description |
---|---|
boolean |
canBlockStay(World worldIn,
BlockPos pos,
IBlockState state) |
boolean |
canGrow(World worldIn,
BlockPos pos,
IBlockState state,
boolean isClient)
Whether this IGrowable can grow
|
boolean |
canPlaceBlockAt(World worldIn,
BlockPos pos) |
boolean |
canUseBonemeal(World worldIn,
java.util.Random rand,
BlockPos pos,
IBlockState state) |
protected void |
checkAndDropBlock(World worldIn,
BlockPos pos,
IBlockState state) |
int |
colorMultiplier(IBlockAccess worldIn,
BlockPos pos,
int renderPass) |
protected BlockState |
createBlockState() |
int |
damageDropped(IBlockState state)
Gets the metadata of the item this Block can drop.
|
IBlockState |
getActualState(IBlockState state,
IBlockAccess worldIn,
BlockPos pos)
Get the actual Block state of this Block at the given position.
|
int |
getDamageValue(World worldIn,
BlockPos pos) |
Item |
getItemDropped(IBlockState state,
java.util.Random rand,
int fortune)
Get the Item that this Block should drop when harvested.
|
int |
getMetaFromState(IBlockState state)
Convert the BlockState into the correct metadata value
|
Block.EnumOffsetType |
getOffsetType()
Get the OffsetType for this Block.
|
IBlockState |
getStateFromMeta(int meta)
Convert the given metadata into a BlockState for this Block
|
void |
getSubBlocks(Item itemIn,
CreativeTabs tab,
java.util.List<ItemStack> list)
returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
BlockDoublePlant.EnumPlantType |
getVariant(IBlockAccess worldIn,
BlockPos pos) |
void |
grow(World worldIn,
java.util.Random rand,
BlockPos pos,
IBlockState state) |
void |
harvestBlock(World worldIn,
EntityPlayer player,
BlockPos pos,
IBlockState state,
TileEntity te) |
boolean |
isReplaceable(World worldIn,
BlockPos pos)
Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
|
boolean |
isShearable(ItemStack item,
IBlockAccess world,
BlockPos pos)
Checks if the object is currently shearable
Example: Sheep return false when they have no wool
|
void |
onBlockHarvested(World worldIn,
BlockPos pos,
IBlockState state,
EntityPlayer player) |
void |
onBlockPlacedBy(World worldIn,
BlockPos pos,
IBlockState state,
EntityLivingBase placer,
ItemStack stack)
Called by ItemBlocks after a block is set in the world, to allow post-place logic
|
java.util.List<ItemStack> |
onSheared(ItemStack item,
IBlockAccess world,
BlockPos pos,
int fortune)
Performs the shear function on this object.
|
void |
placeAt(World worldIn,
BlockPos lowerPos,
BlockDoublePlant.EnumPlantType variant,
int flags) |
boolean |
removedByPlayer(World world,
BlockPos pos,
EntityPlayer player,
boolean willHarvest)
Called when a player removes a block.
|
void |
setBlockBoundsBasedOnState(IBlockAccess worldIn,
BlockPos pos) |
canPlaceBlockOn, getBlockLayer, getCollisionBoundingBox, getPlant, getPlantType, isFullCube, isOpaqueCube, onNeighborBlockChange, updateTick
addCollisionBoxesToList, addDestroyEffects, addHitEffects, addLandingEffects, beginLeavesDecay, breakBlock, canBeReplacedByLeaves, canCollideCheck, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canPlaceBlockOnSide, canPlaceTorchOnTop, canProvidePower, canRenderInLayer, canReplace, canSilkHarvest, canSilkHarvest, canSustainLeaves, canSustainPlant, captureDrops, collisionRayTrace, colorMultiplier, createStackedBlock, createTileEntity, disableStats, doesSideBlockRendering, dropBlockAsItem, dropBlockAsItemWithChance, dropXpOnBlockBreak, fillWithRain, func_181623_g, getAmbientOcclusionLightValue, getBedDirection, getBedSpawnPosition, getBlockBoundsMaxX, getBlockBoundsMaxY, getBlockBoundsMaxZ, getBlockBoundsMinX, getBlockBoundsMinY, getBlockBoundsMinZ, getBlockById, getBlockColor, getBlockFromItem, getBlockFromName, getBlockHardness, getBlockState, getComparatorInputOverride, getCreativeTabToDisplayOn, getDefaultState, getDrops, getEnableStats, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getExplosionResistance, getExtendedState, getFireSpreadSpeed, getFlammability, getHarvestLevel, getHarvestTool, getIdFromBlock, getItem, getLightOpacity, getLightOpacity, getLightValue, getLightValue, getLocalizedName, getMapColor, getMaterial, getMixedBrightnessForBlock, getMobilityFlag, getPickBlock, getPickBlock, getPlayerRelativeBlockHardness, getRegistryName, getRenderColor, getRenderType, getSelectedBoundingBox, getStateById, getStateForEntityRender, getStateId, getStrongPower, getTickRandomly, getUnlocalizedName, getUseNeighborBrightness, getValidRotations, getWeakChanges, getWeakPower, hasComparatorInputOverride, hasTileEntity, hasTileEntity, isAABBInsideMaterial, isAir, isAssociatedBlock, isBeaconBase, isBed, isBedFoot, isBlockNormalCube, isBlockSolid, isBurning, isCollidable, isEntityInsideMaterial, isEqualTo, isFertile, isFireSource, isFlammable, isFlowerPot, isFoliage, isFullBlock, isLadder, isLeaves, isNormalCube, isNormalCube, isPassable, isReplaceableOreGen, isSideSolid, isToolEffective, isTranslucent, isVisuallyOpaque, isWood, modifyAcceleration, onBlockActivated, onBlockAdded, onBlockClicked, onBlockDestroyedByExplosion, onBlockDestroyedByPlayer, onBlockEventReceived, onBlockExploded, onBlockPlaced, onEntityCollidedWithBlock, onEntityCollidedWithBlock, onFallenUpon, onLanded, onNeighborChange, onPlantGrow, quantityDropped, quantityDropped, quantityDroppedWithBonus, randomDisplayTick, randomTick, recolorBlock, registerBlocks, requiresUpdates, rotateBlock, setBedOccupied, setBlockBounds, setBlockBoundsForItemRender, setBlockUnbreakable, setCreativeTab, setDefaultState, setHardness, setHarvestLevel, setHarvestLevel, setLightLevel, setLightOpacity, setRegistryName, setRegistryName, setRegistryName, setResistance, setStepSound, setTickRandomly, setUnlocalizedName, shouldCheckWeakPower, shouldSideBeRendered, spawnAsEntity, tickRate, toString
public static final PropertyEnum<BlockDoublePlant.EnumPlantType> VARIANT
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> HALF
public static final PropertyEnum<EnumFacing> field_181084_N
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
setBlockBoundsBasedOnState
in class Block
public BlockDoublePlant.EnumPlantType getVariant(IBlockAccess worldIn, BlockPos pos)
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
canPlaceBlockAt
in class BlockBush
public boolean isReplaceable(World worldIn, BlockPos pos)
isReplaceable
in class Block
protected void checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state)
checkAndDropBlock
in class BlockBush
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
canBlockStay
in class BlockBush
public Item getItemDropped(IBlockState state, java.util.Random rand, int fortune)
getItemDropped
in class Block
public int damageDropped(IBlockState state)
damageDropped
in class Block
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass)
colorMultiplier
in class Block
public void placeAt(World worldIn, BlockPos lowerPos, BlockDoublePlant.EnumPlantType variant, int flags)
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
onBlockPlacedBy
in class Block
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
harvestBlock
in class Block
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
onBlockHarvested
in class Block
public void getSubBlocks(Item itemIn, CreativeTabs tab, java.util.List<ItemStack> list)
getSubBlocks
in class Block
public int getDamageValue(World worldIn, BlockPos pos)
getDamageValue
in class Block
public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient)
public boolean canUseBonemeal(World worldIn, java.util.Random rand, BlockPos pos, IBlockState state)
canUseBonemeal
in interface IGrowable
public void grow(World worldIn, java.util.Random rand, BlockPos pos, IBlockState state)
public IBlockState getStateFromMeta(int meta)
getStateFromMeta
in class Block
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
getActualState
in class Block
public int getMetaFromState(IBlockState state)
getMetaFromState
in class Block
protected BlockState createBlockState()
createBlockState
in class Block
public Block.EnumOffsetType getOffsetType()
getOffsetType
in class Block
public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
IShearable
isShearable
in interface IShearable
item
- The itemstack that is being used, Possible to be nullworld
- The current worldpos
- Block's position in world.public java.util.List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
IShearable
onSheared
in interface IShearable
item
- The itemstack that is being used, Possible to be nullworld
- The current worldpos
- If this is a block, the block's position in world.fortune
- The fortune level of the shears being usedpublic boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
Block
removedByPlayer
in class Block
world
- The current worldpos
- Block position in worldplayer
- The player damaging the block, may be nullwillHarvest
- True if Block.harvestBlock will be called after this, if the return in true.
Can be useful to delay the destruction of tile entities till after harvestBlock