本文整理汇总了Java中net.minecraft.world.World.removeTileEntity方法的典型用法代码示例。如果您正苦于以下问题:Java World.removeTileEntity方法的具体用法?Java World.removeTileEntity怎么用?Java World.removeTileEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.removeTileEntity方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
TileEntityBloodVessel te = (TileEntityBloodVessel) worldIn.getTileEntity(pos);
int amount = te.getPossibleRemove();
int max = te.getMax();
worldIn.removeTileEntity(pos);
ItemStack stack = new ItemStack(this);
if(amount != 0)
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setInteger("BloodLevel", amount);
stack.setTagCompound(nbttagcompound);
stack.setStackDisplayName("�r" + getLocalizedName() + " [" + amount + "/" + max + "]");
}
if(!creativeBreakMap.containsKey(pos) || !creativeBreakMap.get(pos))
worldIn.spawnEntity(new EntityItem(worldIn, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack));
creativeBreakMap.remove(pos);
}
示例2: pickupBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
private void pickupBlock() {
EntityMeeCreeps meeCreep = (EntityMeeCreeps) helper.getMeeCreep();
World world = meeCreep.getWorld();
BlockPos pos = options.getTargetPos();
IBlockState state = world.getBlockState(pos);
if (!helper.allowedToHarvest(state, world, pos, options.getPlayer())) {
helper.showMessage("message.meecreeps.cant_pickup_block");
helper.taskIsDone();
return;
}
meeCreep.setHeldBlockState(state);
TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity != null) {
NBTTagCompound tc = new NBTTagCompound();
tileEntity.writeToNBT(tc);
world.removeTileEntity(pos);
tc.removeTag("x");
tc.removeTag("y");
tc.removeTag("z");
meeCreep.setCarriedNBT(tc);
}
world.setBlockToAir(pos);
}
示例3: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
/**
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
*/
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
super.breakBlock(worldIn, pos, state);
worldIn.removeTileEntity(pos);
this.notifyNeighbors(worldIn, pos, state);
}
示例4: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
final TileEntity tile1 = worldIn.getTileEntity(pos);
if (tile1 != null && tile1 instanceof TileOven) {
((TileOven) tile1).dropItems();
}
worldIn.removeTileEntity(pos);
}
示例5: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
if (world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileArtisia) {
ItemStack stack = ((TileArtisia)world.getTileEntity(pos)).getItem();
if (stack != null) {
world.removeTileEntity(pos);
spawnAsEntity(world, pos, stack);
}
}
super.breakBlock(world, pos, state);
}
示例6: grabChest
import net.minecraft.world.World; //导入方法依赖的package包/类
private void grabChest(TransportableChest chest, ItemStack stack, EntityPlayer player, World world, BlockPos pos)
{
TileEntity tile = world.getTileEntity(pos);
if (tile != null)
{
IBlockState iblockstate = world.getBlockState(pos);
Block chestBlock = iblockstate.getBlock();
getTagCompound(stack).setString("ChestName", chest.getRegistryName().toString());
if (chest.copyTileEntity())
{
NBTTagCompound nbt = new NBTTagCompound();
tile.writeToNBT(nbt);
getTagCompound(stack).setTag("ChestTile", nbt);
world.removeTileEntity(pos);
} else
{
IInventory inv = (IInventory) tile;
moveItemsIntoStack(inv, stack);
}
chest.preRemoveChest(world, pos, player, stack);
world.setBlockToAir(pos);
SoundType soundType = chestBlock.getSoundType();
world.playSound(player, pos, soundType.getPlaceSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F);
}
}
示例7: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
/**
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
*/
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
super.breakBlock(worldIn, pos, state);
worldIn.removeTileEntity(pos);
}
示例8: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
super.breakBlock(world, pos, state);
world.removeTileEntity(pos);
}
示例9: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
super.breakBlock(worldIn, pos, state);
worldIn.removeTileEntity(pos);
}
示例10: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
worldIn.removeTileEntity(pos);
}
示例11: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
super.breakBlock(worldIn, pos, state);
worldIn.removeTileEntity(pos);
}
示例12: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
super.breakBlock(worldIn, pos, state);
worldIn.removeTileEntity(pos);
this.notifyNeighbors(worldIn, pos, state);
}