当前位置: 首页>>代码示例>>Java>>正文


Java World.removeTileEntity方法代码示例

本文整理汇总了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);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:19,代码来源:BloodVessel.java

示例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);
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:26,代码来源:MoveStuffActionWorker.java

示例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);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:BlockRedstoneComparator.java

示例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);
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:9,代码来源:BlockOven.java

示例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);
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:13,代码来源:Artisia.java

示例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);
    }
}
 
开发者ID:cubex2,项目名称:chesttransporter,代码行数:29,代码来源:ItemChestTransporter.java

示例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);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:BlockContainer.java

示例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);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:BlockDroneRedstoneEmitter.java

示例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);
}
 
开发者ID:trigg,项目名称:Firma,代码行数:6,代码来源:OreBlock.java

示例10: breakBlock

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
    worldIn.removeTileEntity(pos);
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:5,代码来源:BlockSmeltingDrinkMachine.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:BlockContainer.java

示例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);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:7,代码来源:BlockRedstoneComparator.java


注:本文中的net.minecraft.world.World.removeTileEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。