Package net.minecraft.server.level
Class ServerPlayerGameMode
java.lang.Object
net.minecraft.server.level.ServerPlayerGameMode
- Direct Known Subclasses:
DemoMode
-
Field Summary
Modifier and TypeFieldDescriptionprivate BlockPos
private int
private BlockPos
private int
private GameType
private int
private boolean
private boolean
private int
protected ServerLevel
private static final org.slf4j.Logger
protected final ServerPlayer
private GameType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
changeGameModeForPlayer
(GameType p_143474_) void
destroyAndAck
(BlockPos p_9287_, ServerboundPlayerActionPacket.Action p_9288_, String p_9289_) boolean
destroyBlock
(BlockPos p_9281_) void
handleBlockBreakAction
(BlockPos p_9282_, ServerboundPlayerActionPacket.Action p_9283_, Direction p_9284_, int p_9285_) private float
incrementDestroyProgress
(BlockState p_9277_, BlockPos p_9278_, int p_9279_) boolean
boolean
private boolean
removeBlock
(BlockPos p_180235_1_, boolean canHarvest) protected void
setGameModeForPlayer
(GameType p_9274_, GameType p_9275_) void
setLevel
(ServerLevel p_9261_) void
tick()
useItem
(ServerPlayer p_9262_, Level p_9263_, ItemStack p_9264_, InteractionHand p_9265_) useItemOn
(ServerPlayer p_9266_, Level p_9267_, ItemStack p_9268_, InteractionHand p_9269_, BlockHitResult p_9270_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
level
-
player
-
gameModeForPlayer
-
previousGameModeForPlayer
-
isDestroyingBlock
private boolean isDestroyingBlock -
destroyProgressStart
private int destroyProgressStart -
destroyPos
-
gameTicks
private int gameTicks -
hasDelayedDestroy
private boolean hasDelayedDestroy -
delayedDestroyPos
-
delayedTickStart
private int delayedTickStart -
lastSentState
private int lastSentState
-
-
Constructor Details
-
ServerPlayerGameMode
-
-
Method Details
-
changeGameModeForPlayer
-
setGameModeForPlayer
-
getGameModeForPlayer
-
getPreviousGameModeForPlayer
-
isSurvival
public boolean isSurvival() -
isCreative
public boolean isCreative() -
tick
public void tick() -
incrementDestroyProgress
-
handleBlockBreakAction
public void handleBlockBreakAction(BlockPos p_9282_, ServerboundPlayerActionPacket.Action p_9283_, Direction p_9284_, int p_9285_) -
destroyAndAck
public void destroyAndAck(BlockPos p_9287_, ServerboundPlayerActionPacket.Action p_9288_, String p_9289_) -
destroyBlock
-
removeBlock
-
useItem
public InteractionResult useItem(ServerPlayer p_9262_, Level p_9263_, ItemStack p_9264_, InteractionHand p_9265_) -
useItemOn
public InteractionResult useItemOn(ServerPlayer p_9266_, Level p_9267_, ItemStack p_9268_, InteractionHand p_9269_, BlockHitResult p_9270_) -
setLevel
-