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 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 Summary
Constructors Constructor Description ServerPlayerInteractionManager(ServerWorld world)
-
Method Summary
Modifier and Type Method 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()
-
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
-