Java Code Examples for net.minecraft.world.World#updateComparatorOutputLevel()
The following examples show how to use
net.minecraft.world.World#updateComparatorOutputLevel() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: TofuCraftReload File: BlockSaltFurnace.java License: MIT License | 6 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntitySaltFurnace) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntitySaltFurnace)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); }
Example 2
Source Project: TofuCraftReload File: BlockTFOven.java License: MIT License | 6 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityTFOven) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTFOven)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); }
Example 3
Source Project: TofuCraftReload File: BlockAdvancedAggregator.java License: MIT License | 6 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntitySoymilkAdvancedAggregator) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntitySoymilkAdvancedAggregator)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); }
Example 4
Source Project: TofuCraftReload File: BlockAggregator.java License: MIT License | 6 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntitySoymilkAggregator) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntitySoymilkAggregator)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); }
Example 5
Source Project: TofuCraftReload File: BlockTFCrasher.java License: MIT License | 6 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityTFCrasher) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTFCrasher)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); }
Example 6
Source Project: TofuCraftReload File: BlockTFCompressor.java License: MIT License | 6 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityTFCompressor) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTFCompressor)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); }
Example 7
Source Project: Survivalist File: SawmillBlock.java License: BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (state.getBlock() != newState.getBlock()) { TileEntity te = worldIn.getTileEntity(pos); if (te instanceof SawmillTileEntity) { dropInventoryItems(worldIn, pos, ((SawmillTileEntity) te).getInventory()); worldIn.updateComparatorOutputLevel(pos, this); } super.onReplaced(state, worldIn, pos, newState, isMoving); } }
Example 8
Source Project: TofuCraftReload File: BlockTFBattery.java License: MIT License | 5 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityTofuBattery) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTofuBattery) tileentity); worldIn.updateComparatorOutputLevel(pos, this); } super.breakBlock(worldIn, pos, state); }
Example 9
Source Project: TofuCraftReload File: BlockTFStorage.java License: MIT License | 5 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityTFStorage) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityTFStorage) tileentity); worldIn.updateComparatorOutputLevel(pos, this); } super.breakBlock(worldIn, pos, state); }
Example 10
Source Project: Sakura_mod File: BlockMapleSyrupCauldron.java License: MIT License | 5 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity te = worldIn.getTileEntity(pos); if (te instanceof TileEntityMapleCauldron) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityMapleCauldron)te); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); }
Example 11
Source Project: Sakura_mod File: BlockStoneMortar.java License: MIT License | 5 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityStoneMortar) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityStoneMortar) tileentity); worldIn.updateComparatorOutputLevel(pos, this); } super.breakBlock(worldIn, pos, state); }
Example 12
Source Project: Sakura_mod File: BlockCampfirePot.java License: MIT License | 5 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity te = worldIn.getTileEntity(pos); if (te instanceof TileEntityCampfirePot) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityCampfirePot)te); worldIn.updateComparatorOutputLevel(pos, this); } spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(BlockLoader.CAMPFIRE_IDLE))); spawnAsEntity(worldIn, pos, new ItemStack(ItemLoader.POT)); } super.breakBlock(worldIn, pos, state); }
Example 13
Source Project: Survivalist File: ChoppingBlock.java License: BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (newState.getBlock() != state.getBlock()) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof ChoppingBlockTileEntity) { dropInventoryItems(worldIn, pos, ((ChoppingBlockTileEntity) tileentity).getSlotInventory()); worldIn.updateComparatorOutputLevel(pos, this); } super.onReplaced(state, worldIn, pos, newState, isMoving); } }
Example 14
Source Project: Survivalist File: DryingRackBlock.java License: BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (newState.getBlock() != state.getBlock()) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof DryingRackTileEntity) { dropInventoryItems(worldIn, pos, ((DryingRackTileEntity) tileentity).inventory()); worldIn.updateComparatorOutputLevel(pos, this); } super.onReplaced(state, worldIn, pos, newState, isMoving); } }
Example 15
Source Project: TFC2 File: BlockFirepit.java License: GNU General Public License v3.0 | 5 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof IInventory) { InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } super.breakBlock(worldIn, pos, state); }
Example 16
Source Project: enderutilities File: BlockEnderUtilitiesInventory.java License: GNU Lesser General Public License v3.0 | 5 votes |
@Override public void breakBlock(World world, BlockPos pos, IBlockState state) { TileEntityEnderUtilitiesInventory te = getTileEntitySafely(world, pos, TileEntityEnderUtilitiesInventory.class); if (te != null && te.getBaseItemHandler() != null) { InventoryUtils.dropInventoryContentsInWorld(world, pos, te.getBaseItemHandler()); world.updateComparatorOutputLevel(pos, this); } world.removeTileEntity(pos); }
Example 17
Source Project: enderutilities File: BlockStorage.java License: GNU Lesser General Public License v3.0 | 5 votes |
@Override public void breakBlock(World world, BlockPos pos, IBlockState state) { if (state.getValue(TYPE).retainsContents()) { world.updateComparatorOutputLevel(pos, this); world.removeTileEntity(pos); } else { super.breakBlock(world, pos, state); } }
Example 18
Source Project: enderutilities File: BlockBarrel.java License: GNU Lesser General Public License v3.0 | 5 votes |
@Override public void breakBlock(World world, BlockPos pos, IBlockState state) { if (state.getValue(CREATIVE) || this.retainsContentsWhenBroken(world, pos, state)) { world.updateComparatorOutputLevel(pos, this); world.removeTileEntity(pos); } else { TileEntityBarrel te = getTileEntitySafely(world, pos, TileEntityBarrel.class); if (te != null) { InventoryUtils.dropInventoryContentsInWorld(world, pos, te.getUpgradeInventory()); // Fail-safe for not spawning hundreds of thousands of items in the world, // if there is no structure upgrade installed and a barrel is forcibly broken (in Creative mode for example). ItemStack stack = te.getBaseItemHandler().getStackInSlot(0); if (stack.isEmpty() == false) { EntityUtils.dropItemStacksInWorld(world, pos, stack, Math.min(stack.getCount(), 4096), true); } world.updateComparatorOutputLevel(pos, this); world.removeTileEntity(pos); } } }
Example 19
Source Project: enderutilities File: BlockMSU.java License: GNU Lesser General Public License v3.0 | 4 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { worldIn.updateComparatorOutputLevel(pos, this); worldIn.removeTileEntity(pos); }
Example 20
Source Project: enderutilities File: BlockASU.java License: GNU Lesser General Public License v3.0 | 4 votes |
@Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { worldIn.updateComparatorOutputLevel(pos, this); worldIn.removeTileEntity(pos); }