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 player) Sets player abilities 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 GameTypevoidhandleCreativeModeItemAdd(ItemStack stack, int slotIndex) voidSends a ServerboundSetCreativeModeSlotPacket to the server to drop the item on the groundvoidhandleInventoryButtonClick(int containerId, int buttonId) voidhandleInventoryMouseClick(int containerId, int slotIndex, int mouseButton, ClickType clickType, Player player) voidhandlePickItemFromBlock(BlockPos pos, boolean includeData) voidhandlePickItemFromEntity(Entity entity, boolean includeData) voidhandlePlaceRecipe(int containerId, RecipeDisplayId recipe, boolean useMaxItems) voidhandleSlotStateChanged(int slotIndex, int containerId, boolean newState) booleanbooleaninteract(Player player, Entity target, InteractionHand hand) Handles right-clicking an entity, sends a packet to the server.interactAt(Player player, Entity target, EntityHitResult ray, InteractionHand hand) Handles right-clicking an entity from the entities side, sends a packet to the server.booleanbooleanbooleanprivate InteractionResultperformUseItemOn(LocalPlayer player, InteractionHand hand, BlockHitResult result) voidpiercingAttack(PiercingWeapon weapon) voidreleaseUsingItem(Player player) private booleanvoidsetLocalMode(GameType localPlayerMode) Sets the game type for the player.voidsetLocalMode(GameType localPlayerMode, @Nullable GameType previousLocalPlayerMode) booleanstartDestroyBlock(BlockPos pos, Direction direction) Called when the player is hitting a block with an item.private voidstartPrediction(ClientLevel level, PredictiveAction action) voidvoidtick()useItem(Player player, InteractionHand hand) useItemOn(LocalPlayer player, InteractionHand hand, BlockHitResult result)
-
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 abilities 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
-
performUseItemOn
private InteractionResult performUseItemOn(LocalPlayer player, InteractionHand hand, BlockHitResult result) -
useItem
-
createPlayer
-
createPlayer
public LocalPlayer createPlayer(ClientLevel level, StatsCounter stats, ClientRecipeBook recipeBook, Input lastSentInput, boolean wasSprinting) -
attack
Attacks an entity -
interact
Handles right-clicking an entity, sends a packet to the server. -
interactAt
public InteractionResult interactAt(Player player, Entity target, EntityHitResult ray, InteractionHand hand) Handles right-clicking an entity from the entities side, sends a packet to the server. -
handleInventoryMouseClick
-
handlePlaceRecipe
-
handleInventoryButtonClick
public void handleInventoryButtonClick(int containerId, int buttonId) -
handleCreativeModeItemAdd
-
handleCreativeModeItemDrop
Sends a ServerboundSetCreativeModeSlotPacket 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 slotIndex, int containerId, boolean newState)
-