本文整理匯總了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;
}
示例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.");
}
}
示例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.");
}
}
示例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());
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
}
示例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);
}
示例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);
}
};
}