Package net.minecraft.block
Class AnvilBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.FallingBlock
net.minecraft.block.AnvilBlock
- All Implemented Interfaces:
LandingBlock
,ItemConvertible
public class AnvilBlock extends FallingBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroup
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
-
Field Summary
Fields Modifier and Type Field Description private static VoxelShape
BASE_SHAPE
static DirectionProperty
FACING
private static Text
TITLE
private static VoxelShape
X_AXIS_SHAPE
private static VoxelShape
X_FACE_SHAPE
private static VoxelShape
X_STEM_SHAPE
private static VoxelShape
X_STEP_SHAPE
private static VoxelShape
Z_AXIS_SHAPE
private static VoxelShape
Z_FACE_SHAPE
private static VoxelShape
Z_STEM_SHAPE
private static VoxelShape
Z_STEP_SHAPE
Fields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
-
Constructor Summary
Constructors Constructor Description AnvilBlock(AbstractBlock.Settings settings)
-
Method Summary
Methods inherited from class net.minecraft.block.FallingBlock
canFallThrough, getFallDelay, getStateForNeighborUpdate, onBlockAdded, randomDisplayTick, scheduledTick
Methods inherited from class net.minecraft.block.Block
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.block.LandingBlock
getEntityPredicate
-
Field Details
-
FACING
-
BASE_SHAPE
-
X_STEP_SHAPE
-
X_STEM_SHAPE
-
X_FACE_SHAPE
-
Z_STEP_SHAPE
-
Z_STEM_SHAPE
-
Z_FACE_SHAPE
-
X_AXIS_SHAPE
-
Z_AXIS_SHAPE
-
TITLE
-
-
Constructor Details
-
AnvilBlock
-
-
Method Details
-
getPlacementState
- Overrides:
getPlacementState
in classBlock
-
onUse
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player. This, by default, is bound to using the right mouse button.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
world.isClient()
.If the action result is successful on a logical client, then the action will be sent to the logical server for processing.
- Overrides:
onUse
in classAbstractBlock
- Returns:
- an action result that specifies if using the block was successful.
-
createScreenHandlerFactory
@Nullable public NamedScreenHandlerFactory createScreenHandlerFactory(BlockState state, World world, BlockPos pos)- Overrides:
createScreenHandlerFactory
in classAbstractBlock
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShape
in classAbstractBlock
-
configureFallingBlockEntity
- Overrides:
configureFallingBlockEntity
in classFallingBlock
-
onLanding
public void onLanding(World world, BlockPos pos, BlockState fallingBlockState, BlockState currentStateInPos, FallingBlockEntity fallingBlockEntity) -
onDestroyedOnLanding
-
getDamageSource
-
getLandingState
-
rotate
Applies a block rotation to a block state.By default, this returns the provided block state.
- Overrides:
rotate
in classAbstractBlock
- Returns:
- the rotated block state
-
appendProperties
- Overrides:
appendProperties
in classBlock
-
getColor
- Overrides:
getColor
in classFallingBlock
-