本文整理汇总了Java中cpw.mods.fml.common.IFuelHandler类的典型用法代码示例。如果您正苦于以下问题:Java IFuelHandler类的具体用法?Java IFuelHandler怎么用?Java IFuelHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IFuelHandler类属于cpw.mods.fml.common包,在下文中一共展示了IFuelHandler类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ItemHeatingCoil
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public ItemHeatingCoil() {
super(1500000, 1500000, 75000);
GameRegistry.registerFuelHandler((IFuelHandler)this);
this.setMaxStackSize(1);
this.setTextureName("extrautils:heatingElement");
this.setUnlocalizedName("extrautils:heatingElement");
this.setCreativeTab((CreativeTabs)ExtraUtils.creativeTabExtraUtils);
}
示例2: registerFuel
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
private static void registerFuel()
{
GameRegistry.registerFuelHandler(new IFuelHandler()
{
@Override
public int getBurnTime(ItemStack fuel)
{
return Items.diamond != fuel.getItem() ? 0 : 12800;
}
});
}
示例3: getFuelValue
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static int getFuelValue(ItemStack itemStack)
{
int fuelValue = 0;
for (IFuelHandler handler : fuelHandlers)
{
fuelValue = Math.max(fuelValue, handler.getBurnTime(itemStack));
}
return fuelValue;
}
示例4: registerFuel
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public void registerFuel(final ItemStack fuelStack, final int fuelValue){
GameRegistry.registerFuelHandler(new IFuelHandler(){
@Override
public int getBurnTime(ItemStack fuel){
return fuel != null && fuel.isItemEqual(fuelStack) ? fuelValue : 0;
}
});
}
示例5: init
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static void init()
{
String[] fuelEdits = NucleumOmnium.getConfig().fuelEdits;
for (String edit : fuelEdits)
{
String[] split = edit.split(":");
int fuelLevel = Integer.parseInt(split[split.length - 1]);
if (Arrays.asList(OreDictionary.getOreNames()).contains(split[0]))
{
fuelSet.add(new ItemStackOrOreDictEntry(split[0], fuelLevel));
}
else
{
int id = Integer.parseInt(split[0]);
int meta = OreDictionary.WILDCARD_VALUE;
if (split.length == 3) meta = Integer.parseInt(split[1]);
fuelSet.add(new ItemStackOrOreDictEntry(new ItemStack(id, 1, meta), fuelLevel));
}
}
GameRegistry.registerFuelHandler(new IFuelHandler()
{
@Override
public int getBurnTime(ItemStack fuel)
{
for (ItemStackOrOreDictEntry entry : fuelSet)
{
if (entry.is(fuel))
{
return entry.getFuelLvl();
}
}
return 0;
}
});
}
示例6: registerFuelHandler
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static void registerFuelHandler(IFuelHandler handler)
{
fuelHandlers.add(handler);
}
示例7: registerCompressionChamberFuelHandler
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static void registerCompressionChamberFuelHandler(IFuelHandler handler) {
compressionChamberFuelHandlers.add(handler);
}
示例8: getCompressionChamberFuelValue
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static int getCompressionChamberFuelValue(ItemStack itemStack) {
int fuelValue = 0;
for (IFuelHandler handler : compressionChamberFuelHandlers)
fuelValue = Math.max(fuelValue, handler.getBurnTime(itemStack));
return fuelValue;
}
示例9: registerChemicalExtractorFuelHandler
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static void registerChemicalExtractorFuelHandler(IFuelHandler handler) {
chemicalExtractorFuelHandlers.add(handler);
}
示例10: getChemicalExtractorFuelValue
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static int getChemicalExtractorFuelValue(ItemStack itemStack) {
int fuelValue = 0;
for (IFuelHandler handler : chemicalExtractorFuelHandlers)
fuelValue = Math.max(fuelValue, handler.getBurnTime(itemStack));
return fuelValue;
}
示例11: buildFuelHelper
import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static IFuelHandler buildFuelHelper(BaseModProxy mod)
{
return new ModLoaderFuelHelper(mod);
}