Class MultiPlayerGameMode
java.lang.Object
net.minecraft.client.multiplayer.MultiPlayerGameMode
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustPlayer(Player player) Sets player capabilities depending on current gametype.voidAttacks an entitybooleanbooleancontinueDestroyBlock(BlockPos pos, Direction direction) createPlayer(ClientLevel level, StatsCounter stats, ClientRecipeBook recipeBook) createPlayer(ClientLevel level, StatsCounter stats, ClientRecipeBook recipeBook, Input lastSentInput, boolean wasSprinting) booleandestroyBlock(BlockPos pos) private voidint@Nullable GameTypevoidhandleContainerInput(int containerId, int slotNum, int buttonNum, ContainerInput containerInput, Player player) voidhandleCreativeModeItemAdd(ItemStack clicked, int slot) Used in PlayerControllerMP to update the server with an ItemStack in a slot.voidhandleCreativeModeItemDrop(ItemStack clicked) Sends a Packet107 to the server to drop the item on the groundvoidhandleInventoryButtonClick(int containerId, int buttonId) GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the enchantment action the player has taken.voidhandlePickItemFromBlock(BlockPos pos, boolean includeData) voidhandlePickItemFromEntity(Entity entity, boolean includeData) voidhandlePlaceRecipe(int containerId, RecipeDisplayId recipe, boolean useMaxItems) voidhandleSlotStateChanged(int slotId, int containerId, boolean newState) booleanbooleaninteract(Player player, Entity entity, EntityHitResult hitResult, InteractionHand hand) booleanbooleanbooleanprivate InteractionResultperformUseItemOn(LocalPlayer player, InteractionHand hand, BlockHitResult blockHit) voidpiercingAttack(PiercingWeapon weapon) voidreleaseUsingItem(Player player) private booleanvoidsetLocalMode(GameType mode) Sets the game type for the player.voidsetLocalMode(GameType mode, @Nullable GameType previousMode) voidbooleanstartDestroyBlock(BlockPos pos, Direction direction) Called when the player is hitting a block with an item.private voidstartPrediction(ClientLevel level, PredictiveAction predictiveAction) voidvoidtick()useItem(Player player, InteractionHand hand) useItemOn(LocalPlayer player, InteractionHand hand, BlockHitResult blockHit)
-
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
-
stopDestroyBlock
public void stopDestroyBlock() -
continueDestroyBlock
-
startPrediction
-
tick
public void tick() -
sameDestroyTarget
-
ensureHasSentCarriedItem
private void ensureHasSentCarriedItem() -
useItemOn
public InteractionResult useItemOn(LocalPlayer player, InteractionHand hand, BlockHitResult blockHit) -
performUseItemOn
private InteractionResult performUseItemOn(LocalPlayer player, InteractionHand hand, BlockHitResult blockHit) -
useItem
-
createPlayer
-
createPlayer
public LocalPlayer createPlayer(ClientLevel level, StatsCounter stats, ClientRecipeBook recipeBook, Input lastSentInput, boolean wasSprinting) -
attack
-
spectate
-
interact
public InteractionResult interact(Player player, Entity entity, EntityHitResult hitResult, InteractionHand hand) -
handleContainerInput
public void handleContainerInput(int containerId, int slotNum, int buttonNum, ContainerInput containerInput, Player player) -
handlePlaceRecipe
-
handleInventoryButtonClick
public void handleInventoryButtonClick(int containerId, int buttonId) 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
-
piercingAttack
-
hasExperience
public boolean hasExperience() -
hasMissTime
public boolean hasMissTime() -
isServerControlledInventory
public boolean isServerControlledInventory() -
isSpectator
public boolean isSpectator() -
getPreviousPlayerMode
-
getPlayerMode
-
isDestroying
public boolean isDestroying() -
getDestroyStage
public int getDestroyStage() -
handlePickItemFromBlock
-
handlePickItemFromEntity
-
handleSlotStateChanged
public void handleSlotStateChanged(int slotId, int containerId, boolean newState)
-