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


Java TileEntityFurnace.isItemFuel方法代码示例

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


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

示例1: 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

示例2: addPressureStatInfo

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
protected void addPressureStatInfo(List<String> pressureStatText) {
    super.addPressureStatInfo(pressureStatText);
    if (te.getBurnTimeRemainingScaled(12) > 0 || TileEntityFurnace.isItemFuel(te.getPrimaryInventory().getStackInSlot(0)) && te.redstoneAllows()) {
        pressureStatText.add("\u00a77Currently producing:");
        pressureStatText.add("\u00a70" + (double) Math.round(te.getBaseProduction() * te.getEfficiency() * te.getSpeedMultiplierFromUpgrades() / 100) + " mL/tick.");
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:GuiAirCompressor.java

示例3: addProblems

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
protected void addProblems(List<String> textList) {
    super.addProblems(textList);
    if (te.burnTime <= 0 && !TileEntityFurnace.isItemFuel(te.getPrimaryInventory().getStackInSlot(0))) {
        textList.add("\u00a77No fuel!");
        textList.add("\u00a70Insert any burnable item.");
    }
    List<Pair<EnumFacing, IAirHandler>> teSurrounding = te.getAirHandler(null).getConnectedPneumatics();
    if (teSurrounding.isEmpty()) {
        textList.add("\u00a77Air leaking!");
        textList.add("\u00a70Add pipes / machines");
        textList.add("\u00a70to the output.");
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:15,代码来源:GuiAirCompressor.java

示例4: update

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
public void update() {
    if (!getWorld().isRemote) {
        ItemStack fuelStack = inventory.getStackInSlot(FUEL_SLOT).copy();
        if (burnTime < curFuelUsage && TileEntityFurnace.isItemFuel(fuelStack) && redstoneAllows()) {
            burnTime += TileEntityFurnace.getItemBurnTime(fuelStack);
            maxBurnTime = burnTime;

            ItemStack containerStack  = fuelStack.getItem().getContainerItem(fuelStack);
            fuelStack.shrink(1);
            inventory.setStackInSlot(FUEL_SLOT, fuelStack.isEmpty() ? containerStack : fuelStack);
        }

        curFuelUsage = (int) (getBaseProduction() * getSpeedUsageMultiplierFromUpgrades() / 10);
        if (burnTime >= curFuelUsage) {
            burnTime -= curFuelUsage;
            if (!getWorld().isRemote) {
                addAir((int) (getBaseProduction() * getSpeedMultiplierFromUpgrades() * getEfficiency() / 100D));
                onFuelBurn(curFuelUsage);
            }
        }
        boolean wasActive = isActive;
        isActive = burnTime > curFuelUsage;
        if (wasActive != isActive) {
            getWorld().setBlockState(getPos(), getWorld().getBlockState(getPos()).withProperty(BlockAirCompressor.ON, isActive));
        }
    } else if (isActive) spawnBurningParticle();

    super.update();

    if (!getWorld().isRemote) {
        List<Pair<EnumFacing, IAirHandler>> teList = getAirHandler(null).getConnectedPneumatics();
        if (teList.size() == 0) getAirHandler(null).airLeak(getRotation());
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:36,代码来源:TileEntityAirCompressor.java

示例5: canMachineInsert

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
public boolean canMachineInsert(int slot, ItemStack stack) {
	if (slot == 1 && TileEntityFurnace.isItemFuel(stack))
		return true;
	if (slot == 2 && stack.getItem() == ModItems.fume && stack.getMetadata() == 1)
		return true;
	if (slot == 0)
		return true;
	return false;
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:11,代码来源:TileOven.java

示例6: transferStackInSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
protected boolean transferStackInSlot(Slot slot, int index, ItemStack stack1, ItemStack stack)
{
    if (isOutputSlot(index))
    {
        if (!this.mergeItemStack(stack1, type.getNumSlots(), type.getNumSlots() + 36, true))
            return true;

        slot.onSlotChange(stack1, stack);
    } else if (!isInputSlot(index) && !isFuelSlot(index))
    {
        if (!FurnaceRecipes.instance().getSmeltingResult(stack1).isEmpty())
        {
            if (!this.mergeItemStack(stack1, 0, type.getFirstFuelSlot(), false))
                return true;
        } else if (TileEntityFurnace.isItemFuel(stack1))
        {
            if (!this.mergeItemStack(stack1, type.getFirstFuelSlot(), type.getFirstOutputSlot(0), false))
                return true;
        } else if (index >= type.getNumSlots() && index < type.getNumSlots() + 27)
        {
            if (!this.mergeItemStack(stack1, type.getNumSlots() + 27, type.getNumSlots() + 36, false))
                return true;
        } else if (index >= type.getNumSlots() + 27 && index < type.getNumSlots() + 36 && !this.mergeItemStack(stack1, type.getNumSlots(), type.getNumSlots() + 27, false))
            return true;
    } else if (!this.mergeItemStack(stack1, type.getNumSlots(), type.getNumSlots() + 36, false))
        return true;

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

示例7: transferStackInSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
    ItemStack oldStack = null;
    Slot slot = this.inventorySlots.get(index);
    // 0: burning slot
    // 1-27: 27 player inventory slot
    // 28-36: 9 other player inventory slot
    if (slot != null && slot.getHasStack()) {
        ItemStack mergedStack = slot.getStack();
        oldStack = mergedStack.copy();

        if (index == 0) {
            if (!this.mergeItemStack(mergedStack, 1, 37, true)) {
                return null;
            }
        } else if (TileEntityFurnace.isItemFuel(mergedStack)) {
            if (!this.mergeItemStack(mergedStack, 0, 1, false)) {
                return null;
            }
        } else if (index >= 1 && index < 28) {
            if (!this.mergeItemStack(mergedStack, 28, 37, false)) {
                return null;
            }
        } else if (index >= 28 && index < 37) {
            if (!this.mergeItemStack(mergedStack, 1, 28, false)) {
                return null;
            }
        }

        if (mergedStack.stackSize == 0) {
            slot.putStack(null);
        } else {
            slot.onSlotChanged();
        }
    }
    return oldStack;
}
 
开发者ID:InfinityStudio,项目名称:InspiringWorld,代码行数:38,代码来源:ContainerSourceLight.java

示例8: insertItem

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Nonnull
@Override
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
{
    if (!TileEntityFurnace.isItemFuel(stack))
        return stack;

    return super.insertItem(slot, stack, simulate);
}
 
开发者ID:gigaherz,项目名称:Survivalist,代码行数:10,代码来源:TileSawmill.java

示例9: transferStackInSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
  ItemStack stack = ItemStack.EMPTY;
  Slot slotObject = (Slot) inventorySlots.get(slot);
  // null checks and checks if the item can be stacked (maxStackSize > 1)
  if (slotObject != null && slotObject.getHasStack()) {
    ItemStack stackInSlot = slotObject.getStack();
    stack = stackInSlot.copy();
    // merges the item into player inventory since its in the tileEntity
    if (slot < tileEntity.getSizeInventory()) {
      if (!this.mergeItemStack(stackInSlot, tileEntity.getSizeInventory(), 36 + tileEntity.getSizeInventory(), true)) {
        return ItemStack.EMPTY;
      }
    }
    else if (TileEntityFurnace.isItemFuel(stack)) {
      //fuel slot
      if (!this.mergeItemStack(stackInSlot, 0, tile.getSizeInventory(), true)) {
        return ItemStack.EMPTY;
      }
      //        else if (!this.mergeItemStack(stackInSlot, 0, tile.getSizeInventory()-1, false)) { return ItemStack.EMPTY; }
    }
    else if (!this.mergeItemStack(stackInSlot, 0, tileEntity.getSizeInventory(), true)) {
      return ItemStack.EMPTY;
    }
    if (stackInSlot.getCount() == 0) {
      slotObject.putStack(ItemStack.EMPTY);
    }
    else {
      slotObject.onSlotChanged();
    }
    if (stackInSlot.getCount() == stack.getCount()) {
      return ItemStack.EMPTY;
    }
    slotObject.onTake(player, stackInSlot);
  }
  return stack;
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:38,代码来源:ContainerCrafter.java

示例10: transferStackInSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
  ItemStack stack = ItemStack.EMPTY;
  Slot slotObject = (Slot) inventorySlots.get(slot);
  // null checks and checks if the item can be stacked (maxStackSize > 1)
  if (slotObject != null && slotObject.getHasStack()) {
    ItemStack stackInSlot = slotObject.getStack();
    stack = stackInSlot.copy();
    // merges the item into player inventory since its in the tileEntity
    if (slot < tile.getSizeInventory()) {
      if (!this.mergeItemStack(stackInSlot, tile.getSizeInventory(), 36 + tile.getSizeInventory(), true)) {
        return ItemStack.EMPTY;
      }
    }
    else if (TileEntityFurnace.isItemFuel(stack)) {
      //fuel slot
      if (!this.mergeItemStack(stackInSlot, 0, tile.getSizeInventory(), true)) {
        return ItemStack.EMPTY;
      }
      //        else if (!this.mergeItemStack(stackInSlot, 0, tile.getSizeInventory()-1, false)) { return ItemStack.EMPTY; }
    }
    else if (!this.mergeItemStack(stackInSlot, 0, tile.getSizeInventory(), false)) {
      return ItemStack.EMPTY;
    }
    if (stackInSlot.getCount() == 0) {
      slotObject.putStack(ItemStack.EMPTY);
    }
    else {
      slotObject.onSlotChanged();
    }
    if (stackInSlot.getCount() == stack.getCount()) {
      return ItemStack.EMPTY;
    }
    slotObject.onTake(player, stackInSlot);
  }
  return stack;
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:38,代码来源:ContainerUser.java

示例11: transferStackInSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
  ItemStack stack = ItemStack.EMPTY;
  Slot slotObject = (Slot) inventorySlots.get(slot);
  // null checks and checks if the item can be stacked (maxStackSize > 1)
  if (slotObject != null && slotObject.getHasStack()) {
    ItemStack stackInSlot = slotObject.getStack();
    stack = stackInSlot.copy();
    // merges the item into player inventory since its in the tileEntity
    if (slot < tile.getSizeInventory()) {
      if (!this.mergeItemStack(stackInSlot, tile.getSizeInventory(), 36 + tile.getSizeInventory(), true)) {
        return ItemStack.EMPTY;
      }
    }
    // places it into the tileEntity is possible since its in the player
    // inventory
    else if (TileEntityFurnace.isItemFuel(stack)) {
      //fuel slot
      if (!this.mergeItemStack(stackInSlot, 0, tile.getSizeInventory(), true)) {
        return ItemStack.EMPTY;
      }
      //        else if (!this.mergeItemStack(stackInSlot, 0, tile.getSizeInventory()-1, false)) { return ItemStack.EMPTY; }
    }
    else if (!this.mergeItemStack(stackInSlot, 0, tile.getSizeInventory() - 1, false)) {
      return ItemStack.EMPTY;
    }
    if (stackInSlot.getCount() == 0) {
      slotObject.putStack(ItemStack.EMPTY);
    }
    else {
      slotObject.onSlotChanged();
    }
    if (stackInSlot.getCount() == stack.getCount()) {
      return ItemStack.EMPTY;
    }
    slotObject.onTake(player, stackInSlot);
  }
  return stack;
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:40,代码来源:ContainerBuilder.java

示例12: addVanillaTools

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@SubscribeEvent
public void addVanillaTools(ValidatingFuelEvent event){
	Iterator<Item> iterator = Item.itemRegistry.iterator();
	while(iterator.hasNext()){
		Item i = iterator.next();
		if(TileEntityFurnace.isItemFuel(new ItemStack(i))){
			event.addfuel(i, TileEntityFurnace.getItemBurnTime(new ItemStack(i)) / 2 / 100);
		}
	}
}
 
开发者ID:Elix-x,项目名称:toolscompressor,代码行数:11,代码来源:ScanningForFuelEvent.java

示例13: isItemValidForSlot

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
public boolean isItemValidForSlot(int slot, ItemStack itemStack) {

    if (slot == 0) {
        return TileEntityFurnace.isItemFuel(itemStack);
    } else if (slot == 1) { // Output slot
        return false;
    } else {
        return true;
    }
}
 
开发者ID:BeastLe9enD,项目名称:ProjectRedExtended,代码行数:12,代码来源:TileEntityAlloyFurnace.java

示例14: onUpdate

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
@Override
public void onUpdate() {
    super.onUpdate();

    if (getRunning())
        run();
    else
        postRun();

    if (Config.useFuel && !worldObj.isRemote) {
        if (inventory.getStackInSlot(0) != null && TileEntityFurnace.isItemFuel(inventory.getStackInSlot(0)) &&
                (fuel.get() + TileEntityFurnace.getItemBurnTime(inventory.getStackInSlot(0))) <= Config.maxFuelLevel)
            if (inventory.getStackInSlot(0).getItem().equals(Items.lava_bucket)) {
                fuel.modify(TileEntityFurnace.getItemBurnTime(inventory.decrStackSize(0, 1)));
                inventory.setInventorySlotContents(0, new ItemStack(Items.bucket));
            } else {
                fuel.modify(TileEntityFurnace.getItemBurnTime(inventory.decrStackSize(0, 1)));
            }

        if (fuel.isDirty()) sync();
    }

    lastTickPosX = posX;
    lastTickPosY = posY;
    lastTickPosZ = posZ;

    posX += motionX;
    posY += motionY;
    posZ += motionZ;

    setPosition(posX, posY, posZ);

    if (getTimeSinceHit() > 0) setTimeSinceHit(getTimeSinceHit() - 1);
    if (getDamageTaken() > 0) setDamageTaken(getDamageTaken() - 1);
}
 
开发者ID:awesommist,项目名称:Extruder,代码行数:36,代码来源:EntityExtruder.java

示例15: createInventory

import net.minecraft.tileentity.TileEntityFurnace; //导入方法依赖的package包/类
private DynamicInventory createInventory(int size) {
    return new DynamicInventory("extruder", false, size) {
        @Override
        public boolean isUseableByPlayer(EntityPlayer player) {
            return !isDead && player.getDistanceSqToEntity(EntityExtruder.this) < 64;
        }

        @Override
        public boolean isItemValidForSlot(int slot, ItemStack stack) {
            return slot != 0 || TileEntityFurnace.isItemFuel(stack);
        }
    };
}
 
开发者ID:awesommist,项目名称:Extruder,代码行数:14,代码来源:EntityExtruder.java


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