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


Java TileEntityFurnace类代码示例

本文整理汇总了Java中net.minecraft.tileentity.TileEntityFurnace的典型用法代码示例。如果您正苦于以下问题:Java TileEntityFurnace类的具体用法?Java TileEntityFurnace怎么用?Java TileEntityFurnace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

TileEntityFurnace类属于net.minecraft.tileentity包,在下文中一共展示了TileEntityFurnace类的33个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: update

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@Override
public void update() {
    TileEntityFurnace furnace = getTileEntity();
    if (getHeatExchanger().getTemperature() > 373) {
        int furnaceBurnTime = furnace.getField(0);
        int furnaceCookTime = furnace.getField(2);
        if (furnaceBurnTime < 190 && !furnace.getStackInSlot(0).isEmpty()) {
            if (furnaceBurnTime == 0) BlockFurnace.setState(true, furnace.getWorld(), furnace.getPos());
            furnace.setField(1, 200); // currentItemBurnTime
            furnace.setField(0, furnaceBurnTime + 10); // furnaceBurnTime
            getHeatExchanger().addHeat(-1);
        }
        if (furnaceCookTime > 0) {
            // Easy performance saver, the Furnace won't be ticked unnecessary when there's nothing to
            // cook (or when just started cooking).
            int progress = Math.max(0, ((int) getHeatExchanger().getTemperature() - 343) / 30);
            progress = Math.min(5, progress);
            for (int i = 0; i < progress; i++) {
                furnace.update();
            }
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:24,代码来源:HeatBehaviourFurnace.java


示例2: onBlockActivated

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityFurnace)
        {
            playerIn.displayGUIChest((TileEntityFurnace)tileentity);
            playerIn.triggerAchievement(StatList.field_181741_Y);
        }

        return true;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:BlockFurnace.java


示例3: drawGuiContainerBackgroundLayer

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
/**
 * Args : renderPartialTicks, mouseX, mouseY
 */
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
    int i = (this.width - this.xSize) / 2;
    int j = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);

    if (TileEntityFurnace.isBurning(this.tileFurnace))
    {
        int k = this.getBurnLeftScaled(13);
        this.drawTexturedModalRect(i + 56, j + 36 + 12 - k, 176, 12 - k, 14, k + 1);
    }

    int l = this.getCookProgressScaled(24);
    this.drawTexturedModalRect(i + 79, j + 34, 176, 14, l + 1, 16);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:GuiFurnace.java


示例4: findMatchingFuel

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public static MachineFuel findMatchingFuel(ResourceLocation list, NonNullList<ItemStack> input)
{
    if (list.toString().equals("minecraft:vanilla"))
    {
        if (input.size() == 1 && !input.get(0).isEmpty())
        {
            ItemStack stack = input.get(0);
            int burnTime = TileEntityFurnace.getItemBurnTime(stack);
            if (burnTime > 0)
                return new VanillaFurnaceFuel(stack, burnTime);
        }

        return MachineFuel.EMPTY;
    }

    return findMatchingFuel(getInstance(list).fuels, input);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:18,代码来源:MachineManager.java


示例5: isPartOfFuel

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public static boolean isPartOfFuel(ResourceLocation list, ItemStack stack)
{
    if (stack.isEmpty())
        return false;

    if (list.toString().equals("minecraft:vanilla"))
    {
        return TileEntityFurnace.getItemBurnTime(stack) > 0;
    }

    for (MachineFuel fuel : getInstance(list).fuels)
    {
        if (fuel.getFuelInput().stream()
                .anyMatch(input -> ItemHelper.stackMatchesRecipeInput(stack, input, false)))
            return true;
    }

    return false;
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:20,代码来源:MachineManager.java


示例6: isStackValidForSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
private boolean isStackValidForSlot(int index, @Nonnull ItemStack stack)
{
    if (!slotChecksEnabled)
        return true;

    if (type.isOutputSlot(index))
    {
        return false;
    } else if (type.isInputSlot(index))
    {
        return true;
    } else
    {
        return TileEntityFurnace.isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack);
    }
}
 
开发者ID:cubex2,项目名称:morefurnaces,代码行数:17,代码来源:ItemHandlerFurnace.java


示例7: useOnVanillaFurnace

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
private boolean useOnVanillaFurnace(EntityPlayer playerIn, World world, BlockPos pos, ItemStack stack, Upgrades upgrade)
{
    TileEntity te = world.getTileEntity(pos);
    if (te != null && te instanceof TileEntityFurnace)
    {
        TileEntityFurnace furnace = (TileEntityFurnace) te;
        boolean upgraded = upgradeVanillaFurnace(world, pos, furnace, upgrade.getUpgradedType());

        if (upgraded && !playerIn.capabilities.isCreativeMode)
        {
            stack.shrink(1);
        }

        return true;
    }
    return false;
}
 
开发者ID:cubex2,项目名称:morefurnaces,代码行数:18,代码来源:ItemUpgrade.java


示例8: upgradeVanillaFurnace

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
private boolean upgradeVanillaFurnace(World world, BlockPos pos, TileEntityFurnace furnace, FurnaceType to)
{
    byte facing = (byte) world.getBlockState(pos).getValue(BlockFurnace.FACING).ordinal();
    TileEntityIronFurnace newFurnace = FurnaceType.makeEntity(to.ordinal());

    if (newFurnace != null)
    {
        int[][] fromSlotIds = new int[][] {new int[] {0}, new int[] {1}, new int[] {2}};

        copyInventory(furnace, fromSlotIds, newFurnace);

        world.setBlockState(pos, MoreFurnaces.blockFurnaces.getDefaultState().withProperty(BlockMoreFurnaces.VARIANT, to));
        world.setTileEntity(pos, newFurnace);

        newFurnace.copyStateFrom(furnace, facing);

        return true;
    } else
    {
        return false;
    }
}
 
开发者ID:cubex2,项目名称:morefurnaces,代码行数:23,代码来源:ItemUpgrade.java


示例9: onBlockActivated

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityFurnace)
        {
            playerIn.displayGUIChest((TileEntityFurnace)tileentity);
            playerIn.addStat(StatList.FURNACE_INTERACTION);
        }

        return true;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:BlockFurnace.java


示例10: breakBlock

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的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);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:BlockFurnace.java


