public class ServerPlayerInteractionManager extends Object
Modifier and Type | Field and Description |
---|---|
private int |
blockBreakingProgress |
private BlockPos |
failedMiningPos |
private int |
failedStartMiningTime |
private boolean |
failedToMine |
private GameMode |
gameMode |
private static Logger |
LOGGER |
private boolean |
mining |
private BlockPos |
miningPos |
ServerPlayerEntity |
player |
private int |
startMiningTime |
private int |
tickCounter |
ServerWorld |
world |
Constructor and Description |
---|
ServerPlayerInteractionManager(ServerWorld world) |
Modifier and Type | Method and Description |
---|---|
private float |
continueMining(BlockState blockState,
BlockPos blockPos,
int int2) |
void |
finishMining(BlockPos blockPos,
PlayerActionC2SPacket.Action action,
String reason) |
GameMode |
getGameMode() |
ActionResult |
interactBlock(PlayerEntity player,
World world,
ItemStack stack,
Hand hand,
BlockHitResult hitResult) |
ActionResult |
interactItem(PlayerEntity player,
World world,
ItemStack stack,
Hand hand) |
boolean |
isCreative() |
boolean |
isSurvivalLike() |
void |
processBlockBreakingAction(BlockPos pos,
PlayerActionC2SPacket.Action action,
Direction direction,
int worldHeight) |
void |
setGameMode(GameMode gameMode) |
void |
setGameModeIfNotPresent(GameMode gameMode) |
void |
setWorld(ServerWorld world) |
boolean |
tryBreakBlock(BlockPos blockPos) |
void |
update() |
private static final Logger LOGGER
public ServerWorld world
public ServerPlayerEntity player
private GameMode gameMode
private boolean mining
private int startMiningTime
private BlockPos miningPos
private int tickCounter
private boolean failedToMine
private BlockPos failedMiningPos
private int failedStartMiningTime
private int blockBreakingProgress
public ServerPlayerInteractionManager(ServerWorld world)
public void setGameMode(GameMode gameMode)
public GameMode getGameMode()
public boolean isSurvivalLike()
public boolean isCreative()
public void setGameModeIfNotPresent(GameMode gameMode)
public void update()
private float continueMining(BlockState blockState, BlockPos blockPos, int int2)
public void processBlockBreakingAction(BlockPos pos, PlayerActionC2SPacket.Action action, Direction direction, int worldHeight)
public void finishMining(BlockPos blockPos, PlayerActionC2SPacket.Action action, String reason)
public boolean tryBreakBlock(BlockPos blockPos)
public ActionResult interactItem(PlayerEntity player, World world, ItemStack stack, Hand hand)
public ActionResult interactBlock(PlayerEntity player, World world, ItemStack stack, Hand hand, BlockHitResult hitResult)
public void setWorld(ServerWorld world)