Crash
fmohican opened this issue ยท 10 comments
Forge version:
Twilight Forest version: Version 3.4.239
Link to crash log: gist
Steps to reproduce:
When i enter in twilight portal i see twilight loading screen after few seconds crash....
we want to call the addDoublePlants
method which is only on BiomeForest and subclasses. we can probably work around it by copying the code
Bit annoying though as we'd then have to keep track of it, if it changes. Granted I haven't taken a look at the method yet so not sure if there's any worry there or not.
Implying we don't have reams of [VanillaCopy] already ;p
From a peek it shouldn't be too bad
OTG dev here, disagree that this is OTG's problem. TF is downcasting a class to a specific subtype so it's making an assumption (that the Biome object it's queried is in fact a BiomeForest, though there is no guarantee of that). On a modded server that may change any number of things, why would you assume that the biome registry is the same as vanilla? It seems like good form to verify this assumption before acting on it, should also be easy to do?
I'm also wondering why you need to cast to BiomeForest specifically in the first place, I assume it exposes some fields/methods you need that Biome doesn't?
Replacments should fit into the class hierarchy of whatever they replace, that's been the convention for registry overrides and the FML substitutions that preceded them, as far as I can recall
I agree that it's a good convention and nice if it's possible, but unfortunately it's not practical for OTG. OTG biomes use one "generic" OTGBiome class that's made to be fully customisable, it only inherits from Biome, so there isn't a seperate class for each biome.
Of course the difference between a convention and a rule is that a rule is enforced by the environment, a convention isn't enforced at all. So in that sense it's safe to rely on rules but not conventions. I'm still wondering btw why you need to cast to BiomeForest specifically, since it's preferable to rely on abstractions (Biome) rather than concretions (BiomeForest). I assume you need BiomeForest because it exposes some field/method that Biome doesn't?
Thanks a lot for looking into this guys :). Sorry if OTG is a pain in the butt sometimes! It's a big mod, unfortunately I can't always make things as pretty as I'd like :/.
@wisecompany I believe it already has, but a ticket made and closed 2 days ago says it's yet to be released. #407