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 BlockPosminingPosServerPlayerEntityplayerprivate GameModepreviousGameModeprivate intstartMiningTimeprivate inttickCounterServerWorldworld -
Constructor Summary
Constructors Constructor Description ServerPlayerInteractionManager(ServerWorld world) -
Method Summary
Modifier and Type Method Description 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)voidsetGameMode(GameMode gameMode)voidsetGameMode(GameMode gameMode, GameMode previousGameMode)voidsetGameModeIfNotPresent(GameMode gameMode)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
-
setGameMode
-
setGameMode
-
getGameMode
-
getPreviousGameMode
-
isSurvivalLike
public boolean isSurvivalLike() -
isCreative
public boolean isCreative() -
setGameModeIfNotPresent
-
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
-