示例11: drawGuiContainerBackgroundLayer

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
/**
 * Draws the background layer of this container (behind the items).
 */
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(FURNACE_GUI_TEXTURES);
    int i = (this.width - this.xSize) / 2;
    int j = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);

    if (TileEntityFurnace.isBurning(this.tileFurnace))
    {
        int k = this.getBurnLeftScaled(13);
        this.drawTexturedModalRect(i + 56, j + 36 + 12 - k, 176, 12 - k, 14, k + 1);
    }

    int l = this.getCookProgressScaled(24);
    this.drawTexturedModalRect(i + 79, j + 34, 176, 14, l + 1, 16);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:GuiFurnace.java


示例12: onBlockActivated

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityFurnace)
        {
            playerIn.displayGUIChest((TileEntityFurnace)tileentity);
            playerIn.addStat(StatList.FURNACE_INTERACTION);
        }

        return true;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:BlockFurnace.java


示例13: initialize

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public static void initialize() {
    NonNullList<ItemStack> stacks = NonNullList.create();
    for (Item i : ForgeRegistries.ITEMS) {
        CreativeTabs tab = i.getCreativeTab();
        if(tab != null) {
            i.getSubItems(tab, stacks);
        }
    }
    List<ItemStack> out = new LinkedList<>();
    for (ItemStack stack : stacks) {
        int burn = TileEntityFurnace.getItemBurnTime(stack); //Respects vanilla values.
        if(burn > 0) {
            out.add(stack);
        }
    }
    knownFuelStacks = ImmutableList.copyOf(out);
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:18,代码来源:FuelItemHelper.java


示例14: handleEntityCollision

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@Override
public boolean handleEntityCollision(World worldIn, BlockPos pos,
		IBlockState state, Entity entityIn) {
	if(entity.ticksExisted()%FUEL_EAT_TICKS==0 && !worldIn.isRemote){
		if(entityIn instanceof EntityItem){
			ItemStack stack = ((EntityItem)entityIn).getItem();
			//find the furnace burn time. if not hardcoded in vanilla furnace, it will check Forge's registered fuelHandlers
			int burnTime = TileEntityFurnace.getItemBurnTime(stack);
			if(burnTime!=0){
				this.addFuel(burnTime*stack.getCount());
				worldIn.playSound(null,entityIn.posX, entityIn.posY, entityIn.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 1, 1);
				worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, entityIn.posX, entityIn.posY, entityIn.posZ, 0, 0, 0);
				entityIn.setDead();
				IBlockState bstate = worldIn.getBlockState(getPos());
				worldIn.notifyBlockUpdate(getPos(), bstate, bstate, 3);
			}
		}
	}
	return true;
}
 
