本文整理汇总了Java中net.minecraftforge.fml.common.IFuelHandler类的典型用法代码示例。如果您正苦于以下问题:Java IFuelHandler类的具体用法?Java IFuelHandler怎么用?Java IFuelHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IFuelHandler类属于net.minecraftforge.fml.common包,在下文中一共展示了IFuelHandler类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFuelValue
import net.minecraftforge.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;
}
示例2: getFuelHandler
import net.minecraftforge.fml.common.IFuelHandler; //导入依赖的package包/类
public static final IFuelHandler getFuelHandler(ItemStack item, int time) {
return new IFuelHandler() {
@Override
public int getBurnTime(ItemStack fuel) {
return ItemStack.areItemsEqual(fuel, item) ? time : 0;
}
};
}
示例3: getBurnTime
import net.minecraftforge.fml.common.IFuelHandler; //导入依赖的package包/类
@Override
public int getBurnTime(ItemStack parItemStack)
{
int burnTime = this.fuelMap.get(new FuelItem(parItemStack.getItem(), parItemStack.getMetadata()));
if (burnTime > 0) return burnTime;
for(IFuelHandler listener : this.listeners)
{
burnTime = Math.max(burnTime, listener.getBurnTime(parItemStack));
}
return burnTime;
}
示例4: FuelMap
import net.minecraftforge.fml.common.IFuelHandler; //导入依赖的package包/类
public FuelMap(IFuelHandler defaults)
{
this.defaults = defaults;
}
示例5: registerFuelHandler
import net.minecraftforge.fml.common.IFuelHandler; //导入依赖的package包/类
public static void registerFuelHandler(IFuelHandler handler)
{
fuelHandlers.add(handler);
}
示例6: getFuelHandlers
import net.minecraftforge.fml.common.IFuelHandler; //导入依赖的package包/类
public static final List<IFuelHandler> getFuelHandlers(String material_str, int time) {
List<IFuelHandler> result = new LinkedList<IFuelHandler>();
for (ItemStack material : OreDictionary.getOres(material_str))
result.add(getFuelHandler(material, time));
return result;
}
示例7: addFuelHandler
import net.minecraftforge.fml.common.IFuelHandler; //导入依赖的package包/类
public static void addFuelHandler(IFuelHandler handler) {
GameRegistry.registerFuelHandler(handler);
}
示例8: add
import net.minecraftforge.fml.common.IFuelHandler; //导入依赖的package包/类
public void add(IFuelHandler parFuelHandler)
{
this.listeners.add(parFuelHandler);
}