public class RespawnAnchorBlock extends Block
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
static IntProperty |
CHARGES |
private static ImmutableList<Vec3i> |
field_26442 |
private static ImmutableList<Vec3i> |
field_26443 |
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Constructor and Description |
---|
RespawnAnchorBlock(AbstractBlock.Settings settings) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendProperties(StateManager.Builder<Block,BlockState> builder) |
private static boolean |
canCharge(BlockState state) |
boolean |
canPathfindThrough(BlockState state,
BlockView world,
BlockPos pos,
NavigationType type) |
static void |
charge(World world,
BlockPos pos,
BlockState state) |
private void |
explode(BlockState state,
World world,
BlockPos explodedPos) |
static Optional<Vec3d> |
findRespawnPosition(EntityType<?> entity,
CollisionView collisionView,
BlockPos pos) |
int |
getComparatorOutput(BlockState state,
World world,
BlockPos pos) |
static int |
getLightLevel(BlockState state,
int maxLevel) |
boolean |
hasComparatorOutput(BlockState state) |
private static boolean |
hasStillWater(BlockPos pos,
World world) |
private static boolean |
isChargeItem(ItemStack stack) |
static boolean |
isNether(World world) |
private static Optional<Vec3d> |
method_30842(EntityType<?> entityType,
CollisionView collisionView,
BlockPos blockPos,
boolean bool) |
ActionResult |
onUse(BlockState state,
World world,
BlockPos pos,
PlayerEntity player,
Hand hand,
BlockHitResult hit)
Called when this block is used by a player.
|
void |
randomDisplayTick(BlockState state,
World world,
BlockPos pos,
Random random) |
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getPlacementState, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getOutlineShape, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, rotate, scheduledTick
public static final IntProperty CHARGES
private static final ImmutableList<Vec3i> field_26442
private static final ImmutableList<Vec3i> field_26443
public RespawnAnchorBlock(AbstractBlock.Settings settings)
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
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.
onUse
in class AbstractBlock
private static boolean isChargeItem(ItemStack stack)
private static boolean canCharge(BlockState state)
private void explode(BlockState state, World world, BlockPos explodedPos)
public static boolean isNether(World world)
public static void charge(World world, BlockPos pos, BlockState state)
@Environment(value=CLIENT) public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)
randomDisplayTick
in class Block
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block
public boolean hasComparatorOutput(BlockState state)
hasComparatorOutput
in class AbstractBlock
public static int getLightLevel(BlockState state, int maxLevel)
public int getComparatorOutput(BlockState state, World world, BlockPos pos)
getComparatorOutput
in class AbstractBlock
public static Optional<Vec3d> findRespawnPosition(EntityType<?> entity, CollisionView collisionView, BlockPos pos)
private static Optional<Vec3d> method_30842(EntityType<?> entityType, CollisionView collisionView, BlockPos blockPos, boolean bool)
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
canPathfindThrough
in class AbstractBlock