public final class PlayerUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.reflect.Field |
currentBlockDamage
Access to the curBlockDamageMP field in the client-side PlayerControllerMP instance.
|
| Constructor and Description |
|---|
PlayerUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canPlayerSleep(net.minecraft.entity.player.EntityPlayer player)
Checks if a specific player can sleep.
|
static float |
getBlockDamage()
A client sided method used to retrieve the progression of the block currently being
mined by the player.
|
static net.minecraft.entity.player.EntityPlayer |
getClientPlayer()
Retrieves an instance of the player from the client side.
|
static net.minecraft.entity.player.EntityPlayer |
getPlayerFromCrafting(net.minecraft.inventory.InventoryCrafting inventory)
Retrieves the player that is crafting in an InventoryCrafting.
|
static net.minecraft.entity.player.EntityPlayer |
getPlayerFromUUID(net.minecraft.world.World world,
java.util.UUID playerID)
Retrieves an instance of EntityPlayer based on a UUID.
|
static boolean |
isPlayerReal(net.minecraft.entity.player.EntityPlayer player)
A simple check to make sure that an EntityPlayer actually exists.
|
static void |
tryAOEHarvest(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.block.material.Material[] materials,
int layers)
Attempts to harvest blocks in an AOE based effect around where the player is looking.
|
public static java.lang.reflect.Field currentBlockDamage
public static boolean canPlayerSleep(net.minecraft.entity.player.EntityPlayer player)
player: - The player to check the sleepability of.public static void tryAOEHarvest(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.block.material.Material[] materials,
int layers)
player: - The player who is attempting to harvest the block.materials: - An array of valid material types that this effect will be able to
break.layers: - The amount of layers to break. Each layer adds one more out in every
direction. For example 1 will break a 3x3 area, 2 will break a 5x5 area and 3
will break a 9x9 area.public static boolean isPlayerReal(net.minecraft.entity.player.EntityPlayer player)
player: - The instance of EntityPlayer to check.public static net.minecraft.entity.player.EntityPlayer getPlayerFromUUID(net.minecraft.world.World world,
java.util.UUID playerID)
world: - The world in which the target player resides.playerID: - A unique identifier associated with the target player.public static net.minecraft.entity.player.EntityPlayer getPlayerFromCrafting(net.minecraft.inventory.InventoryCrafting inventory)
inventory: - An instance of the InventoryCrafting being used.public static net.minecraft.entity.player.EntityPlayer getClientPlayer()
public static float getBlockDamage()