Engine fuel items - add/remove
Ashendale opened this issue ยท 6 comments
I'm using Eureka with other mods and I have fuel items that I can make that are equivalent to coal.
Is there a place in the configs I can edit what counts as fuel? I've been looking and can't find it.
Every Fuel value should work.
// We check if something is fuel like this:
net.minecraft.world.level.block.entity.BaseContainerBlockEntity.AbstractFurnaceBlockEntity.isFuel(ItemStack)
// We get the fuel value like this:
net.minecraft.world.level.block.entity.FurnaceBlockEntity.getFuel()[ItemStack]
Seconded, biofuel pellets from Create Crafts and Addons do not work, despite working in a vanilla furnace and the aircraft from Immersive Aircraft. Which is unfortunate, because biofuel pellets are an excellent fuel source otherwise.
Minecraft Version: 1.19.2
Eureka Version: 1.5.1 Beta 2
Forge Version: 43.3.5
Just looking into it on the surface, the implementation for Immersive Aircraft checks whether the item being placed into the fuel slot is burnable, instead of checking whether it is fuel:
public boolean mayPlace(ItemStack stack) {
return Utils.getFuelTime(stack) > 0;
}
public static int getFuelTime(ItemStack fuel) {
if (fuel.isEmpty()) {
return 0;
}
// Custom fuel
Map<String, Integer> fuelList = Config.getInstance().fuelList;
String identifier = BuiltInRegistries.ITEM.getKey(fuel.getItem()).toString();
if (fuelList.containsKey(identifier)) {
return fuelList.get(identifier);
}
// Vanilla fuel
if (Config.getInstance().acceptVanillaFuel) {
int fuelTime = CobaltFuelRegistry.INSTANCE.get(fuel);
if (fuelTime > 0) {
return fuelTime;
}
}
return 0;
}