public class PlayerController
extends java.lang.Object
コンストラクタと説明 |
---|
PlayerController(Minecraft mcIn,
ClientPlayNetHandler netHandler) |
修飾子とタイプ | メソッドと説明 |
---|---|
void |
attackEntity(PlayerEntity playerIn,
Entity targetEntity)
Attacks an entity
|
boolean |
clickBlock(BlockPos loc,
Direction face)
Called when the player is hitting a block with an item.
|
static void |
clickBlockCreative(Minecraft mcIn,
PlayerController playerController,
BlockPos pos,
Direction facing) |
ClientPlayerEntity |
createPlayer(ClientWorld p_199681_1_,
StatisticsManager p_199681_2_,
ClientRecipeBook p_199681_3_) |
boolean |
extendedReach()
true for hitting entities far away.
|
ActionResultType |
func_217292_a(ClientPlayerEntity p_217292_1_,
ClientWorld p_217292_2_,
Hand p_217292_3_,
BlockRayTraceResult p_217292_4_) |
void |
func_225323_a(ClientWorld p_225323_1_,
BlockPos p_225323_2_,
BlockState p_225323_3_,
CPlayerDiggingPacket.Action p_225323_4_,
boolean p_225323_5_) |
boolean |
gameIsSurvivalOrAdventure() |
float |
getBlockReachDistance()
player reach distance = 4F
|
GameType |
getCurrentGameType() |
boolean |
getIsHittingBlock()
Return isHittingBlock
|
ActionResultType |
interactWithEntity(PlayerEntity player,
Entity target,
EntityRayTraceResult ray,
Hand hand)
Handles right clicking an entity from the entities side, sends a packet to the server.
|
ActionResultType |
interactWithEntity(PlayerEntity player,
Entity target,
Hand hand)
Handles right clicking an entity, sends a packet to the server.
|
boolean |
isInCreativeMode()
returns true if player is in creative mode
|
boolean |
isNotCreative()
Checks if the player is not creative, used for checking if it should break a block instantly
|
boolean |
isRidingHorse()
Checks if the player is riding a horse, used to chose the GUI to open
|
boolean |
isSpectatorMode() |
boolean |
onPlayerDamageBlock(BlockPos posBlock,
Direction directionFacing) |
boolean |
onPlayerDestroyBlock(BlockPos pos) |
void |
onStoppedUsingItem(PlayerEntity playerIn) |
void |
pickItem(int index) |
ActionResultType |
processRightClick(PlayerEntity player,
World worldIn,
Hand hand) |
void |
resetBlockRemoving()
Resets current block damage
|
void |
sendEnchantPacket(int windowID,
int button)
GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the enchantment
action the player has taken.
|
void |
sendPacketDropItem(ItemStack itemStackIn)
Sends a Packet107 to the server to drop the item on the ground
|
void |
sendPlaceRecipePacket(int p_203413_1_,
IRecipe<?> p_203413_2_,
boolean p_203413_3_) |
void |
sendSlotPacket(ItemStack itemStackIn,
int slotId)
Used in PlayerControllerMP to update the server with an ItemStack in a slot.
|
void |
setGameType(GameType type)
Sets the game type for the player.
|
void |
setPlayerCapabilities(PlayerEntity player)
Sets player capabilities depending on current gametype. params: player
|
boolean |
shouldDrawHUD() |
void |
tick() |
ItemStack |
windowClick(int windowId,
int slotId,
int mouseButton,
ClickType type,
PlayerEntity player)
Handles slot clicks, sends a packet to the server.
|
public PlayerController(Minecraft mcIn, ClientPlayNetHandler netHandler)
public static void clickBlockCreative(Minecraft mcIn, PlayerController playerController, BlockPos pos, Direction facing)
public void setPlayerCapabilities(PlayerEntity player)
public void setGameType(GameType type)
public boolean shouldDrawHUD()
public boolean onPlayerDestroyBlock(BlockPos pos)
public boolean clickBlock(BlockPos loc, Direction face)
public void resetBlockRemoving()
public boolean onPlayerDamageBlock(BlockPos posBlock, Direction directionFacing)
public float getBlockReachDistance()
public void tick()
public ActionResultType func_217292_a(ClientPlayerEntity p_217292_1_, ClientWorld p_217292_2_, Hand p_217292_3_, BlockRayTraceResult p_217292_4_)
public ActionResultType processRightClick(PlayerEntity player, World worldIn, Hand hand)
public ClientPlayerEntity createPlayer(ClientWorld p_199681_1_, StatisticsManager p_199681_2_, ClientRecipeBook p_199681_3_)
public void attackEntity(PlayerEntity playerIn, Entity targetEntity)
public ActionResultType interactWithEntity(PlayerEntity player, Entity target, Hand hand)
public ActionResultType interactWithEntity(PlayerEntity player, Entity target, EntityRayTraceResult ray, Hand hand)
public ItemStack windowClick(int windowId, int slotId, int mouseButton, ClickType type, PlayerEntity player)
public void sendPlaceRecipePacket(int p_203413_1_, IRecipe<?> p_203413_2_, boolean p_203413_3_)
public void sendEnchantPacket(int windowID, int button)
public void sendSlotPacket(ItemStack itemStackIn, int slotId)
public void sendPacketDropItem(ItemStack itemStackIn)
public void onStoppedUsingItem(PlayerEntity playerIn)
public boolean gameIsSurvivalOrAdventure()
public boolean isNotCreative()
public boolean isInCreativeMode()
public boolean extendedReach()
public boolean isRidingHorse()
public boolean isSpectatorMode()
public GameType getCurrentGameType()
public boolean getIsHittingBlock()
public void pickItem(int index)
public void func_225323_a(ClientWorld p_225323_1_, BlockPos p_225323_2_, BlockState p_225323_3_, CPlayerDiggingPacket.Action p_225323_4_, boolean p_225323_5_)