开发者ID:Xilef11,项目名称:runesofwizardry-classics,代码行数:21,代码来源:FueledRuneEntity.java


示例15: ignite

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
private boolean ignite() {
  ItemStack stackInSlot = furnace.getStackInSlot(fuel_slot);
  int burnTime = TileEntityFurnace.getItemBurnTime(stackInSlot);
  if (burnTime > 0) {
    furnace.setField(currentItemBurnTime_field, burnTime);
    furnace.setField(furnaceBurnTime_field, burnTime - 1);
    stackInSlot.stackSize--;
    if (stackInSlot.stackSize <= 0) {
      stackInSlot = stackInSlot.getItem().getContainerItem(stackInSlot);
    }
    furnace.setInventorySlotContents(fuel_slot, stackInSlot);
    BlockFurnace.setState(furnace.isBurning(), furnace.getWorld(), furnace.getPos());
    furnace.markDirty();
    return true;
  }
  return false;
}
 
开发者ID:HenryLoenwind,项目名称:mves,代码行数:18,代码来源:FurnaceCapabilityProvider.java


示例16: isItemValidForSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@Override
public boolean isItemValidForSlot(int slotID, ItemStack itemStack)
{
    if (slotID == 0)
    {
        return TileEntityFurnace.getItemBurnTime(itemStack) > 0;
    }
    else if (slotID >= 2)
    {
    	if (this.producingStack != null)
    	{
            ItemStack stackInSlot = this.getStackInSlot(slotID);
            return stackInSlot != null && stackInSlot.isItemEqual(itemStack);
    	}
    	return TileEntityIngotCompressor.isItemCompressorInput(itemStack);
    }

    return false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:TileEntityIngotCompressor.java


示例17: findFuels

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
private static void findFuels()
{
    IngotCompressorRecipeHandler.afuels = new ArrayList<FuelPair>();
    for (ItemStack item : ItemList.items)
    {
        if (!IngotCompressorRecipeHandler.efuels.contains(Item.getIdFromItem(item.getItem())))
        {
            int burnTime = TileEntityFurnace.getItemBurnTime(item);
            if (burnTime > 0)
            {
                FuelPair fuelPair = new FuelPair(item.copy(), burnTime);
                fuelPair.stack.relx = 57;
                fuelPair.stack.rely = 83;
                IngotCompressorRecipeHandler.afuels.add(fuelPair);
            }
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:IngotCompressorRecipeHandler.java


示例18: getItemEnergyValue

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public static int getItemEnergyValue(ItemStack fuel)
{
    if (!ItemStackTools.isValid(fuel)) {
      return 0;
    }
    int amt = GameRegistry.getFuelValue(fuel);
    if(amt == 0)amt = TileEntityFurnace.getItemBurnTime(fuel);
    //{ 10000, 400000, 2000000, 10000000}
    /*TE
     * (COAL)1600
     * (VALUE)1600*10*3/2 = 24000
     * (LEADSTONE)24000/10000=2.4
     * (HARD)24000/400000=0.06
     * (REDSTONE)24000/2000000=0.012
     * (RESONENT)24000/10000000=0.0024
     * */
    /*CU
     * (NEW)24000/5=4800
     * (BLUE)4800/10000=0.48 (+ADV) = 0.96
     * (RED)4800/400000=0.012 (+ADV) = 0.024
     * (GREEN)4800/2000000=0.0024 (+ADV) = 0.0048
     * (DARK)4800/10000000=0.00048 (+ADV) = 0.00096
     */
    
    return amt;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:27,代码来源:TileEntityEngineFurnace.java


示例19: onRenderTick

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event) {
	EntityPlayer player = (EntityPlayer) Minecraft.getMinecraft().thePlayer;
	if (player != null) {
		if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().toString().contains("tile.air")) {
			ItemStack held = player.getHeldItemMainhand();
			InventoryPlayer playerInv = player.inventory;
			if (held.getItem() instanceof ItemPickaxe) {
				if(held.serializeNBT().getInteger("BurnTimeLeft") == 0){
					for (int i = 0; i < playerInv.getSizeInventory(); i++) {
						if (playerInv.getStackInSlot(i).getItem() == Items.COAL) {
							held.serializeNBT().setInteger("BurnTimeLeft",
									TileEntityFurnace.getItemBurnTime(playerInv.getStackInSlot(i)));
							break;
						}
					}						
				}
			}
		}
	}
}
 
开发者ID:GummyBlasian,项目名称:Inventory-Power,代码行数:22,代码来源:AutoOreSmeltingEvent.java


示例20: ContainerSourceLight

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public ContainerSourceLight(EntityPlayer player, IItemHandler burningSlot, TileEntitySourceLight tileEntity) {
    this.tileEntity = Optional.fromNullable(tileEntity);
    this.burningSlot = Preconditions.checkNotNull(burningSlot);

    this.addSlotToContainer(new SlotItemHandler(this.burningSlot, 0, 56, 51) {
        @Override
        public boolean isItemValid(ItemStack stack) {
            return TileEntityFurnace.isItemFuel(stack) && super.isItemValid(stack);
        }
    });

    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 9; ++j) {
            this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
        }
    }

    for (int i = 0; i < 9; ++i) {
        this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
    }
}
 
开发者ID:InfinityStudio,项目名称:InspiringWorld,代码行数:22,代码来源:ContainerSourceLight.java


示例21: heatLogic

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
private void heatLogic()
{
    if (this.heat > this.getMinimumTemp())
        this.heat -= 0.5f;
    if (this.heat < this.getMinimumTemp())
        this.heat = this.getMinimumTemp();
    if (this.heat >= this.maxHeat)
        return;

    if (!this.getStackInSlot(4).isEmpty() && this.maxBurnTime == 0)
        this.maxBurnTime = TileEntityFurnace.getItemBurnTime(this.decrStackSize(4, 1));

    if (this.maxBurnTime != 0)
    {
        this.currentBurnTime++;
        this.heat++;
    }

    if (this.currentBurnTime >= this.maxBurnTime)
    {
        this.currentBurnTime = 0;
        this.maxBurnTime = 0;
    }
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:25,代码来源:TileAlloyCauldron.java


示例22: findFuels

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
private static void findFuels() {
    afuels = new ArrayList<>();
    Set<Item> efuels = excludedFuels();
    for (ItemStack item : ItemList.items) {
        Block block = Block.getBlockFromItem(item.getItem());
        if (block instanceof BlockDoor) {
            continue;
        }
        if (efuels.contains(item.getItem())) {
            continue;
        }

        int burnTime = TileEntityFurnace.getItemBurnTime(item);
        if (burnTime > 0) {
            afuels.add(new FuelPair(item.copy(), burnTime));
        }
    }
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:19,代码来源:FurnaceRecipeHandler.java


示例23: tryDistill

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public void tryDistill() {
	if (this.amIBottom()) {
		if (this.getFluidAmount() > 0 && this.getFluid().isFluidEqual(new FluidStack(ModBlocks.fluidOil, 0))) {
			// WE have oil.
			if (remainBurnTime > 0) {
				// we have fuel

				distill();
			} else {

				// consume more fuel
				// only if it has mash to process
				// use the furnace's default burn times
				remainBurnTime = TileEntityFurnace.getItemBurnTime(this.getStackInSlot(0));
				if (remainBurnTime > 0) {
					// found fuel reduce item stack (AKA consume /brun the item)
					decrStackSize(0, 1);
				}

			}
		}
	}
}
 
开发者ID:TechStack,项目名称:TechStack-s-HeavyMachineryMod,代码行数:24,代码来源:TileEntityFractionalDistillation.java


示例24: update

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@Override
public void update() {
	if (!world.isRemote) {
		// LogHelper.info("TE update entity called");

		if (remainBurnTime > 0) {
			remainBurnTime--;

			transferFuel();
		} else {

			// consume more fuel
			// only if it has mash to process
			if (fuelStorage > 0) {
				// use the furnace's default burn times
				remainBurnTime = TileEntityFurnace.getItemBurnTime(this.getStackInSlot(0));
				if (remainBurnTime > 0) {
					// found fuel reduce item stack (AKA consume /brun the item)
					decrStackSize(0, 1);
				}
			}
		}
	}
}
 
开发者ID:TechStack,项目名称:TechStack-s-HeavyMachineryMod,代码行数:25,代码来源:TileEntityDistiller.java


示例25: drawGuiContainerBackgroundLayer

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) {
    GL11.glEnable(GL11.GL_BLEND);
    this.mc.getTextureManager().bindTexture(new ResourceLocation("exoticpower", "textures/gui/container/elementgenerator.png"));
    int k = (this.width - this.xSize) / 2;
    int l = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
    int i1;
    if (TileEntityFurnace.isBurning(this.tile)) {
        i1 = this.func_175382_i(13);
        this.drawTexturedModalRect(k + 61, l + 38 + 12 - i1, 176, 12 - i1, 18, i1 + 1);
    }
    i1 = this.tile.energy * 53 / this.tile.capacity;
    this.drawTexturedModalRect(k + 97, (int) l + 18 + 53 - i1, 176, (int) 13 + 53 - i1, 18, (int) i1 + 1);
    if (mouseX > k + 97 && mouseX < k + 114 && mouseY > l + 18 && mouseY < l + 70) {
        drawHoveringText(Arrays.asList(new String[]{this.tile.energy + "/" + this.tile.capacity}), mouseX, mouseY, fontRendererObj);
    }
}
 
开发者ID:InfinityStudio,项目名称:ExoticPower,代码行数:19,代码来源:GuiElementGenerator.java


示例26: onItemTooltipEvent

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onItemTooltipEvent(ItemTooltipEvent event) {
  if (Keyboard.isCreated()
      && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT))) {
    // https://www.reddit.com/r/minecraftsuggestions/comments/3brh7v/when_hovering_over_a_food_it_shows_how_many_food/
    ItemStack itemStack = event.getItemStack();
    if (itemStack == null || itemStack.getItem() == null) {
      return;
    }
    if (foodDetails && itemStack.getItem() instanceof ItemFood) {
      ItemFood food = (ItemFood) itemStack.getItem();
      int hunger = food.getHealAmount(itemStack);
      float satur = food.getSaturationModifier(itemStack);
      if (hunger > 0 || satur > 0) {
        event.getToolTip().add(hunger + " (" + satur + ")");
      }
    }
    if (fuelDetails) {
      int burnTime = TileEntityFurnace.getItemBurnTime(itemStack);
      if (burnTime > 0) {
        event.getToolTip().add(UtilChat.lang("tooltip.burntime") + burnTime);
      }
    }
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:27,代码来源:TextInfoModule.java


示例27: drawGuiContainerBackgroundLayer

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
/**
 * Args : renderPartialTicks, mouseX, mouseY
 */
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
    int x = (this.width - this.xSize) / 2;
    int y = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);

    if (TileEntityFurnace.isBurning(this.tileFurnace)) {
        int cookTime = this.getCookTimeScaled(13);
        this.drawTexturedModalRect(x + 45, y + 36 + 12 - cookTime, 176, 12 - cookTime, 14, cookTime + 1);
    }

    int burnTime = this.getBurnTimeScaled(24);
    this.drawTexturedModalRect(x + 79, y + 34, 176, 14, burnTime + 1, 16);
}
 
