
Crash when adding certain blocks with state data to replacements
MechanosG opened this issue ยท 4 comments
I'm 100% not certain if I'm doing something wrong, or if I missed a typo, or if this is a bug. But after adding a bunch of blocks into the replacements, I get this crash -
---- Minecraft Crash Report ----
// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]
Time: 2020-01-31 22:12:43 PST
Description: Initializing game
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from OreSpawn (orespawn)
Caused by: java.util.UnknownFormatConversionException: Conversion = 'u'
at java.util.Formatter$FormatSpecifier.conversion(Unknown Source)
at java.util.Formatter$FormatSpecifier.<init>(Unknown Source)
at java.util.Formatter.parse(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.lang.String.format(Unknown Source)
at com.mcmoddev.orespawn.data.ReplacementsRegistry.loadBlockState(ReplacementsRegistry.java:208)
at com.mcmoddev.orespawn.data.ReplacementsRegistry.lambda$null$3(ReplacementsRegistry.java:186)
at java.lang.Iterable.forEach(Unknown Source)
at com.mcmoddev.orespawn.data.ReplacementsRegistry.lambda$loadFile$4(ReplacementsRegistry.java:169)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source)
at com.mcmoddev.orespawn.data.ReplacementsRegistry.loadFile(ReplacementsRegistry.java:165)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.forEach(Unknown Source)
at com.mcmoddev.orespawn.impl.os3.OS3APIImpl.loadConfigFiles(OS3APIImpl.java:86)
at com.mcmoddev.orespawn.OreSpawn.init(OreSpawn.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
at com.google.common.eventbus.EventBus.post(EventBus.java:217)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
at com.google.common.eventbus.EventBus.post(EventBus.java:217)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:749)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)
at net.minecraft.client.Minecraft.init(Minecraft.java:535)
at net.minecraft.client.Minecraft.run(Minecraft.java:3931)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
For a little context, I started out adding this -
{
"default": [
{"name": "minecraft:stone"},
{"name": "minecraft:andesite"},
{"name": "minecraft:diorite"},
{"name": "minecraft:granite"},
{"name": "minecraft:netherrack"},
{"name": "minecraft:end_stone"}
],
"dirt": [
{
"name": "minecraft:dirt",
"state": "snowy=false,variant=dirt"
},
{
"name": "minecraft:dirt",
"state": "snowy=false,variant=coarse_dirt"
}
]
}
And this worked fine. Using the dirt replacement, I was able to get some dirt-based ores spawning properly in dirt and coarse_dirt, without affecting podzol. So I re-used the same formatting and added this to default -
{
"default": [
{"name": "minecraft:stone"},
{"name": "minecraft:andesite"},
{"name": "minecraft:diorite"},
{"name": "minecraft:granite"},
{"name": "minecraft:netherrack"},
{"name": "minecraft:end_stone"},
{
"name": "undergroundbiomes:igneous_stone",
"state": "type=red_granite"
},
{
"name": "undergroundbiomes:igneous_stone",
"state": "type=black_granite"
},
{
"name": "undergroundbiomes:igneous_stone",
"state": "type=rhyolite"
},
{
"name": "undergroundbiomes:igneous_stone",
"state": "type=andesite"
},
{
"name": "undergroundbiomes:igneous_stone",
"state": "type=gabbro"
},
{
"name": "undergroundbiomes:igneous_stone",
"state": "type=basalt"
},
{
"name": "undergroundbiomes:igneous_stone",
"state": "type=komatiite"
},
{
"name": "undergroundbiomes:igneous_stone",
"state": "type=dacite"
},
{
"name": "undergroundbiomes:metamorphic_stone",
"state": "type=gneiss"
},
{
"name": "undergroundbiomes:metamorphic_stone",
"state": "type=eclogite"
},
{
"name": "undergroundbiomes:metamorphic_stone",
"state": "type=marble"
},
{
"name": "undergroundbiomes:metamorphic_stone",
"state": "type=quartzite"
},
{
"name": "undergroundbiomes:metamorphic_stone",
"state": "type=blueschist"
},
{
"name": "undergroundbiomes:metamorphic_stone",
"state": "type=greenschist"
},
{
"name": "undergroundbiomes:metamorphic_stone",
"state": "type=soapstone"
},
{
"name": "undergroundbiomes:metamorphic_stone",
"state": "type=migmatite"
},
{
"name": "undergroundbiomes:sedimentary_stone",
"state": "type=limestone"
},
{
"name": "undergroundbiomes:sedimentary_stone",
"state": "type=chalk"
},
{
"name": "undergroundbiomes:sedimentary_stone",
"state": "type=shale"
},
{
"name": "undergroundbiomes:sedimentary_stone",
"state": "type=siltstone"
},
{
"name": "undergroundbiomes:sedimentary_stone",
"state": "type=lignite"
},
{
"name": "undergroundbiomes:sedimentary_stone",
"state": "type=dolomite"
},
{
"name": "undergroundbiomes:sedimentary_stone",
"state": "type=greywacke"
},
{
"name": "undergroundbiomes:sedimentary_stone",
"state": "type=chert"
},
{
"name": "quark:basalt",
"state": "variant=STONE_BASALT"
},
{
"name": "quark:marble",
"state": "variant=STONE_MARBLE"
},
{
"name": "quark:limestone",
"state": "variant=STONE_LIMESTONE"
},
{
"name": "quark:jasper",
"state": "variant=STONE_JASPER"
},
{
"name": "quark:slate",
"state": "variant=STONE_SLATE"
},
{
"name": "gregtech:granite",
"state": "chiseling=NORMAL,variant=BLACK_GRANITE"
},
{
"name": "gregtech:granite",
"state": "chiseling=NORMAL,variant=RED_GRANITE"
},
{
"name": "gregtech:mineral",
"state": "chiseling=NORMAL,variant=MARBLE"
},
{
"name": "gregtech:mineral",
"state": "chiseling=NORMAL,variant=BASALT"
},
{
"name": "chisel:basalt2",
"state": "variation=7"
},
{"name": "rockhounding_rocks:blocks_a"},
{"name": "rockhounding_rocks:blocks_b"},
{"name": "rockhounding_rocks:blocks_c"},
{"name": "rockhounding_rocks:blocks_d"},
{"name": "rockhounding_rocks:blocks_e"},
{"name": "rockhounding_rocks:blocks_f"},
{"name": "rockhounding_rocks:blocks_g"},
{"name": "rockhounding_rocks:blocks_h"}
],
"dirt": [
{
"name": "minecraft:dirt",
"state": "snowy=false,variant=dirt"
},
{
"name": "minecraft:dirt",
"state": "snowy=false,variant=coarse_dirt"
}
]
}
This is where things start crashing on load. If I remove the state portion of the new entries, it'll load without crashing, so it must have something to do with that. I also tested removing just the chisel entry since it uses an integer for the state data, but it still crashed. Also I intentionally didn't add the state data for the rockhounding entries (yet) and may add them later. Any ideas on what I did wrong, if anything?
Minecraft 1.12.2
forge-14.23.5.2847
OreSpawn-1.12-3.3.1.172.jar
...
This crash is actually in the exception handler.
I can get a fix that'll correct this specific crash, but it looks like it was triggered by the state translation code itself... Should be ready soon on https://maven.mcmoddev.com/
Okay, fix is available here -- when I've got a chance I'll add the wildcard for blockstate and see about dropping that on CurseForge.
that was a fix that was kinda braindead - I forget why I did that, there, but it might have been an attempt to make a better error report for a specifically difficult issue... I should probably remove it entirely, to be honest, but don't have the time to really dive this code right now.