public class PlayerControllerMP
extends java.lang.Object
Constructor and Description |
---|
PlayerControllerMP(Minecraft mcIn,
NetHandlerPlayClient netHandler) |
Modifier and Type | Method and Description |
---|---|
void |
attackEntity(EntityPlayer playerIn,
Entity targetEntity)
Attacks an entity
|
boolean |
clickBlock(BlockPos loc,
EnumFacing face)
Called when the player is hitting a block with an item.
|
static void |
clickBlockCreative(Minecraft mcIn,
PlayerControllerMP playerController,
BlockPos pos,
EnumFacing facing) |
EntityPlayerSP |
createClientPlayer(World worldIn,
StatisticsManager statWriter) |
boolean |
extendedReach()
true for hitting entities far away.
|
void |
flipPlayer(EntityPlayer playerIn)
Flips the player around.
|
boolean |
gameIsSurvivalOrAdventure() |
float |
getBlockReachDistance()
player reach distance = 4F
|
GameType |
getCurrentGameType() |
boolean |
getIsHittingBlock()
Return isHittingBlock
|
EnumActionResult |
interactWithEntity(EntityPlayer player,
Entity target,
EnumHand heldItem)
Handles right clicking an entity, sends a packet to the server.
|
EnumActionResult |
interactWithEntity(EntityPlayer player,
Entity target,
RayTraceResult raytrace,
EnumHand heldItem)
Handles right clicking an entity from the entities side, 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 |
isSpectator()
None
|
boolean |
isSpectatorMode() |
boolean |
onPlayerDamageBlock(BlockPos posBlock,
EnumFacing directionFacing) |
boolean |
onPlayerDestroyBlock(BlockPos pos) |
void |
onStoppedUsingItem(EntityPlayer playerIn) |
void |
pickItem(int index) |
EnumActionResult |
processRightClick(EntityPlayer player,
World worldIn,
EnumHand stack) |
EnumActionResult |
processRightClickBlock(EntityPlayerSP player,
WorldClient worldIn,
BlockPos stack,
EnumFacing pos,
Vec3d facing,
EnumHand vec) |
void |
resetBlockRemoving()
Resets current block damage and field_78778_j
|
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 |
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(EntityPlayer player)
Sets player capabilities depending on current gametype.
|
boolean |
shouldDrawHUD() |
void |
updateController() |
ItemStack |
windowClick(int windowId,
int slotId,
int mouseButton,
ClickType type,
EntityPlayer player)
Handles slot clicks, sends a packet to the server.
|
public PlayerControllerMP(Minecraft mcIn, NetHandlerPlayClient netHandler)
public static void clickBlockCreative(Minecraft mcIn, PlayerControllerMP playerController, BlockPos pos, EnumFacing facing)
public void setPlayerCapabilities(EntityPlayer player)
public boolean isSpectator()
public void setGameType(GameType type)
public void flipPlayer(EntityPlayer playerIn)
public boolean shouldDrawHUD()
public boolean onPlayerDestroyBlock(BlockPos pos)
public boolean clickBlock(BlockPos loc, EnumFacing face)
public void resetBlockRemoving()
public boolean onPlayerDamageBlock(BlockPos posBlock, EnumFacing directionFacing)
public float getBlockReachDistance()
public void updateController()
public EnumActionResult processRightClickBlock(EntityPlayerSP player, WorldClient worldIn, BlockPos stack, EnumFacing pos, Vec3d facing, EnumHand vec)
public EnumActionResult processRightClick(EntityPlayer player, World worldIn, EnumHand stack)
public EntityPlayerSP createClientPlayer(World worldIn, StatisticsManager statWriter)
public void attackEntity(EntityPlayer playerIn, Entity targetEntity)
public EnumActionResult interactWithEntity(EntityPlayer player, Entity target, EnumHand heldItem)
public EnumActionResult interactWithEntity(EntityPlayer player, Entity target, RayTraceResult raytrace, EnumHand heldItem)
public ItemStack windowClick(int windowId, int slotId, int mouseButton, ClickType type, EntityPlayer player)
public void sendEnchantPacket(int windowID, int button)
public void sendSlotPacket(ItemStack itemStackIn, int slotId)
public void sendPacketDropItem(ItemStack itemStackIn)
public void onStoppedUsingItem(EntityPlayer 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)