GregTech CE Unofficial

GregTech CE Unofficial

412k Downloads

[BUG] Adpother support does not work for most machines

KaktuszSok opened this issue ยท 5 comments

commented

Describe the bug
Initially I thought that adpother had no compatibility with this version of gregtech at all, but it turns out that machines such as the lava boiler do produce pollution, and muffler hatches etc produce the smoke particles associated with polluting machines (but they seem not to do any actual polluting). This makes me think that it is possible to make the other machines (like diesel generators, blast furnaces, etc) compatible with adpother without the adpother devs changing it on their side (I made a bug report there about this a while back but it hasn't been addressed). It should be noted that adpother has full support for standard GTCE, so the question is if it's possible for GTCEu to make use of that.

Versions
Forge: 14.23.5.2859
GTCE: 2.1.1-beta
Addons: Gregicality Multiblocks 1.1.0
Adpother: 1.12.2-1.2.22.0

Setup
Playing solo or multi
New world generated

Steps To Reproduce

  1. Place down a lava boiler and fill it with necessary liquids to start it
  2. Notice that pollution is produced as the boiler runs
  3. Place down a diesel generator and give it diesel and a machine to dump its energy output into
  4. Notice that no pollution is produced. This is not the case in official GTCE.

Expected behavior
The diesel generator (and friends) should produce pollution like in official GTCE. I believe adpother creates pollution by detecting when fuels are consumed, but if it is possible to add custom per-recipe pollution that would be a nice feature as realistically pollution comes from many processes other than burning of fuels. Additionally, this way recipes in e.g. the pyrolyse oven which use coals would produce pollution but those which don't need coal will not pollute, or at least not as much.

Thanks in advance!

commented

I have asked the developer about the possibility of other mods to add their own pollution support by use of an API. His response was:

There's a couple of public methods in the com/endertech/minecraft/mods/adpother/events/WorldEvents class that you can use:

// liquid fuels

onFuelBurned(@Nullable FluidStack stack, int amount, BlockEntity tile)

onFuelBurned(@Nullable FluidStack stack, int amount, Entity entity, Alignment alignment)

// solid fuels
onFuelBurned(ItemStack stack, int amount, BlockEntity tile)
onFuelBurned(ItemStack stack, int amount, Entity entity, Alignment alignment)

// simple generation
AdPother.getInstance().pollutants.findBy("name").ifPresent(pollutant -> pollutant.generateAt(level, pos, amount, maxRadius));

This regards the newest version but the same methods exist in 1.12 with slightly different signatures (TileEntity, BlockPos). This means that it is possible for GTCEu machines to explicitly notify adpother of fuels being consumed, or have macerators spawn in dust, etc etc etc.

With this in mind, the recipe builders can be expanded to allow specifying released pollutants. This would come in the following flavours:

  • Generate pollution when the recipe completes (or begins? whichever works best). Parameters: pollutant name, amount, chance.
  • Call onFuelBurned when the recipe starts. Parameters: ItemStack burned, amount.
  • Call onFuelBurned when the recipe starts. Parameters: Fluid burned, amount.

Processes which should release pollution:

  • Burning of fuels in generators (onFuelBurned)
  • Pyrolyse oven recipes (onFuelBurned)
  • Primitive blast furnace recipes (onFuelBurned)
  • Recipes which produce ashes, like creating steel in an EBF (spawn carbon. Consider reducing chance of getting ashes as item if adpother is installed?)
  • Removing sulfur from sulfuric fuels (spawn sulfur. As above, reduce amount of sulfuric acid output if adpother is installed?)
  • Macerating ores/rocks/etc (spawn dust)
  • Hammering ores/rocks/etc (spawn dust)
  • Mining/drilling machines and rigs (spawn dust)
  • There is certainly more which I'm overlooking.

As mentioned earlier some processes are already supported by adpother. This is in my experience limited to just steam-age boilers, as they use a different system than electric generators which use the standard machine recipe system. So these boilers can be left as-is.

Managing pollution adds a lot to the gregtech gameplay so any progress on this would be greatly appreciated!

commented

Is this still valid? I remember adpother adding ceu support

commented

@brachy84 yes, the last Update of adpother for 1.12 was before GTCEu released

commented

@brachy84 In part it is still valid. The developer supplied a different jar which fixes the core issue, but most machines (such as diesel generators etc) do not produce pollution as far as I am aware.

commented

This belongs to Adpother.