Mekanism-tilera-Edition/common/thermalexpansion/api/ThermalExpansionInfo.java

55 lines
1.5 KiB
Java
Raw Normal View History

package thermalexpansion.api;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
2013-07-20 18:10:14 +02:00
import net.minecraftforge.fluids.FluidStack;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* This class contains some general hooks that can be useful if Thermal Expansion is installed.
*/
public class ThermalExpansionInfo {
public static ItemStack coal = new ItemStack(Item.coal, 1, 0);
public static ItemStack charcoal = new ItemStack(Item.coal, 1, 1);
public static int lavaFuelValue = 18000;
public static int getFuelValue(ItemStack theFuel) {
if (theFuel == null) {
return 0;
}
if (theFuel.isItemEqual(coal)) {
return 4800;
}
if (theFuel.isItemEqual(charcoal)) {
return 3200;
}
int itemId = theFuel.getItem().itemID;
if (theFuel.getItem() instanceof ItemBlock && Block.blocksList[itemId].blockMaterial == Material.wood) {
return 450;
}
if (itemId == Item.stick.itemID) {
return 150;
}
if (itemId == Block.sapling.blockID) {
return 150;
}
return GameRegistry.getFuelValue(theFuel) * 3 / 2;
}
2013-07-20 18:10:14 +02:00
public static int getFuelValue(FluidStack theFuel) {
2013-07-20 18:10:14 +02:00
if (theFuel.fluidID == Block.lavaStill.blockID) {
return lavaFuelValue;
}
return 0;
}
}