Package net.minecraft.block
Class HopperBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.BlockWithEntity
net.minecraft.block.HopperBlock
- All Implemented Interfaces:
BlockEntityProvider
,ItemConvertible
public class HopperBlock extends BlockWithEntity
-
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
DEFAULT_SHAPE
private static VoxelShape
DOWN_RAY_TRACE_SHAPE
private static VoxelShape
DOWN_SHAPE
private static VoxelShape
EAST_RAY_TRACE_SHAPE
private static VoxelShape
EAST_SHAPE
static BooleanProperty
ENABLED
static DirectionProperty
FACING
private static VoxelShape
MIDDLE_SHAPE
private static VoxelShape
NORTH_RAY_TRACE_SHAPE
private static VoxelShape
NORTH_SHAPE
private static VoxelShape
OUTSIDE_SHAPE
private static VoxelShape
SOUTH_RAY_TRACE_SHAPE
private static VoxelShape
SOUTH_SHAPE
private static VoxelShape
TOP_SHAPE
private static VoxelShape
WEST_RAY_TRACE_SHAPE
private static VoxelShape
WEST_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 HopperBlock(AbstractBlock.Settings settings)
-
Method Summary
Methods inherited from class net.minecraft.block.BlockWithEntity
checkType, createScreenHandlerFactory, onSyncedBlockEvent
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, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getPistonBehavior, getRenderingSeed, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasSidedTransparency, isSideInvisible, onBlockBreakStart, onProjectileHit, onStacksDropped, prepare, randomTick, scheduledTick
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.block.BlockEntityProvider
getGameEventListener
-
Field Details
-
FACING
-
ENABLED
-
TOP_SHAPE
-
MIDDLE_SHAPE
-
OUTSIDE_SHAPE
-
DEFAULT_SHAPE
-
DOWN_SHAPE
-
EAST_SHAPE
-
NORTH_SHAPE
-
SOUTH_SHAPE
-
WEST_SHAPE
-
DOWN_RAY_TRACE_SHAPE
-
EAST_RAY_TRACE_SHAPE
-
NORTH_RAY_TRACE_SHAPE
-
SOUTH_RAY_TRACE_SHAPE
-
WEST_RAY_TRACE_SHAPE
-
-
Constructor Details
-
HopperBlock
-
-
Method Details
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShape
in classAbstractBlock
-
getRaycastShape
- Overrides:
getRaycastShape
in classAbstractBlock
-
getPlacementState
- Overrides:
getPlacementState
in classBlock
-
createBlockEntity
-
getTicker
@Nullable public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) -
onPlaced
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) -
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)- Overrides:
onBlockAdded
in classAbstractBlock
-
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.
-
neighborUpdate
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)- Overrides:
neighborUpdate
in classAbstractBlock
-
updateEnabled
-
onStateReplaced
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)
ifnewState
is different fromstate
. Vanilla blocks perform removal cleanups here.- Overrides:
onStateReplaced
in classAbstractBlock
-
getRenderType
- Overrides:
getRenderType
in classBlockWithEntity
-
hasComparatorOutput
- Overrides:
hasComparatorOutput
in classAbstractBlock
-
getComparatorOutput
- Overrides:
getComparatorOutput
in classAbstractBlock
-
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
-
mirror
- Overrides:
mirror
in classAbstractBlock
-
appendProperties
- Overrides:
appendProperties
in classBlock
-
onEntityCollision
- Overrides:
onEntityCollision
in classAbstractBlock
-