public class ItemInWorldManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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
|
double |
getBlockReachDistance() |
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. tryHarvestBlock can also be the
result of this call.
|
void |
setBlockReachDistance(double distance) |
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
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()
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)
public double getBlockReachDistance()
public void setBlockReachDistance(double distance)