public class ItemPlacementContext extends ItemUsageContext
Modifier and Type | Field and Description |
---|---|
protected boolean |
canReplaceExisting |
private BlockPos |
placementPos |
Modifier | Constructor and Description |
---|---|
|
ItemPlacementContext(ItemUsageContext context) |
|
ItemPlacementContext(PlayerEntity playerEntity,
Hand hand,
ItemStack itemStack,
BlockHitResult blockHitResult) |
protected |
ItemPlacementContext(World world,
PlayerEntity player,
Hand hand,
ItemStack stack,
BlockHitResult hit) |
Modifier and Type | Method and Description |
---|---|
boolean |
canPlace() |
boolean |
canReplaceExisting() |
BlockPos |
getBlockPos() |
Direction[] |
getPlacementDirections() |
Direction |
getPlayerLookDirection() |
static ItemPlacementContext |
offset(ItemPlacementContext context,
BlockPos pos,
Direction side) |
getHand, getHitPos, getHitResult, getPlayer, getPlayerFacing, getPlayerYaw, getSide, getStack, getWorld, hitsInsideBlock, shouldCancelInteraction
private final BlockPos placementPos
protected boolean canReplaceExisting
public ItemPlacementContext(PlayerEntity playerEntity, Hand hand, ItemStack itemStack, BlockHitResult blockHitResult)
public ItemPlacementContext(ItemUsageContext context)
protected ItemPlacementContext(World world, @Nullable PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hit)
public static ItemPlacementContext offset(ItemPlacementContext context, BlockPos pos, Direction side)
public BlockPos getBlockPos()
getBlockPos
in class ItemUsageContext
public boolean canPlace()
public boolean canReplaceExisting()
public Direction getPlayerLookDirection()
public Direction[] getPlacementDirections()