类 ServerPlayerGameMode
java.lang.Object
net.minecraft.server.level.ServerPlayerGameMode
- 直接已知子类:
DemoMode
-
字段概要
字段修饰符和类型字段说明private 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
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
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_)
-
字段详细资料
-
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
-
-
构造器详细资料
-
ServerPlayerGameMode
-
-
方法详细资料
-
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)
.- 参数:
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- 返回:
- 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
-