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_) private void
debugLogging
(BlockPos p_215126_, boolean p_215127_, int p_215128_, String p_215129_) void
destroyAndAck
(BlockPos p_215117_, int p_215118_, String p_215119_) boolean
destroyBlock
(BlockPos p_9281_) void
handleBlockBreakAction
(BlockPos p_215120_, ServerboundPlayerActionPacket.Action p_215121_, Direction p_215122_, int p_215123_, int p_215124_) private float
incrementDestroyProgress
(BlockState p_9277_, BlockPos p_9278_, int p_9279_) boolean
boolean
private boolean
removeBlock
(BlockPos pos, BlockState state, boolean canHarvest) Patched-in method that handles actual removal of blocks fordestroyBlock(BlockPos)
.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
-
debugLogging
-
handleBlockBreakAction
public void handleBlockBreakAction(BlockPos p_215120_, ServerboundPlayerActionPacket.Action p_215121_, Direction p_215122_, int p_215123_, int p_215124_) -
destroyAndAck
-
destroyBlock
-
removeBlock
Patched-in method that handles actual removal of blocks fordestroyBlock(BlockPos)
.- Parameters:
pos
- The block pos of the destroyed blockstate
- The state of the destroyed blockcanHarvest
- If the player breaking the block can harvest the drops of the block- Returns:
- If the block was removed, as reported by
IBlockStateExtension.onDestroyedByPlayer(net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.world.entity.player.Player, boolean, net.minecraft.world.level.material.FluidState)
.
-
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
-