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


Java IFuelHandler类代码示例

本文整理汇总了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);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:9,代码来源:ItemHeatingCoil.java

示例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;
        }
    });
}
 
开发者ID:PurplePopo,项目名称:InformationCraft,代码行数:12,代码来源:CraftingLoader.java

示例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;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:10,代码来源:GameRegistry.java

示例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;
        }
    });
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:9,代码来源:PneumaticCraft.java

示例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;
        }
    });
}
 
开发者ID:CCM-Modding,项目名称:Nucleum-Omnium,代码行数:41,代码来源:FuelAdding.java

示例6: registerFuelHandler

import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static void registerFuelHandler(IFuelHandler handler)
{
    fuelHandlers.add(handler);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:5,代码来源:GameRegistry.java

示例7: registerCompressionChamberFuelHandler

import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static void registerCompressionChamberFuelHandler(IFuelHandler handler) {
compressionChamberFuelHandlers.add(handler);
  }
 
开发者ID:jasonmpen,项目名称:CarbonMod,代码行数:4,代码来源:CarbonRegistry.java

示例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;
}
 
开发者ID:jasonmpen,项目名称:CarbonMod,代码行数:7,代码来源:CarbonRegistry.java

示例9: registerChemicalExtractorFuelHandler

import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static void registerChemicalExtractorFuelHandler(IFuelHandler handler) {
    chemicalExtractorFuelHandlers.add(handler);
}
 
开发者ID:jasonmpen,项目名称:CarbonMod,代码行数:4,代码来源:CarbonRegistry.java

示例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;
}
 
开发者ID:jasonmpen,项目名称:CarbonMod,代码行数:7,代码来源:CarbonRegistry.java

示例11: buildFuelHelper

import cpw.mods.fml.common.IFuelHandler; //导入依赖的package包/类
public static IFuelHandler buildFuelHelper(BaseModProxy mod)
{
    return new ModLoaderFuelHelper(mod);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:ModLoaderHelper.java


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