本文整理汇总了Java中net.minecraft.world.World.updateComparatorOutputLevel方法的典型用法代码示例。如果您正苦于以下问题:Java World.updateComparatorOutputLevel方法的具体用法?Java World.updateComparatorOutputLevel怎么用?Java World.updateComparatorOutputLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.updateComparatorOutputLevel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
if (!keepInventory) {
TileEntity tileEntity = worldIn.getTileEntity(pos);
if (tileEntity instanceof CraftiniumForgeTileEntity) {
CraftiniumForgeTileEntity entity = (CraftiniumForgeTileEntity) tileEntity;
InventoryHelper.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), entity.getFuel().getStackInSlot(0));
InventoryHelper.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), entity.getOutput().getStackInSlot(0));
InventoryHelper.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), entity.getInput().getStackInSlot(0));
if(!entity.isBrokenByCreative()) {
List<ItemStack> drops = this.getDrops(worldIn, pos, state, 0);
for (ItemStack stack : drops) {
spawnAsEntity(worldIn, pos, stack);
}
}
worldIn.updateComparatorOutputLevel(pos, this);
}
}
super.breakBlock(worldIn, pos, state);
}
示例2: 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)
{
if (!keepInventory)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityFurnace)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityFurnace)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
}
super.breakBlock(worldIn, pos, state);
}
示例3: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity!=null && tileentity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)) {
IItemHandler inventory = tileentity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
for (int i=0; i<inventory.getSlots(); i++) {
ItemStack itemstack = inventory.getStackInSlot(i);
if (!itemstack.isEmpty()) {
InventoryHelper.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), itemstack);
}
}
worldIn.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(worldIn, pos, state);
}
示例4: emptyInventoryInWorld
import net.minecraft.world.World; //导入方法依赖的package包/类
public static void emptyInventoryInWorld(World world, BlockPos pos, Block block, IInventory inventory) {
for (int i = 0; i < inventory.getSizeInventory(); ++i) {
ItemStack itemstack = inventory.getStackInSlot(i);
spawnItemStack(world, pos, itemstack);
inventory.setInventorySlotContents(i, ItemStackTools.getEmptyStack());
}
world.updateComparatorOutputLevel(pos, block);
// world.func_147453_f(x, y, z, block);
}
示例5: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock (World world, BlockPos pos, IBlockState state) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileBloomeryFurnace) {
InventoryHelper.dropInventoryItems(world, pos, (TileBloomeryFurnace)tile);
world.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(world, pos, state);
}
示例6: 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)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof IInventory)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(worldIn, pos, state);
}
示例7: updatePoweredState
import net.minecraft.world.World; //导入方法依赖的package包/类
private void updatePoweredState(World worldIn, BlockPos pos, IBlockState state)
{
boolean flag = ((Boolean)state.getValue(POWERED)).booleanValue();
boolean flag1 = false;
List<EntityMinecart> list = this.<EntityMinecart>findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[0]);
if (!list.isEmpty())
{
flag1 = true;
}
if (flag1 && !flag)
{
worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3);
worldIn.notifyNeighborsOfStateChange(pos, this);
worldIn.notifyNeighborsOfStateChange(pos.down(), this);
worldIn.markBlockRangeForRenderUpdate(pos, pos);
}
if (!flag1 && flag)
{
worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 3);
worldIn.notifyNeighborsOfStateChange(pos, this);
worldIn.notifyNeighborsOfStateChange(pos.down(), this);
worldIn.markBlockRangeForRenderUpdate(pos, pos);
}
if (flag1)
{
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn));
}
worldIn.updateComparatorOutputLevel(pos, this);
}
示例8: 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)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityHopper)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityHopper)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(worldIn, pos, state);
}
示例9: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityHopper)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityHopper)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(worldIn, pos, state);
}
示例10: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityInstrumentPlayer)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityInstrumentPlayer)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(worldIn, pos, state);
}
示例11: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityDispenser)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityDispenser)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(worldIn, pos, state);
}
示例12: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityAmmoFurnace) {
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityAmmoFurnace) tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(worldIn, pos, state);
}
示例13: 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)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityDispenser)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityDispenser)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(worldIn, pos, state);
}
示例14: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
if (!keepInventory)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityFurnace)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityFurnace)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
}
super.breakBlock(worldIn, pos, state);
}
示例15: breakBlock
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
TileEntity te = world.getTileEntity(pos);
if (te instanceof IInventory)
{
InventoryHelper.dropInventoryItems(world, pos, (IInventory) te);
world.updateComparatorOutputLevel(pos, this);
}
super.breakBlock(world, pos, state);
}