public class BlockDispenser extends BlockContainer
Block.EnumOffsetType, Block.SoundType
Modifier and Type | Field and Description |
---|---|
static RegistryDefaulted<Item,IBehaviorDispenseItem> |
dispenseBehaviorRegistry |
static PropertyDirection |
FACING |
protected java.util.Random |
rand |
static PropertyBool |
TRIGGERED |
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
Modifier | Constructor and Description |
---|---|
protected |
BlockDispenser() |
Modifier and Type | Method and Description |
---|---|
void |
breakBlock(World worldIn,
BlockPos pos,
IBlockState state) |
protected BlockState |
createBlockState() |
TileEntity |
createNewTileEntity(World worldIn,
int meta)
Returns a new instance of a block's tile entity class.
|
protected void |
dispense(World worldIn,
BlockPos pos) |
protected IBehaviorDispenseItem |
getBehavior(ItemStack stack) |
int |
getComparatorInputOverride(World worldIn,
BlockPos pos) |
static IPosition |
getDispensePosition(IBlockSource coords)
Get the position where the dispenser at the given Coordinates should dispense to.
|
static EnumFacing |
getFacing(int meta)
Get the facing of a dispenser with the given metadata
|
int |
getMetaFromState(IBlockState state)
Convert the BlockState into the correct metadata value
|
int |
getRenderType()
The type of render function called. 3 for standard block models, 2 for TESR's, 1 for liquids, -1 is no render
|
IBlockState |
getStateForEntityRender(IBlockState state)
Possibly modify the given BlockState before rendering it on an Entity (Minecarts, Endermen, ...)
|
IBlockState |
getStateFromMeta(int meta)
Convert the given metadata into a BlockState for this Block
|
boolean |
hasComparatorInputOverride() |
boolean |
onBlockActivated(World worldIn,
BlockPos pos,
IBlockState state,
EntityPlayer playerIn,
EnumFacing side,
float hitX,
float hitY,
float hitZ) |
void |
onBlockAdded(World worldIn,
BlockPos pos,
IBlockState state) |
IBlockState |
onBlockPlaced(World worldIn,
BlockPos pos,
EnumFacing facing,
float hitX,
float hitY,
float hitZ,
int meta,
EntityLivingBase placer)
Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
IBlockstate
|
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
|
void |
onNeighborBlockChange(World worldIn,
BlockPos pos,
IBlockState state,
Block neighborBlock)
Called when a neighboring block changes.
|
int |
tickRate(World worldIn)
How many world ticks before ticking
|
void |
updateTick(World worldIn,
BlockPos pos,
IBlockState state,
java.util.Random rand) |
func_181086_a, func_181087_e, onBlockEventReceived
addCollisionBoxesToList, addDestroyEffects, addHitEffects, addLandingEffects, beginLeavesDecay, canBeReplacedByLeaves, canCollideCheck, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canPlaceBlockAt, canPlaceBlockOnSide, canPlaceTorchOnTop, canProvidePower, canRenderInLayer, canReplace, canSilkHarvest, canSilkHarvest, canSustainLeaves, canSustainPlant, captureDrops, collisionRayTrace, colorMultiplier, colorMultiplier, createStackedBlock, createTileEntity, damageDropped, disableStats, doesSideBlockRendering, dropBlockAsItem, dropBlockAsItemWithChance, dropXpOnBlockBreak, fillWithRain, func_181623_g, getActualState, getAmbientOcclusionLightValue, getBedDirection, getBedSpawnPosition, getBlockBoundsMaxX, getBlockBoundsMaxY, getBlockBoundsMaxZ, getBlockBoundsMinX, getBlockBoundsMinY, getBlockBoundsMinZ, getBlockById, getBlockColor, getBlockFromItem, getBlockFromName, getBlockHardness, getBlockLayer, getBlockState, getCollisionBoundingBox, getCreativeTabToDisplayOn, getDamageValue, getDefaultState, getDrops, getEnableStats, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getExplosionResistance, getExtendedState, getFireSpreadSpeed, getFlammability, getHarvestLevel, getHarvestTool, getIdFromBlock, getItem, getItemDropped, getLightOpacity, getLightOpacity, getLightValue, getLightValue, getLocalizedName, getMapColor, getMaterial, getMixedBrightnessForBlock, getMobilityFlag, getOffsetType, getPickBlock, getPickBlock, getPlayerRelativeBlockHardness, getRegistryName, getRenderColor, getSelectedBoundingBox, getStateById, getStateId, getStrongPower, getSubBlocks, getTickRandomly, getUnlocalizedName, getUseNeighborBrightness, getValidRotations, getWeakChanges, getWeakPower, harvestBlock, hasTileEntity, hasTileEntity, isAABBInsideMaterial, isAir, isAssociatedBlock, isBeaconBase, isBed, isBedFoot, isBlockNormalCube, isBlockSolid, isBurning, isCollidable, isEntityInsideMaterial, isEqualTo, isFertile, isFireSource, isFlammable, isFlowerPot, isFoliage, isFullBlock, isFullCube, isLadder, isLeaves, isNormalCube, isNormalCube, isOpaqueCube, isPassable, isReplaceable, isReplaceableOreGen, isSideSolid, isToolEffective, isTranslucent, isVisuallyOpaque, isWood, modifyAcceleration, onBlockClicked, onBlockDestroyedByExplosion, onBlockDestroyedByPlayer, onBlockExploded, onBlockHarvested, onEntityCollidedWithBlock, onEntityCollidedWithBlock, onFallenUpon, onLanded, onNeighborChange, onPlantGrow, quantityDropped, quantityDropped, quantityDroppedWithBonus, randomDisplayTick, randomTick, recolorBlock, registerBlocks, removedByPlayer, requiresUpdates, rotateBlock, setBedOccupied, setBlockBounds, setBlockBoundsBasedOnState, setBlockBoundsForItemRender, setBlockUnbreakable, setCreativeTab, setDefaultState, setHardness, setHarvestLevel, setHarvestLevel, setLightLevel, setLightOpacity, setRegistryName, setRegistryName, setRegistryName, setResistance, setStepSound, setTickRandomly, setUnlocalizedName, shouldCheckWeakPower, shouldSideBeRendered, spawnAsEntity, toString
public static final PropertyDirection FACING
public static final PropertyBool TRIGGERED
public static final RegistryDefaulted<Item,IBehaviorDispenseItem> dispenseBehaviorRegistry
protected java.util.Random rand
public int tickRate(World worldIn)
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
onBlockAdded
in class Block
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
onBlockActivated
in class Block
protected IBehaviorDispenseItem getBehavior(ItemStack stack)
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
onNeighborBlockChange
in class Block
public void updateTick(World worldIn, BlockPos pos, IBlockState state, java.util.Random rand)
updateTick
in class Block
public TileEntity createNewTileEntity(World worldIn, int meta)
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
onBlockPlaced
in class Block
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
onBlockPlacedBy
in class Block
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
breakBlock
in class BlockContainer
public static IPosition getDispensePosition(IBlockSource coords)
public static EnumFacing getFacing(int meta)
public boolean hasComparatorInputOverride()
hasComparatorInputOverride
in class Block
public int getComparatorInputOverride(World worldIn, BlockPos pos)
getComparatorInputOverride
in class Block
public int getRenderType()
getRenderType
in class BlockContainer
public IBlockState getStateForEntityRender(IBlockState state)
getStateForEntityRender
in class Block
public IBlockState getStateFromMeta(int meta)
getStateFromMeta
in class Block
public int getMetaFromState(IBlockState state)
getMetaFromState
in class Block
protected BlockState createBlockState()
createBlockState
in class Block