ValkyrienSkies / Eureka

Basically Archimedes Ships, but with VS2 as the backend
Apache License 2.0
54 stars 32 forks source link

Engine fuel items - add/remove #320

Open Ashendale opened 3 months ago

Ashendale commented 3 months ago

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.

millennIumAMbiguity commented 3 months ago

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]
Ashendale commented 3 months ago

Unsure how I can check/edit those values but, for example, Ars Nouveau Fire Essence can smelt 20 items in a furnace and does not work on the engine

image

millennIumAMbiguity commented 2 months ago

what version are you using?

Ashendale commented 2 months ago

1.3.0 beta 4

baldur132 commented 3 weeks ago

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

baldur132 commented 3 weeks ago

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;
}

Link

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;
}

Link