當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。