Package net.minecraft.client.multiplayer
Class MultiPlayerGameMode
java.lang.Object
net.minecraft.client.multiplayer.MultiPlayerGameMode
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustPlayer(Player pPlayer) Sets player capabilities depending on current gametype.voidAttacks an entitybooleanbooleancontinueDestroyBlock(BlockPos pPosBlock, Direction pDirectionFacing) createPlayer(ClientLevel pLevel, StatsCounter pStats, ClientRecipeBook pRecipeBook) createPlayer(ClientLevel pLevel, StatsCounter pStats, ClientRecipeBook pRecipeBook, Input pLastSentInput, boolean pWasSprinting) booleandestroyBlock(BlockPos pPos) private voidintvoidhandleCreativeModeItemAdd(ItemStack pStack, int pSlotId) Used in PlayerControllerMP to update the server with an ItemStack in a slot.voidhandleCreativeModeItemDrop(ItemStack pStack) Sends a Packet107 to the server to drop the item on the groundvoidhandleInventoryButtonClick(int pContainerId, int pButtonId) GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the enchantment action the player has taken.voidhandleInventoryMouseClick(int pContainerId, int pSlotId, int pMouseButton, ClickType pClickType, Player pPlayer) voidhandlePickItemFromBlock(BlockPos pPos, boolean pIncludeData) voidhandlePickItemFromEntity(Entity pEntity, boolean pIncludeData) voidhandlePlaceRecipe(int pContainerId, RecipeDisplayId pRecipe, boolean pUseMaxItems) voidhandleSlotStateChanged(int pSlotId, int pContainerId, boolean pNewState) booleanbooleaninteract(Player pPlayer, Entity pTarget, InteractionHand pHand) Handles right-clicking an entity, sends a packet to the server.interactAt(Player pPlayer, Entity pTarget, EntityHitResult pRay, InteractionHand pHand) Handles right-clicking an entity from the entities side, sends a packet to the server.booleanbooleanbooleanprivate InteractionResultperformUseItemOn(LocalPlayer pPlayer, InteractionHand pHand, BlockHitResult pResult) voidreleaseUsingItem(Player pPlayer) private booleansameDestroyTarget(BlockPos pPos) voidsetLocalMode(GameType pType) Sets the game type for the player.voidsetLocalMode(GameType pLocalPlayerMode, GameType pPreviousLocalPlayerMode) booleanstartDestroyBlock(BlockPos pLoc, Direction pFace) Called when the player is hitting a block with an item.private voidstartPrediction(ClientLevel pLevel, PredictiveAction pAction) voidvoidtick()useItem(Player pPlayer, InteractionHand pHand) useItemOn(LocalPlayer pPlayer, InteractionHand pHand, BlockHitResult pResult)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
minecraft
-
connection
-
destroyBlockPos
-
destroyingItem
-
destroyProgress
private float destroyProgress -
destroyTicks
private float destroyTicks -
destroyDelay
private int destroyDelay -
isDestroying
private boolean isDestroying -
localPlayerMode
-
previousLocalPlayerMode
-
carriedIndex
private int carriedIndex
-
-
Constructor Details
-
MultiPlayerGameMode
-
-
Method Details
-
adjustPlayer
Sets player capabilities depending on current gametype. -
setLocalMode
-
setLocalMode
Sets the game type for the player. -
canHurtPlayer
public boolean canHurtPlayer() -
destroyBlock
-
startDestroyBlock
Called when the player is hitting a block with an item. -
stopDestroyBlock
public void stopDestroyBlock() -
continueDestroyBlock
-
startPrediction
-
tick
public void tick() -
sameDestroyTarget
-
ensureHasSentCarriedItem
private void ensureHasSentCarriedItem() -
useItemOn
public InteractionResult useItemOn(LocalPlayer pPlayer, InteractionHand pHand, BlockHitResult pResult) -
performUseItemOn
private InteractionResult performUseItemOn(LocalPlayer pPlayer, InteractionHand pHand, BlockHitResult pResult) -
useItem
-
createPlayer
public LocalPlayer createPlayer(ClientLevel pLevel, StatsCounter pStats, ClientRecipeBook pRecipeBook) -
createPlayer
public LocalPlayer createPlayer(ClientLevel pLevel, StatsCounter pStats, ClientRecipeBook pRecipeBook, Input pLastSentInput, boolean pWasSprinting) -
attack
Attacks an entity -
interact
Handles right-clicking an entity, sends a packet to the server. -
interactAt
public InteractionResult interactAt(Player pPlayer, Entity pTarget, EntityHitResult pRay, InteractionHand pHand) Handles right-clicking an entity from the entities side, sends a packet to the server. -
handleInventoryMouseClick
-
handlePlaceRecipe
-
handleInventoryButtonClick
public void handleInventoryButtonClick(int pContainerId, int pButtonId) GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the enchantment action the player has taken. -
handleCreativeModeItemAdd
Used in PlayerControllerMP to update the server with an ItemStack in a slot. -
handleCreativeModeItemDrop
Sends a Packet107 to the server to drop the item on the ground -
releaseUsingItem
-
hasExperience
public boolean hasExperience() -
hasMissTime
public boolean hasMissTime() -
isServerControlledInventory
public boolean isServerControlledInventory() -
isAlwaysFlying
public boolean isAlwaysFlying() -
getPreviousPlayerMode
-
getPlayerMode
-
isDestroying
public boolean isDestroying() -
getDestroyStage
public int getDestroyStage() -
handlePickItemFromBlock
-
handlePickItemFromEntity
-
handleSlotStateChanged
public void handleSlotStateChanged(int pSlotId, int pContainerId, boolean pNewState)
-