本文整理了Java中net.minecraft.world.World.removeTileEntity()
方法的一些代码示例,展示了World.removeTileEntity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.removeTileEntity()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:removeTileEntity
暂无
代码示例来源:origin: EngineHub/WorldEdit
if (block instanceof BaseBlock && ((BaseBlock) block).hasNbtData()) {
world.removeTileEntity(pos);
NBTTagCompound nativeTag = NBTConverter.toNative(((BaseBlock) block).getNbtData());
nativeTag.setString("id", ((BaseBlock) block).getNbtId());
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void removeTileEntity(@Nonnull BlockPos pos) {
wrapped.removeTileEntity(pos);
}
代码示例来源:origin: NanamiArihara/FoodCraft-Reloaded
@Override
public void breakBlock(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
worldIn.removeTileEntity(pos);
}
代码示例来源:origin: NanamiArihara/FoodCraft-Reloaded
@Override
public void breakBlock(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
worldIn.removeTileEntity(pos);
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
world.removeTileEntity(pos);
super.breakBlock(world, pos, state);
}
代码示例来源:origin: raoulvdberge/refinedstorage
void removeTile(World world, BlockPos pos, IBlockState state) {
if (hasTileEntity(state)) {
world.removeTileEntity(pos);
}
}
代码示例来源:origin: ForestryMC/Binnie
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
super.breakBlock(world, pos, state);
world.removeTileEntity(pos);
}
代码示例来源:origin: SonarSonic/Calculator
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
if (!keepInventory) {
super.breakBlock(world, pos, state);
}
world.removeTileEntity(pos);
}
代码示例来源:origin: OpenModularTurretsTeam/OpenModularTurrets
@Override
@ParametersAreNonnullByDefault
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
if (!worldIn.isRemote) {
dropItems(worldIn, pos);
worldIn.removeTileEntity(pos);
}
}
代码示例来源:origin: TheCBProject/EnderStorage
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
super.breakBlock(worldIn, pos, state);
worldIn.removeTileEntity(pos);
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
IConduitBundle te = getTileEntity(world, pos);
if (te == null) {
return;
}
te.onBlockRemoved();
world.removeTileEntity(pos);
}
代码示例来源:origin: TheGreyGhost/MinecraftByExample
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
super.breakBlock(worldIn, pos, state);
worldIn.removeTileEntity(pos);
final boolean CASCADE_UPDATE = false; // I'm not sure what this flag does, but vanilla always sets it to false
// except for calls by World.setBlockState()
worldIn.notifyNeighborsOfStateChange(pos, this, CASCADE_UPDATE);
}
代码示例来源:origin: Darkhax-Minecraft/Bookshelf
@Override
public void breakBlock (World worldIn, BlockPos pos, IBlockState state) {
final TileEntity tile = worldIn.getTileEntity(pos);
if (tile instanceof TileEntityBasic) {
((TileEntityBasic) tile).onTileRemoved(worldIn, pos, state);
}
super.breakBlock(worldIn, pos, state);
worldIn.removeTileEntity(pos);
}
代码示例来源:origin: ForestryMC/Binnie
@Override
public void setBlock(World world, ITreeGenData tree, BlockPos pos) {
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
if (world.getTileEntity(pos) != null) {
world.removeTileEntity(pos);
}
}
}
代码示例来源:origin: NanamiArihara/FoodCraft-Reloaded
@Override
public void breakBlock(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
if (worldIn.getTileEntity(pos).hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)) {
IItemHandler itemHandler = worldIn.getTileEntity(pos).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
for (int i = 0; i < itemHandler.getSlots(); i++)
spawnAsEntity(worldIn, pos, itemHandler.getStackInSlot(i));
}
worldIn.removeTileEntity(pos);
}
代码示例来源:origin: OpenMods/OpenModsLib
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
if (shouldDropFromTeAfterBreak()) {
final TileEntity te = world.getTileEntity(pos);
if (te != null) {
if (te instanceof IBreakAwareTile)
((IBreakAwareTile)te).onBlockBroken();
for (ItemStack stack : getTileBreakDrops(te))
BlockUtils.dropItemStackInWorld(world, pos, stack);
world.removeTileEntity(pos);
}
}
super.breakBlock(world, pos, state);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public void removeTileEntity(BlockPos pos) {
if (part.getPartPos().equals(pos)) {
TileEntity tileentity = this.getTileEntity(pos);
if (tileentity != null) {
tileentity.invalidate();
}
this.updateComparatorOutputLevel(pos, getBlockState(pos).getBlock());
} else {
getActualWorld().removeTileEntity(pos);
}
}
代码示例来源:origin: OpenMods/OpenModsLib
public boolean remove() {
if (!world.isBlockLoaded(blockPos)) return false;
if (spawnProtection) {
if (!world.isBlockModifiable(player, blockPos)) return false;
}
if (eventCheck) {
final IBlockState blockState = world.getBlockState(blockPos);
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(world, blockPos, blockState, player);
event.setExpToDrop(0);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled()) return false;
}
if (silentTeRemove) world.removeTileEntity(blockPos);
return world.setBlockToAir(blockPos);
}
代码示例来源:origin: Vazkii/Quark
public static void detachTileEntities(World world, BlockPos sourcePos, BlockPistonStructureHelper helper, EnumFacing facing, boolean extending) {
if(!ModuleLoader.isFeatureEnabled(PistonsMoveTEs.class))
return;
List<BlockPos> moveList = helper.getBlocksToMove();
for(BlockPos pos : moveList) {
IBlockState state = world.getBlockState(pos);
if(state.getBlock().hasTileEntity(state)) {
TileEntity tile = world.getTileEntity(pos);
if(tile instanceof IPistonCallback)
((IPistonCallback) tile).onPistonMovementStarted();
world.removeTileEntity(pos);
registerMovement(world, pos.offset(facing), tile);
}
}
}
代码示例来源:origin: WayofTime/BloodMagic
@Override
public void onUpdate() {
if(!world.isRemote) {
EntityPlayer player = world.getClosestPlayer(getPos().getX(), getPos().getY(), getPos().getZ(), 10.0D, ItemSigilPhantomBridge.IS_PHANTOM_ACTIVE);
if (player != null && !player.isSneaking())
return;
ticksRemaining--;
}
if (ticksRemaining <= 0) {
world.setBlockToAir(getPos());
world.removeTileEntity(getPos());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!