public class ItemInWorldManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
curblockDamage |
private int |
durabilityRemainingOnBlock |
private BlockPos |
field_180240_f |
private BlockPos |
field_180241_i |
private WorldSettings.GameType |
gameType |
private int |
initialBlockDamage |
private int |
initialDamage |
private boolean |
isDestroyingBlock
True if the player is destroying a block
|
private boolean |
receivedFinishDiggingPacket
Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet.
|
World |
theWorld
The world object that this object is connected to.
|
EntityPlayerMP |
thisPlayerMP
The EntityPlayerMP object that this object is connected to.
|
Constructor and Description |
---|
ItemInWorldManager(World worldIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
activateBlockOrUseItem(EntityPlayer player,
World worldIn,
ItemStack stack,
BlockPos pos,
EnumFacing side,
float offsetX,
float offsetY,
float offsetZ)
Activate the clicked on block, otherwise use the held item.
|
void |
blockRemoving(BlockPos pos) |
void |
cancelDestroyingBlock()
Stops the block breaking process
|
WorldSettings.GameType |
getGameType() |
void |
initializeGameType(WorldSettings.GameType type)
if the gameType is currently NOT_SET then change it to par1
|
boolean |
isCreative()
Get if we are in creative game mode.
|
void |
onBlockClicked(BlockPos pos,
EnumFacing side)
If not creative, it calls sendBlockBreakProgress until the block is broken first.
|
private boolean |
removeBlock(BlockPos pos)
Removes a block and triggers the appropriate events
|
void |
setGameType(WorldSettings.GameType type) |
void |
setWorld(WorldServer serverWorld)
Sets the world instance.
|
boolean |
survivalOrAdventure() |
boolean |
tryHarvestBlock(BlockPos pos)
Attempts to harvest a block
|
boolean |
tryUseItem(EntityPlayer player,
World worldIn,
ItemStack stack)
Attempts to right-click use an item by the given EntityPlayer in the given World
|
void |
updateBlockRemoving() |
public World theWorld
public EntityPlayerMP thisPlayerMP
private WorldSettings.GameType gameType
private boolean isDestroyingBlock
private int initialDamage
private BlockPos field_180240_f
private int curblockDamage
private boolean receivedFinishDiggingPacket
private BlockPos field_180241_i
private int initialBlockDamage
private int durabilityRemainingOnBlock
public ItemInWorldManager(World worldIn)
public void setGameType(WorldSettings.GameType type)
public WorldSettings.GameType getGameType()
public boolean survivalOrAdventure()
public boolean isCreative()
public void initializeGameType(WorldSettings.GameType type)
public void updateBlockRemoving()
public void onBlockClicked(BlockPos pos, EnumFacing side)
public void blockRemoving(BlockPos pos)
public void cancelDestroyingBlock()
private boolean removeBlock(BlockPos pos)
public boolean tryHarvestBlock(BlockPos pos)
public boolean tryUseItem(EntityPlayer player, World worldIn, ItemStack stack)
public boolean activateBlockOrUseItem(EntityPlayer player, World worldIn, ItemStack stack, BlockPos pos, EnumFacing side, float offsetX, float offsetY, float offsetZ)
public void setWorld(WorldServer serverWorld)