當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。