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 GameMode |
previousGameMode |
private int |
startMiningTime |
private int |
tickCounter |
ServerWorld |
world |
Constructor and Description |
---|
ServerPlayerInteractionManager(ServerWorld world) |
Modifier and Type | Method and Description |
---|---|
private float |
continueMining(BlockState state,
BlockPos pos,
int int2) |
void |
finishMining(BlockPos pos,
PlayerActionC2SPacket.Action action,
String reason) |
GameMode |
getGameMode() |
GameMode |
getPreviousGameMode() |
ActionResult |
interactBlock(ServerPlayerEntity player,
World world,
ItemStack stack,
Hand hand,
BlockHitResult hitResult) |
ActionResult |
interactItem(ServerPlayerEntity 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 |
setGameMode(GameMode gameMode,
GameMode previousGameMode) |
void |
setGameModeIfNotPresent(GameMode gameMode) |
void |
setWorld(ServerWorld world) |
boolean |
tryBreakBlock(BlockPos pos) |
void |
update() |
private static final Logger LOGGER
public ServerWorld world
public ServerPlayerEntity player
private GameMode gameMode
private GameMode previousGameMode
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 GameMode getPreviousGameMode()
public boolean isSurvivalLike()
public boolean isCreative()
public void setGameModeIfNotPresent(GameMode gameMode)
public void update()
private float continueMining(BlockState state, BlockPos pos, int int2)
public void processBlockBreakingAction(BlockPos pos, PlayerActionC2SPacket.Action action, Direction direction, int worldHeight)
public void finishMining(BlockPos pos, PlayerActionC2SPacket.Action action, String reason)
public boolean tryBreakBlock(BlockPos pos)
public ActionResult interactItem(ServerPlayerEntity player, World world, ItemStack stack, Hand hand)
public ActionResult interactBlock(ServerPlayerEntity player, World world, ItemStack stack, Hand hand, BlockHitResult hitResult)
public void setWorld(ServerWorld world)