本文整理汇总了Java中net.minecraft.world.World.func_147453_f方法的典型用法代码示例。如果您正苦于以下问题:Java World.func_147453_f方法的具体用法?Java World.func_147453_f怎么用?Java World.func_147453_f使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.func_147453_f方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
if (!isBurning) {
TileEntityMachine tileEntity = (TileEntityMachine) world.getTileEntity(x, y, z);
if (tileEntity != null) {
for (int i = 0; i < tileEntity.getSizeInventory(); ++i) {
ItemStack itemStack = tileEntity.getStackInSlot(i);
if (itemStack != null) {
float f0 = random.nextFloat() * 0.8F + 0.1F;
float f1 = random.nextFloat() * 0.8F + 0.1F;
float f2 = random.nextFloat() * 0.8F + 0.1F;
while (itemStack.stackSize > 0) {
int j = random.nextInt(21) + 10;
if (j > itemStack.stackSize)
j = itemStack.stackSize;
itemStack.stackSize -= j;
EntityItem entityItem = new EntityItem(world, (double) ((float) x + f1), (double) ((float) y + f0), (double) ((float) z + f2), new ItemStack(itemStack.getItem(), j));
if (itemStack.hasTagCompound())
entityItem.getEntityItem().setTagCompound(((NBTTagCompound) itemStack.getTagCompound().copy()));
float f3 = 0.025F;
entityItem.motionX = (double) ((float) random.nextGaussian() * f3);
entityItem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.1F);
entityItem.motionZ = (double) ((float) random.nextGaussian() * f3);
world.spawnEntityInWorld(entityItem);
}
}
}
world.func_147453_f(x, y, z, block);
}
}
super.breakBlock(world, x, y, z, block, meta);
}
示例2: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
TileEntityAuto tileEntity = (TileEntityAuto) world.getTileEntity(x, y, z);
if(tileEntity != null) {
for(int i = 0; i < tileEntity.getSizeInventory(); ++i) {
ItemStack itemStack = tileEntity.getStackInSlot(i);
if(itemStack != null) {
float f0 = random.nextFloat() * 0.8F + 0.1F;
float f1 = random.nextFloat() * 0.8F + 0.1F;
float f2 = random.nextFloat() * 0.8F + 0.1F;
while(itemStack.stackSize > 0) {
int j = random.nextInt(21) + 10;
if(j > itemStack.stackSize)
j = itemStack.stackSize;
itemStack.stackSize -= j;
EntityItem entityItem = new EntityItem(world, (double) ((float) x + f1), (double) ((float) y + f0), (double) ((float) z + f2), new ItemStack(itemStack.getItem(), j));
if(itemStack.hasTagCompound())
entityItem.getEntityItem().setTagCompound(((NBTTagCompound) itemStack.getTagCompound().copy()));
float f3 = 0.025F;
entityItem.motionX = (double) ((float) random.nextGaussian() * f3);
entityItem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.1F);
entityItem.motionZ = (double) ((float) random.nextGaussian() * f3);
world.spawnEntityInWorld(entityItem);
}
}
}
world.func_147453_f(x, y, z, block);
}
super.breakBlock(world, x, y, z, block, meta);
}
示例3: breakBlockWithInventory
import net.minecraft.world.World; //导入方法依赖的package包/类
default void breakBlockWithInventory(World world, int x, int y, int z, Block oldblock, int oldMetadata)
{
if(!keepInventory)
{
TileKTWithInventory tileentity = (TileKTWithInventory) world.getTileEntity(x, y, z);
if(tileentity != null)
{
for(int i = 0; i < tileentity.getSizeInventory(); i++)
{
ItemStack itemstack = tileentity.getStackInSlot(i);
if(itemstack != null)
{
float f = this.rand.nextFloat() * 0.8F + 0.1F;
float f1 = this.rand.nextFloat() * 0.8F + 0.1F;
float f2 = this.rand.nextFloat() * 0.8F + 0.1F;
while(itemstack.stackSize > 0)
{
int j = this.rand.nextInt(21) + 10;
if(j > itemstack.stackSize)
j = itemstack.stackSize;
itemstack.stackSize -= j;
EntityItem item = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage()));
if(itemstack.hasTagCompound())
item.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
world.spawnEntityInWorld(item);
}
}
}
//Maybe this fucntion is about to replace block without meta data
world.func_147453_f(x, y, z, oldblock);
}
}
else
{
//some code to keep inventory
}
}