public class Block extends IForgeRegistryEntry.Impl<Block>
Modifier and Type | Class and Description |
---|---|
static class |
Block.EnumOffsetType |
IForgeRegistryEntry.Impl<T extends IForgeRegistryEntry<T>>
Modifier and Type | Field and Description |
---|---|
static ObjectIntIdentityMap<IBlockState> |
BLOCK_STATE_IDS
Deprecated.
|
protected float |
blockHardness |
protected MapColor |
blockMapColor |
protected Material |
blockMaterial |
float |
blockParticleGravity |
protected float |
blockResistance |
protected SoundType |
blockSoundType |
protected BlockStateContainer |
blockState |
protected static java.lang.ThreadLocal<java.util.List<ItemStack>> |
capturedDrops |
protected static java.lang.ThreadLocal<java.lang.Boolean> |
captureDrops |
protected boolean |
enableStats |
static AxisAlignedBB |
FULL_BLOCK_AABB |
protected boolean |
fullBlock |
protected java.lang.ThreadLocal<EntityPlayer> |
harvesters |
protected boolean |
isBlockContainer |
protected int |
lightOpacity |
protected int |
lightValue |
protected boolean |
needsRandomTick |
static AxisAlignedBB |
NULL_AABB |
protected static java.util.Random |
RANDOM |
static RegistryNamespacedDefaultedByKey<ResourceLocation,Block> |
REGISTRY |
float |
slipperiness |
protected boolean |
translucent |
protected boolean |
useNeighborBrightness |
delegate
Constructor and Description |
---|
Block(Material materialIn) |
Block(Material blockMaterialIn,
MapColor blockMapColorIn) |
Modifier and Type | Method and Description |
---|---|
protected static void |
addCollisionBoxToList(BlockPos pos,
AxisAlignedBB entityBox,
java.util.List<AxisAlignedBB> collidingBoxes,
AxisAlignedBB blockBox) |
void |
addCollisionBoxToList(IBlockState state,
World worldIn,
BlockPos pos,
AxisAlignedBB entityBox,
java.util.List<AxisAlignedBB> collidingBoxes,
Entity entityIn,
boolean p_185477_7_)
Deprecated.
|
boolean |
addDestroyEffects(World world,
BlockPos pos,
ParticleManager manager)
Spawn particles for when the block is destroyed.
|
boolean |
addHitEffects(IBlockState state,
World worldObj,
RayTraceResult target,
ParticleManager manager)
Spawn a digging particle effect in the world, this is a wrapper
around EffectRenderer.addBlockHitEffects to allow the block more
control over the particles.
|
void |
addInformation(ItemStack stack,
EntityPlayer player,
java.util.List<java.lang.String> tooltip,
boolean advanced) |
boolean |
addLandingEffects(IBlockState state,
WorldServer worldObj,
BlockPos blockPosition,
IBlockState iblockstate,
EntityLivingBase entity,
int numberOfParticles)
Allows a block to override the standard EntityLivingBase.updateFallState
particles, this is a server side method that spawns particles with
WorldServer.spawnParticle
|
void |
beginLeavesDecay(IBlockState state,
World world,
BlockPos pos)
Called when a leaf should start its decay process.
|
void |
breakBlock(World worldIn,
BlockPos pos,
IBlockState state) |
boolean |
canBeConnectedTo(IBlockAccess world,
BlockPos pos,
EnumFacing facing)
Determines if another block can connect to this block
|
boolean |
canBeReplacedByLeaves(IBlockState state,
IBlockAccess world,
BlockPos pos)
Used during tree growth to determine if newly generated leaves can replace this block.
|
boolean |
canCollideCheck(IBlockState state,
boolean hitIfLiquid) |
boolean |
canConnectRedstone(IBlockState state,
IBlockAccess world,
BlockPos pos,
EnumFacing side)
Determine if this block can make a redstone connection on the side provided,
Useful to control which sides are inputs and outputs for redstone wires.
|
boolean |
canCreatureSpawn(IBlockState state,
IBlockAccess world,
BlockPos pos,
EntityLiving.SpawnPlacementType type)
Determines if a specified mob type can spawn on this block, returning false will
prevent any mob from spawning on the block.
|
boolean |
canDropFromExplosion(Explosion explosionIn) |
boolean |
canEntityDestroy(IBlockState state,
IBlockAccess world,
BlockPos pos,
Entity entity)
Determines if this block is can be destroyed by the specified entities normal behavior.
|
boolean |
canEntitySpawn(IBlockState state,
Entity entityIn)
Deprecated.
|
boolean |
canHarvestBlock(IBlockAccess world,
BlockPos pos,
EntityPlayer player)
Determines if the player can harvest this block, obtaining it's drops when the block is destroyed.
|
boolean |
canPlaceBlockAt(World worldIn,
BlockPos pos) |
boolean |
canPlaceBlockOnSide(World worldIn,
BlockPos pos,
EnumFacing side) |
boolean |
canPlaceTorchOnTop(IBlockState state,
IBlockAccess world,
BlockPos pos)
Determines if a torch can be placed on the top surface of this block.
|
boolean |
canProvidePower(IBlockState state)
Deprecated.
|
boolean |
canRenderInLayer(IBlockState state,
BlockRenderLayer layer)
Queries if this block should render in a given layer.
|
protected boolean |
canSilkHarvest()
Deprecated.
|
boolean |
canSilkHarvest(World world,
BlockPos pos,
IBlockState state,
EntityPlayer player)
Return true from this function if the player with silk touch can harvest this block directly, and not it's normal drops.
|
boolean |
canSpawnInBlock() |
boolean |
canSustainLeaves(IBlockState state,
IBlockAccess world,
BlockPos pos)
Determines if this block can prevent leaves connected to it from decaying.
|
boolean |
canSustainPlant(IBlockState state,
IBlockAccess world,
BlockPos pos,
EnumFacing direction,
IPlantable plantable)
Determines if this block can support the passed in plant, allowing it to be planted and grow.
|
protected java.util.List<ItemStack> |
captureDrops(boolean start) |
boolean |
causesSuffocation(IBlockState state)
Deprecated.
|
RayTraceResult |
collisionRayTrace(IBlockState blockState,
World worldIn,
BlockPos pos,
Vec3d start,
Vec3d end)
Deprecated.
|
protected BlockStateContainer |
createBlockState() |
TileEntity |
createTileEntity(World world,
IBlockState state)
Called throughout the code as a replacement for ITileEntityProvider.createNewTileEntity
Return the same thing you would from that function.
|
int |
damageDropped(IBlockState state) |
protected Block |
disableStats() |
boolean |
doesSideBlockRendering(IBlockState state,
IBlockAccess world,
BlockPos pos,
EnumFacing face)
Check if the face of a block should block rendering.
|
void |
dropBlockAsItem(World worldIn,
BlockPos pos,
IBlockState state,
int fortune) |
void |
dropBlockAsItemWithChance(World worldIn,
BlockPos pos,
IBlockState state,
float chance,
int fortune) |
void |
dropXpOnBlockBreak(World worldIn,
BlockPos pos,
int amount) |
boolean |
eventReceived(IBlockState state,
World worldIn,
BlockPos pos,
int id,
int param)
Deprecated.
|
void |
fillWithRain(World worldIn,
BlockPos pos) |
IBlockState |
getActualState(IBlockState state,
IBlockAccess worldIn,
BlockPos pos)
Deprecated.
|
PathNodeType |
getAiPathNodeType(IBlockState state,
IBlockAccess world,
BlockPos pos)
Get the
PathNodeType for this block. |
float |
getAmbientOcclusionLightValue(IBlockState state)
Deprecated.
|
float[] |
getBeaconColorMultiplier(IBlockState state,
World world,
BlockPos pos,
BlockPos beaconPos) |
EnumFacing |
getBedDirection(IBlockState state,
IBlockAccess world,
BlockPos pos)
Returns the direction of the block.
|
BlockPos |
getBedSpawnPosition(IBlockState state,
IBlockAccess world,
BlockPos pos,
EntityPlayer player)
Returns the position that the player is moved to upon
waking up, or respawning at the bed.
|
static Block |
getBlockById(int id) |
static Block |
getBlockFromItem(Item itemIn) |
static Block |
getBlockFromName(java.lang.String name) |
float |
getBlockHardness(IBlockState blockState,
World worldIn,
BlockPos pos)
Deprecated.
|
BlockRenderLayer |
getBlockLayer() |
BlockStateContainer |
getBlockState() |
AxisAlignedBB |
getBoundingBox(IBlockState state,
IBlockAccess source,
BlockPos pos)
Deprecated.
|
AxisAlignedBB |
getCollisionBoundingBox(IBlockState blockState,
IBlockAccess worldIn,
BlockPos pos)
Deprecated.
|
int |
getComparatorInputOverride(IBlockState blockState,
World worldIn,
BlockPos pos)
Deprecated.
|
CreativeTabs |
getCreativeTabToDisplayOn() |
IBlockState |
getDefaultState() |
java.util.List<ItemStack> |
getDrops(IBlockAccess world,
BlockPos pos,
IBlockState state,
int fortune)
This returns a complete list of items dropped from this block.
|
boolean |
getEnableStats() |
float |
getEnchantPowerBonus(World world,
BlockPos pos)
Determines the amount of enchanting power this block can provide to an enchanting table.
|
int |
getExpDrop(IBlockState state,
IBlockAccess world,
BlockPos pos,
int fortune)
Gathers how much experience this block drops when broken.
|
float |
getExplosionResistance(Entity exploder) |
float |
getExplosionResistance(World world,
BlockPos pos,
Entity exploder,
Explosion explosion)
Location sensitive version of getExplosionRestance
|
IBlockState |
getExtendedState(IBlockState state,
IBlockAccess world,
BlockPos pos)
Can return IExtendedBlockState
|
int |
getFireSpreadSpeed(IBlockAccess world,
BlockPos pos,
EnumFacing face)
Called when fire is updating on a neighbor block.
|
int |
getFlammability(IBlockAccess world,
BlockPos pos,
EnumFacing face)
Chance that fire will spread and consume this block.
300 being a 100% chance, 0, being a 0% chance.
|
int |
getHarvestLevel(IBlockState state)
Queries the harvest level of this item stack for the specified tool class,
Returns -1 if this tool is not of the specified type
|
java.lang.String |
getHarvestTool(IBlockState state)
Queries the class of tool required to harvest this block, if null is returned
we assume that anything can harvest this block.
|
static int |
getIdFromBlock(Block blockIn) |
ItemStack |
getItem(World worldIn,
BlockPos pos,
IBlockState state)
Deprecated.
|
Item |
getItemDropped(IBlockState state,
java.util.Random rand,
int fortune) |
int |
getLightOpacity(IBlockState state)
Deprecated.
|
int |
getLightOpacity(IBlockState state,
IBlockAccess world,
BlockPos pos)
Location aware and overrideable version of the lightOpacity array,
return the number to subtract from the light value when it passes through this block.
|
int |
getLightValue(IBlockState state)
Deprecated.
|
int |
getLightValue(IBlockState state,
IBlockAccess world,
BlockPos pos)
Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15
|
java.lang.String |
getLocalizedName() |
MapColor |
getMapColor(IBlockState state)
Deprecated.
|
Material |
getMaterial(IBlockState state)
Deprecated.
|
int |
getMetaFromState(IBlockState state) |
EnumPushReaction |
getMobilityFlag(IBlockState state)
Deprecated.
|
Vec3d |
getOffset(IBlockState state,
IBlockAccess worldIn,
BlockPos pos)
Deprecated.
|
Block.EnumOffsetType |
getOffsetType() |
int |
getPackedLightmapCoords(IBlockState state,
IBlockAccess source,
BlockPos pos)
Deprecated.
|
ItemStack |
getPickBlock(IBlockState state,
RayTraceResult target,
World world,
BlockPos pos,
EntityPlayer player)
Called when a user uses the creative pick block button on this block
|
float |
getPlayerRelativeBlockHardness(IBlockState state,
EntityPlayer player,
World worldIn,
BlockPos pos)
Deprecated.
|
EnumBlockRenderType |
getRenderType(IBlockState state)
Deprecated.
|
AxisAlignedBB |
getSelectedBoundingBox(IBlockState state,
World worldIn,
BlockPos pos)
Deprecated.
|
protected ItemStack |
getSilkTouchDrop(IBlockState state) |
SoundType |
getSoundType()
Deprecated.
|
SoundType |
getSoundType(IBlockState state,
World world,
BlockPos pos,
Entity entity)
Sensitive version of getSoundType
|
static IBlockState |
getStateById(int id) |
IBlockState |
getStateForPlacement(World worldIn,
BlockPos pos,
EnumFacing facing,
float hitX,
float hitY,
float hitZ,
int meta,
EntityLivingBase placer)
Deprecated.
|
IBlockState |
getStateForPlacement(World world,
BlockPos pos,
EnumFacing facing,
float hitX,
float hitY,
float hitZ,
int meta,
EntityLivingBase placer,
EnumHand hand)
Gets the
IBlockState to place |
IBlockState |
getStateFromMeta(int meta)
Deprecated.
|
static int |
getStateId(IBlockState state) |
int |
getStrongPower(IBlockState blockState,
IBlockAccess blockAccess,
BlockPos pos,
EnumFacing side)
Deprecated.
|
void |
getSubBlocks(Item itemIn,
CreativeTabs tab,
NonNullList<ItemStack> list) |
boolean |
getTickRandomly() |
java.lang.String |
getUnlocalizedName() |
boolean |
getUseNeighborBrightness(IBlockState state)
Deprecated.
|
EnumFacing[] |
getValidRotations(World world,
BlockPos pos)
Get the rotations that can apply to the block at the specified coordinates.
|
boolean |
getWeakChanges(IBlockAccess world,
BlockPos pos)
If this block should be notified of weak changes.
|
int |
getWeakPower(IBlockState blockState,
IBlockAccess blockAccess,
BlockPos pos,
EnumFacing side)
Deprecated.
|
void |
harvestBlock(World worldIn,
EntityPlayer player,
BlockPos pos,
IBlockState state,
TileEntity te,
ItemStack stack) |
boolean |
hasComparatorInputOverride(IBlockState state)
Deprecated.
|
boolean |
hasCustomBreakingProgress(IBlockState state)
Deprecated.
|
boolean |
hasTileEntity()
Deprecated.
|
boolean |
hasTileEntity(IBlockState state)
Called throughout the code as a replacement for block instanceof BlockContainer
Moving this to the Block base class allows for mods that wish to extend vanilla
blocks, and also want to have a tile entity on that block, may.
|
java.lang.Boolean |
isAABBInsideMaterial(World world,
BlockPos pos,
AxisAlignedBB boundingBox,
Material materialIn)
Called when boats or fishing hooks are inside the block to check if they are inside
the material requested.
|
boolean |
isAir(IBlockState state,
IBlockAccess world,
BlockPos pos)
Determines this block should be treated as an air block
by the rest of the code.
|
boolean |
isAssociatedBlock(Block other) |
boolean |
isBeaconBase(IBlockAccess worldObj,
BlockPos pos,
BlockPos beacon)
Determines if this block can be used as the base of a beacon.
|
boolean |
isBed(IBlockState state,
IBlockAccess world,
BlockPos pos,
Entity player)
Determines if this block is classified as a Bed, Allowing
players to sleep in it, though the block has to specifically
perform the sleeping functionality in it's activated event.
|
boolean |
isBedFoot(IBlockAccess world,
BlockPos pos)
Determines if the current block is the foot half of the bed.
|
boolean |
isBlockNormalCube(IBlockState state)
Deprecated.
|
boolean |
isBlockSolid(IBlockAccess worldIn,
BlockPos pos,
EnumFacing side) |
boolean |
isBurning(IBlockAccess world,
BlockPos pos)
Determines if this block should set fire and deal fire damage
to entities coming into contact with it.
|
boolean |
isCollidable() |
java.lang.Boolean |
isEntityInsideMaterial(IBlockAccess world,
BlockPos blockpos,
IBlockState iblockstate,
Entity entity,
double yToTest,
Material materialIn,
boolean testingHead)
Called when the entity is inside this block, may be used to determined if the entity can breathing,
display material overlays, or if the entity can swim inside a block.
|
static boolean |
isEqualTo(Block blockIn,
Block other) |
boolean |
isFertile(World world,
BlockPos pos)
Checks if this soil is fertile, typically this means that growth rates
of plants on this soil will be slightly sped up.
|
boolean |
isFireSource(World world,
BlockPos pos,
EnumFacing side)
Currently only called by fire when it is on top of this block.
|
boolean |
isFlammable(IBlockAccess world,
BlockPos pos,
EnumFacing face)
Called when fire is updating, checks if a block face can catch fire.
|
boolean |
isFoliage(IBlockAccess world,
BlockPos pos)
Used by getTopSolidOrLiquidBlock while placing biome decorations, villages, etc
Also used to determine if the player can spawn on this block.
|
boolean |
isFullBlock(IBlockState state)
Deprecated.
|
boolean |
isFullCube(IBlockState state)
Deprecated.
|
boolean |
isFullyOpaque(IBlockState state)
Deprecated.
|
boolean |
isLadder(IBlockState state,
IBlockAccess world,
BlockPos pos,
EntityLivingBase entity)
Checks if a player or entity can use this block to 'climb' like a ladder.
|
boolean |
isLeaves(IBlockState state,
IBlockAccess world,
BlockPos pos)
Determines if this block is considered a leaf block, used to apply the leaf decay and generation system.
|
boolean |
isNormalCube(IBlockState state)
Deprecated.
|
boolean |
isNormalCube(IBlockState state,
IBlockAccess world,
BlockPos pos)
Return true if the block is a normal, solid cube.
|
boolean |
isOpaqueCube(IBlockState state)
Deprecated.
|
boolean |
isPassable(IBlockAccess worldIn,
BlockPos pos) |
boolean |
isReplaceable(IBlockAccess worldIn,
BlockPos pos) |
boolean |
isReplaceableOreGen(IBlockState state,
IBlockAccess world,
BlockPos pos,
com.google.common.base.Predicate<IBlockState> target)
Determines if the current block is replaceable by Ore veins during world generation.
|
boolean |
isSideSolid(IBlockState base_state,
IBlockAccess world,
BlockPos pos,
EnumFacing side)
Checks if the block is a solid face on the given side, used by placement logic.
|
boolean |
isToolEffective(java.lang.String type,
IBlockState state)
Checks if the specified tool type is efficient on this block,
meaning that it digs at full speed.
|
boolean |
isTranslucent(IBlockState state)
Deprecated.
|
boolean |
isWood(IBlockAccess world,
BlockPos pos) |
Vec3d |
modifyAcceleration(World worldIn,
BlockPos pos,
Entity entityIn,
Vec3d motion) |
void |
neighborChanged(IBlockState state,
World worldIn,
BlockPos pos,
Block blockIn,
BlockPos fromPos)
Deprecated.
|
void |
observedNeighborChange(IBlockState observerState,
World world,
BlockPos observerPos,
Block changedBlock,
BlockPos changedBlockPos)
Called on an Observer block whenever an update for an Observer is received.
|
boolean |
onBlockActivated(World worldIn,
BlockPos pos,
IBlockState state,
EntityPlayer playerIn,
EnumHand hand,
EnumFacing facing,
float hitX,
float hitY,
float hitZ) |
void |
onBlockAdded(World worldIn,
BlockPos pos,
IBlockState state) |
void |
onBlockClicked(World worldIn,
BlockPos pos,
EntityPlayer playerIn) |
void |
onBlockDestroyedByExplosion(World worldIn,
BlockPos pos,
Explosion explosionIn) |
void |
onBlockDestroyedByPlayer(World worldIn,
BlockPos pos,
IBlockState state) |
void |
onBlockExploded(World world,
BlockPos pos,
Explosion explosion)
Called when the block is destroyed by an explosion.
|
void |
onBlockHarvested(World worldIn,
BlockPos pos,
IBlockState state,
EntityPlayer player) |
void |
onBlockPlacedBy(World worldIn,
BlockPos pos,
IBlockState state,
EntityLivingBase placer,
ItemStack stack) |
void |
onEntityCollidedWithBlock(World worldIn,
BlockPos pos,
IBlockState state,
Entity entityIn) |
void |
onEntityWalk(World worldIn,
BlockPos pos,
Entity entityIn) |
void |
onFallenUpon(World worldIn,
BlockPos pos,
Entity entityIn,
float fallDistance) |
void |
onLanded(World worldIn,
Entity entityIn) |
void |
onNeighborChange(IBlockAccess world,
BlockPos pos,
BlockPos neighbor)
Called when a tile entity on a side of this block changes is created or is destroyed.
|
void |
onPlantGrow(IBlockState state,
World world,
BlockPos pos,
BlockPos source)
Called when a plant grows on this block, only implemented for saplings using the WorldGen*Trees classes right now.
|
int |
quantityDropped(IBlockState state,
int fortune,
java.util.Random random)
State and fortune sensitive version, this replaces the old (int meta, Random rand)
version in 1.1.
|
int |
quantityDropped(java.util.Random random) |
int |
quantityDroppedWithBonus(int fortune,
java.util.Random random) |
void |
randomDisplayTick(IBlockState stateIn,
World worldIn,
BlockPos pos,
java.util.Random rand) |
void |
randomTick(World worldIn,
BlockPos pos,
IBlockState state,
java.util.Random random) |
protected RayTraceResult |
rayTrace(BlockPos pos,
Vec3d start,
Vec3d end,
AxisAlignedBB boundingBox) |
boolean |
recolorBlock(World world,
BlockPos pos,
EnumFacing side,
EnumDyeColor color)
Common way to recolor a block with an external tool
|
static void |
registerBlocks() |
boolean |
removedByPlayer(IBlockState state,
World world,
BlockPos pos,
EntityPlayer player,
boolean willHarvest)
Called when a player removes a block.
|
boolean |
requiresUpdates() |
boolean |
rotateBlock(World world,
BlockPos pos,
EnumFacing axis)
Rotate the block.
|
void |
setBedOccupied(IBlockAccess world,
BlockPos pos,
EntityPlayer player,
boolean occupied)
Called when a user either starts or stops sleeping in the bed.
|
Block |
setBlockUnbreakable() |
Block |
setCreativeTab(CreativeTabs tab) |
protected void |
setDefaultState(IBlockState state) |
Block |
setHardness(float hardness) |
void |
setHarvestLevel(java.lang.String toolClass,
int level)
Sets or removes the tool and level required to harvest this block.
|
void |
setHarvestLevel(java.lang.String toolClass,
int level,
IBlockState state)
Sets or removes the tool and level required to harvest this block.
|
Block |
setLightLevel(float value) |
Block |
setLightOpacity(int opacity) |
Block |
setResistance(float resistance) |
protected Block |
setSoundType(SoundType sound) |
Block |
setTickRandomly(boolean shouldTick) |
Block |
setUnlocalizedName(java.lang.String name) |
boolean |
shouldCheckWeakPower(IBlockState state,
IBlockAccess world,
BlockPos pos,
EnumFacing side)
Called to determine whether to allow the a block to handle its own indirect power rather than using the default rules.
|
boolean |
shouldSideBeRendered(IBlockState blockState,
IBlockAccess blockAccess,
BlockPos pos,
EnumFacing side)
Deprecated.
|
static void |
spawnAsEntity(World worldIn,
BlockPos pos,
ItemStack stack) |
int |
tickRate(World worldIn) |
java.lang.String |
toString() |
void |
updateTick(World worldIn,
BlockPos pos,
IBlockState state,
java.util.Random rand) |
IBlockState |
withMirror(IBlockState state,
Mirror mirrorIn)
Deprecated.
|
IBlockState |
withRotation(IBlockState state,
Rotation rot)
Deprecated.
|
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
public static final RegistryNamespacedDefaultedByKey<ResourceLocation,Block> REGISTRY
@Deprecated public static final ObjectIntIdentityMap<IBlockState> BLOCK_STATE_IDS
public static final AxisAlignedBB FULL_BLOCK_AABB
@Nullable public static final AxisAlignedBB NULL_AABB
protected boolean fullBlock
protected int lightOpacity
protected boolean translucent
protected int lightValue
protected boolean useNeighborBrightness
protected float blockHardness
protected float blockResistance
protected boolean enableStats
protected boolean needsRandomTick
protected boolean isBlockContainer
protected SoundType blockSoundType
public float blockParticleGravity
protected final Material blockMaterial
protected final MapColor blockMapColor
public float slipperiness
protected final BlockStateContainer blockState
protected java.lang.ThreadLocal<EntityPlayer> harvesters
protected static java.util.Random RANDOM
protected static java.lang.ThreadLocal<java.lang.Boolean> captureDrops
protected static java.lang.ThreadLocal<java.util.List<ItemStack>> capturedDrops
public Block(Material materialIn)
public static int getIdFromBlock(Block blockIn)
public static int getStateId(IBlockState state)
public static Block getBlockById(int id)
public static IBlockState getStateById(int id)
@Nullable public static Block getBlockFromName(java.lang.String name)
@Deprecated public boolean isFullyOpaque(IBlockState state)
@Deprecated public boolean isFullBlock(IBlockState state)
@Deprecated public boolean canEntitySpawn(IBlockState state, Entity entityIn)
@Deprecated public int getLightOpacity(IBlockState state)
@Deprecated public boolean isTranslucent(IBlockState state)
@Deprecated public int getLightValue(IBlockState state)
@Deprecated public boolean getUseNeighborBrightness(IBlockState state)
@Deprecated public Material getMaterial(IBlockState state)
@Deprecated public MapColor getMapColor(IBlockState state)
@Deprecated public IBlockState getStateFromMeta(int meta)
public int getMetaFromState(IBlockState state)
@Deprecated public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
@Deprecated public IBlockState withRotation(IBlockState state, Rotation rot)
@Deprecated public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
public Block setLightOpacity(int opacity)
public Block setLightLevel(float value)
public Block setResistance(float resistance)
@Deprecated public boolean isBlockNormalCube(IBlockState state)
@Deprecated public boolean isNormalCube(IBlockState state)
@Deprecated public boolean causesSuffocation(IBlockState state)
@Deprecated public boolean isFullCube(IBlockState state)
@Deprecated public boolean hasCustomBreakingProgress(IBlockState state)
public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
@Deprecated public EnumBlockRenderType getRenderType(IBlockState state)
public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos)
public Block setHardness(float hardness)
public Block setBlockUnbreakable()
@Deprecated public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos)
public Block setTickRandomly(boolean shouldTick)
public boolean getTickRandomly()
@Deprecated public boolean hasTileEntity()
@Deprecated public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
@Deprecated public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos)
@Deprecated public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
@Deprecated public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, java.util.List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_)
protected static void addCollisionBoxToList(BlockPos pos, AxisAlignedBB entityBox, java.util.List<AxisAlignedBB> collidingBoxes, @Nullable AxisAlignedBB blockBox)
@Deprecated @Nullable public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
@Deprecated public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos)
@Deprecated public boolean isOpaqueCube(IBlockState state)
public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid)
public boolean isCollidable()
public void randomTick(World worldIn, BlockPos pos, IBlockState state, java.util.Random random)
public void updateTick(World worldIn, BlockPos pos, IBlockState state, java.util.Random rand)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, java.util.Random rand)
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state)
@Deprecated public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
public int tickRate(World worldIn)
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
public int quantityDropped(java.util.Random random)
public Item getItemDropped(IBlockState state, java.util.Random rand, int fortune)
@Deprecated public float getPlayerRelativeBlockHardness(IBlockState state, EntityPlayer player, World worldIn, BlockPos pos)
public final void dropBlockAsItem(World worldIn, BlockPos pos, IBlockState state, int fortune)
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
public int damageDropped(IBlockState state)
public float getExplosionResistance(Entity exploder)
@Deprecated @Nullable public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end)
@Nullable protected RayTraceResult rayTrace(BlockPos pos, Vec3d start, Vec3d end, AxisAlignedBB boundingBox)
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn)
public BlockRenderLayer getBlockLayer()
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side)
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
@Deprecated public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn)
public Vec3d modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3d motion)
@Deprecated public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
@Deprecated public boolean canProvidePower(IBlockState state)
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
@Deprecated public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack)
@Deprecated protected boolean canSilkHarvest()
protected ItemStack getSilkTouchDrop(IBlockState state)
public int quantityDroppedWithBonus(int fortune, java.util.Random random)
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
public boolean canSpawnInBlock()
public Block setUnlocalizedName(java.lang.String name)
public java.lang.String getLocalizedName()
public java.lang.String getUnlocalizedName()
@Deprecated public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param)
public boolean getEnableStats()
protected Block disableStats()
@Deprecated public EnumPushReaction getMobilityFlag(IBlockState state)
@Deprecated public float getAmbientOcclusionLightValue(IBlockState state)
public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance)
@Deprecated public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list)
public Block setCreativeTab(CreativeTabs tab)
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
public CreativeTabs getCreativeTabToDisplayOn()
public boolean requiresUpdates()
public boolean canDropFromExplosion(Explosion explosionIn)
public boolean isAssociatedBlock(Block other)
@Deprecated public boolean hasComparatorInputOverride(IBlockState state)
@Deprecated public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
protected BlockStateContainer createBlockState()
public BlockStateContainer getBlockState()
protected final void setDefaultState(IBlockState state)
public final IBlockState getDefaultState()
public Block.EnumOffsetType getOffsetType()
@Deprecated public Vec3d getOffset(IBlockState state, IBlockAccess worldIn, BlockPos pos)
@Deprecated public SoundType getSoundType()
public java.lang.String toString()
toString
in class java.lang.Object
public void addInformation(ItemStack stack, EntityPlayer player, java.util.List<java.lang.String> tooltip, boolean advanced)
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
state
- Block stateworld
- The current worldpos
- Block position in worldpublic boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity)
state
- The current stateworld
- The current worldpos
- Block position in worldentity
- The entity trying to use the ladder, CAN be null.public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
state
- The current block stateworld
- The current worldpos
- Block position in worldface
- The side to checkpublic boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side)
base_state
- The base state, getActualState should be called firstworld
- The current worldpos
- Block position in worldside
- The side to checkpublic boolean isBurning(IBlockAccess world, BlockPos pos)
world
- The current worldpos
- Block position in worldpublic boolean isAir(IBlockState state, IBlockAccess world, BlockPos pos)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic boolean canHarvestBlock(IBlockAccess world, BlockPos pos, EntityPlayer player)
player
- The player damaging the blockpos
- The block's current positionpublic boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
state
- The current state.world
- The current worldplayer
- The player damaging the block, may be nullpos
- Block position in worldwillHarvest
- 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 harvestBlockpublic int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
world
- The current worldpos
- Block position in worldface
- The face that the fire is coming frompublic boolean isFlammable(IBlockAccess world, BlockPos pos, EnumFacing face)
world
- The current worldpos
- Block position in worldface
- The face that the fire is coming frompublic int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face)
world
- The current worldpos
- Block position in worldface
- The face that the fire is coming frompublic boolean isFireSource(World world, BlockPos pos, EnumFacing side)
world
- The current worldpos
- Block position in worldside
- The face that the fire is coming frompublic boolean hasTileEntity(IBlockState state)
state
- State of the current block@Nullable public TileEntity createTileEntity(World world, IBlockState state)
state
- The state of the current blockpublic int quantityDropped(IBlockState state, int fortune, java.util.Random random)
state
- Current statefortune
- Current item fortune levelrandom
- Random number generatorpublic java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
world
- The current worldpos
- Block position in worldstate
- Current statefortune
- Breakers fortune levelpublic boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player)
world
- The worldpos
- Block position in worldstate
- current block stateplayer
- The player doing the harvestingpublic boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, EntityLiving.SpawnPlacementType type)
state
- The current stateworld
- The current worldpos
- Block position in worldtype
- The Mob Category Typepublic boolean isBed(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable Entity player)
state
- The current stateworld
- The current worldpos
- Block position in worldplayer
- The player or camera entity, null in some cases.@Nullable public BlockPos getBedSpawnPosition(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EntityPlayer player)
state
- The current stateworld
- The current worldpos
- Block position in worldplayer
- The player or camera entity, null in some cases.public void setBedOccupied(IBlockAccess world, BlockPos pos, EntityPlayer player, boolean occupied)
world
- The current worldpos
- Block position in worldplayer
- The player or camera entity, null in some cases.occupied
- True if we are occupying the bed, or false if they are stopping use of the bedpublic EnumFacing getBedDirection(IBlockState state, IBlockAccess world, BlockPos pos)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic boolean isBedFoot(IBlockAccess world, BlockPos pos)
world
- The current worldpos
- Block position in worldpublic void beginLeavesDecay(IBlockState state, World world, BlockPos pos)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic boolean canBeReplacedByLeaves(IBlockState state, IBlockAccess world, BlockPos pos)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic boolean isWood(IBlockAccess world, BlockPos pos)
world
- The current worldpos
- Block position in worldpublic boolean isReplaceableOreGen(IBlockState state, IBlockAccess world, BlockPos pos, com.google.common.base.Predicate<IBlockState> target)
state
- The current stateworld
- The current worldpos
- Block position in worldtarget
- The generic target block the gen is looking for, Standards define stone
for overworld generation, and neatherack for the nether.public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion)
world
- The current worldpos
- Block position in worldexploder
- The entity that caused the explosion, can be nullexplosion
- The explosionpublic void onBlockExploded(World world, BlockPos pos, Explosion explosion)
world
- The current worldpos
- Block position in worldexplosion
- The explosion instance affecting the blockpublic boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side)
state
- The current stateworld
- The current worldpos
- Block position in worldside
- The side that is trying to make the connection, CAN BE NULLpublic boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
target
- The full target the player is looking atpublic boolean isFoliage(IBlockAccess world, BlockPos pos)
public boolean addLandingEffects(IBlockState state, WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles)
world
- The current Server worldblockPosition
- of the block that the entity landed on.iblockstate
- State at the specific world/posentity
- the entity that hit landed on the block.numberOfParticles
- that vanilla would have spawned.public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, ParticleManager manager)
state
- The current stateworld
- The current worldtarget
- The target the player is looking at {x/y/z/side/sub}manager
- A reference to the current particle manager.public boolean addDestroyEffects(World world, BlockPos pos, ParticleManager manager)
world
- The current worldpos
- Position to spawn the particlemanager
- A reference to the current particle manager.public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
state
- The Current stateworld
- The current worldpos
- Block position in worlddirection
- The direction relative to the given position the plant wants to be, typically its UPplantable
- The plant that wants to checkpublic void onPlantGrow(IBlockState state, World world, BlockPos pos, BlockPos source)
state
- The current stateworld
- Current worldpos
- Block position in worldsource
- Source plant's position in worldpublic boolean isFertile(World world, BlockPos pos)
world
- The current worldpos
- Block position in worldpublic int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos)
state
- The Block stateworld
- The current worldpos
- Block position in worldpublic boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity)
state
- The current stateworld
- The current worldpos
- Block position in worldpublic boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beacon)
world
- The current worldpos
- Block position in worldbeacon
- Beacon position in worldpublic boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
world
- The worldpos
- Block position in worldaxis
- The axis to rotate around@Nullable public EnumFacing[] getValidRotations(World world, BlockPos pos)
world
- The worldpos
- Block position in worldpublic float getEnchantPowerBonus(World world, BlockPos pos)
world
- The Worldpos
- Block position in worldpublic boolean recolorBlock(World world, BlockPos pos, EnumFacing side, EnumDyeColor color)
world
- The worldpos
- Block position in worldside
- The side hit with the coloring toolcolor
- The color to change topublic int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune)
state
- The current stateworld
- The worldpos
- Block positionfortune
- public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor)
world
- The worldpos
- Block position in worldneighbor
- Block position of neighborpublic void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos)
observerState
- The Observer block's state.world
- The current world.observerPos
- The Observer block's position.changedBlock
- The updated block.changedBlockPos
- The updated block's position.public boolean shouldCheckWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
world
- The worldpos
- Block position in worldside
- The INPUT side of the block to be powered - ie the opposite of this block's output sidepublic boolean getWeakChanges(IBlockAccess world, BlockPos pos)
world
- The current worldpos
- Block position in worldpublic void setHarvestLevel(java.lang.String toolClass, int level)
toolClass
- Classlevel
- Harvest level:
Wood: 0
Stone: 1
Iron: 2
Diamond: 3
Gold: 0public void setHarvestLevel(java.lang.String toolClass, int level, IBlockState state)
toolClass
- Classlevel
- Harvest level:
Wood: 0
Stone: 1
Iron: 2
Diamond: 3
Gold: 0state
- The specific state.@Nullable public java.lang.String getHarvestTool(IBlockState state)
public int getHarvestLevel(IBlockState state)
public boolean isToolEffective(java.lang.String type, IBlockState state)
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
@Nullable public java.lang.Boolean isEntityInsideMaterial(IBlockAccess world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead)
world
- that is being tested.blockpos
- position thats being tested.iblockstate
- state at world/blockposentity
- that is being tested.yToTest,
- primarily for testingHead, which sends the the eye level of the entity, other wise it sends a y that can be tested vs liquid height.materialIn
- to test for.testingHead
- when true, its testing the entities head for vision, breathing ect... otherwise its testing the body, for swimming and movement adjustment.@Nullable public java.lang.Boolean isAABBInsideMaterial(World world, BlockPos pos, AxisAlignedBB boundingBox, Material materialIn)
world
- world that is being tested.pos
- block thats being tested.boundingBox
- box to test, generally the bounds of an entity that are besting tested.materialIn
- to check for.public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer)
MinecraftForgeClient.getRenderLayer()
to alter their model based on layer.protected java.util.List<ItemStack> captureDrops(boolean start)
public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity)
state
- The stateworld
- The worldpos
- The position. Note that the world may not necessarily have state
here!entity
- The entity that is breaking/stepping on/placing/hitting/falling on this block, or null if no entity is in this context@Nullable public float[] getBeaconColorMultiplier(IBlockState state, World world, BlockPos pos, BlockPos beaconPos)
state
- The stateworld
- The worldpos
- The position of this statebeaconPos
- The position of the beaconpublic IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
IBlockState
to placeworld
- The world the block is being placed inpos
- The position the block is being placed atfacing
- The side the block is being placed onhitX
- The X coordinate of the hit vectorhitY
- The Y coordinate of the hit vectorhitZ
- The Z coordinate of the hit vectormeta
- The metadata of ItemStack
as processed by Item.getMetadata(int)
placer
- The entity placing the blockhand
- The player hand used to place this blockpublic boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
world
- The current worldpos
- The position of this blockfacing
- The side the connecting block is on@Nullable public PathNodeType getAiPathNodeType(IBlockState state, IBlockAccess world, BlockPos pos)
PathNodeType
for this block. Return null
for vanilla behavior.public static void registerBlocks()