This mod is a fix add-on for Delight o' Flight. Delight o' Flight's "Arc" effect shocks nearby mobs, but the original mod has no entity protection at all, so passive mobs (villagers, cows, sheep, etc.) are frequently killed by accident. This mod does just one thing: it adds a configurable blacklist mechanism so modpack authors can decide which mobs won't be shocked.
The blacklist (entity IDs or entity tags) works on three levels at once for complete interception:
The config file is located at: config/delighto_flight_fix-common.toml
shockBlacklist: a list of strings. Each entry can be:
minecraft:villager#), e.g. #minecraft:raiders
Invalid entries are ignored. By default, the list already covers 35 passive mobs, including villagers, wandering traders, cows, sheep, pigs, chickens, cats, dogs, horses, ocelots, trader llamas, iron golems, snow golems, zombie horses, skeleton horses, polar bears, sniffers, striders, tadpoles, frogs, camels, dolphins, goats, axolotls, and aerolopes../gradlew runClient (or genIntellijRuns then run from your IDE)../gradlew jar, output in build/libs/.This mod uses Mixin to modify Delight o' Flight's classes, injecting into three third-party mod classes. There are several non-obvious gotchas, all handled as follows:
Mixin targets (src/main/java/com/garam/DelightoFlightFix/mixin/):
ArcEffectMixin: injects into ArcEffect.applyEffectTick, cancels arc spawning when the holder is blacklisted.ElectricCurrentMixin: redirects getEntitiesOfClass inside ElectricCurrent.tick to filter victims.ElectricCurrentRendererMixin (client): redirects the renderer's getTargets query to filter arc visuals.Mixin registration: Forge 1.20.1 does not support the [[mixins]] section in mods.toml.
In dev, registration happens via the --mixin.config argument in the run configuration; the production jar relies on the MixinConfigs manifest attribute.
This mod's refmap is hand-written (delighto_flight_fix.refmap.json):
The Mixin annotation processor cannot generate a refmap for third-party mod classes (it only does direct lookups in vanilla SRG mappings).
So this mod's refmap is written by hand; the SRG names were confirmed by decompiling the obfuscated Delight o' Flight jar.
ArcEffect.applyEffectTick -> m_6742_ElectricCurrent.tick -> m_8119_Level.getEntitiesOfClass -> m_45976_Note that refmap keys come in two formats — getting them wrong causes a failed injection check (0/1) error in production:
method attributes (e.g. tick, applyEffectTick) use the method name as the key.@At INVOKE targets (e.g. getEntitiesOfClass) use the full method reference (Lowner;name(desc)ret) as the key.If you upgrade Delight o' Flight, you must re-verify these SRG names and update the refmap.
com.garam.DelightoFlightFix.DelightoFlightFix: main class, registers the config.com.garam.DelightoFlightFix.Config: blacklist config and lookup logic (isShockBlacklisted).com.garam.DelightoFlightFix.mixin: the three Mixin classes.