开发者ID:TEAMModding,项目名称:FutureCraft,代码行数:19,代码来源:GuiAlloyFurnace.java


示例28: update

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@Override
public void update()
{
    if (burnTime <= 0)
    {
        if (machineCore.isMachineOn() && power < MAX_POWER)
        {
            burnTime = TileEntityFurnace.getItemBurnTime(getInventory().getStackInSlot(0));
        }
    }
    else
    {
        burnTime--;
        if (power < MAX_POWER)
        {
            power += POWER_PER_TICK;
        }
    }
}
 
开发者ID:BuiltBrokenModding,项目名称:BasicIndustry,代码行数:20,代码来源:PowerModuleBurner.java


示例29: canStore

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@Override
public boolean canStore(ItemStack stack, int slot, ForgeDirection side)
{
    if (slot == 0 || slot == 1)
    {
        if (BasicIndustry.doInputSlotValidationChecks)
        {
            return MachineRecipeType.ITEM_SMELTER.getHandler().getRecipe(new Object[]{stack}, 0, 0) instanceof ItemStack;
        }
        return true;
    }
    else if (slot == 4)
    {
        return TileEntityFurnace.isItemFuel(stack);
    }
    return false;
}
 
开发者ID:BuiltBrokenModding,项目名称:BasicIndustry,代码行数:18,代码来源:TileFurnace.java


