Package net.minecraft.server.network
Class ServerPlayerInteractionManager
java.lang.Object
net.minecraft.server.network.ServerPlayerInteractionManager
- Direct Known Subclasses:
DemoServerPlayerInteractionManager
public class ServerPlayerInteractionManager extends Object
-
Field Summary
Fields Modifier and Type Field Description private intblockBreakingProgressprivate BlockPosfailedMiningPosprivate intfailedStartMiningTimeprivate booleanfailedToMineprivate GameModegameModeprivate static LoggerLOGGERprivate booleanminingprivate BlockPosminingPosprotected ServerPlayerEntityplayerprivate GameModepreviousGameModeprivate intstartMiningTimeprivate inttickCounterprotected ServerWorldworld -
Constructor Summary
Constructors Constructor Description ServerPlayerInteractionManager(ServerPlayerEntity serverPlayerEntity) -
Method Summary
Modifier and Type Method Description booleanchangeGameMode(GameMode gameMode)Checks if current game mode is different togameMode, and change it if so.private floatcontinueMining(BlockState state, BlockPos pos, int int2)voidfinishMining(BlockPos pos, PlayerActionC2SPacket.Action action, String reason)GameModegetGameMode()GameModegetPreviousGameMode()ActionResultinteractBlock(ServerPlayerEntity player, World world, ItemStack stack, Hand hand, BlockHitResult hitResult)ActionResultinteractItem(ServerPlayerEntity player, World world, ItemStack stack, Hand hand)booleanisCreative()booleanisSurvivalLike()voidprocessBlockBreakingAction(BlockPos pos, PlayerActionC2SPacket.Action action, Direction direction, int worldHeight)protected voidsetGameMode(GameMode gameMode, GameMode previousGameMode)voidsetWorld(ServerWorld world)booleantryBreakBlock(BlockPos pos)voidupdate()
-
Field Details
-
LOGGER
-
world
-
player
-
gameMode
-
previousGameMode
-
mining
private boolean mining -
startMiningTime
private int startMiningTime -
miningPos
-
tickCounter
private int tickCounter -
failedToMine
private boolean failedToMine -
failedMiningPos
-
failedStartMiningTime
private int failedStartMiningTime -
blockBreakingProgress
private int blockBreakingProgress
-
-
Constructor Details
-
ServerPlayerInteractionManager
-
-
Method Details
-
changeGameMode
Checks if current game mode is different togameMode, and change it if so.- Returns:
- whether the current game mode has been changed
-
setGameMode
-
getGameMode
-
getPreviousGameMode
-
isSurvivalLike
public boolean isSurvivalLike() -
isCreative
public boolean isCreative() -
update
public void update() -
continueMining
-
processBlockBreakingAction
public void processBlockBreakingAction(BlockPos pos, PlayerActionC2SPacket.Action action, Direction direction, int worldHeight) -
finishMining
-
tryBreakBlock
-
interactItem
public ActionResult interactItem(ServerPlayerEntity player, World world, ItemStack stack, Hand hand) -
interactBlock
public ActionResult interactBlock(ServerPlayerEntity player, World world, ItemStack stack, Hand hand, BlockHitResult hitResult) -
setWorld
-