示例30: isItemValidForSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
@Override
public boolean isItemValidForSlot( int slot, ItemStack item )
{
	if ( item == null )
	{
		return true;
	}
	
	if ( slot == FUEL_SLOT )
	{
		return ( TileEntityFurnace.getItemBurnTime( item ) > 0 );
	}
	else if ( slot == BLOCK_SLOT )
	{
		return ( item.getItem() == Item.getItemFromBlock( ComponentEquipment.blocks.ingot ) && item.getItemDamage() == IngotItem.PERSISTIUM );
	}
	else if ( slot == TOOL_SLOT )
	{
		return ( item.getItem() instanceof EquipmentItem );
	}

	return true;
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:24,代码来源:PersistiumInfuserTileEntity.java


示例31: onBlockActivated

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
/**
 * Called upon block activation (right click on the block.)
 */
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
    if (p_149727_1_.isClient)
    {
        return true;
    }
    else
    {
        TileEntityFurnace var10 = (TileEntityFurnace)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_);

        if (var10 != null)
        {
            p_149727_5_.func_146101_a(var10);
        }

        return true;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:22,代码来源:BlockFurnace.java


示例32: ContainerFurnace

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
public ContainerFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace)
{
    this.furnace = par2TileEntityFurnace;
    this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17));
    this.addSlotToContainer(new Slot(par2TileEntityFurnace, 1, 56, 53));
    this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityFurnace, 2, 116, 35));
    int var3;

    for (var3 = 0; var3 < 3; ++var3)
    {
        for (int var4 = 0; var4 < 9; ++var4)
        {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
        }
    }

    for (var3 = 0; var3 < 9; ++var3)
    {
        this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:22,代码来源:ContainerFurnace.java


示例33: onBlockActivated

import net.minecraft.tileentity.TileEntityFurnace; //导入依赖的package包/类
/**
 * Called upon block activation (right click on the block.)
 */
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
    if (par1World.isRemote)
    {
        return true;
    }
    else
    {
        TileEntityFurnace tileentityfurnace = (TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4);

        if (tileentityfurnace != null)
        {
            par5EntityPlayer.displayGUIFurnace(tileentityfurnace);
        }

        return true;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:22,代码来源:BlockFurnace.java



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