Crock Pot

Crock Pot

328k Downloads

[bug]Cannot overwrite crockpot internal data by datapacks

khjxiaogu opened this issue ยท 3 comments

commented

Tried to add datapack for rotten flesh, but got this.

java.lang.IllegalArgumentException: Duplicate definition for item minecraft:rotten_flesh
	at com.sihenzhang.crockpot.base.FoodCategoryManager.apply(FoodCategoryManager.java:177) ~[crockpot:1.5.2-release]
	at com.sihenzhang.crockpot.base.FoodCategoryManager.func_212853_a_(FoodCategoryManager.java:22) ~[crockpot:1.5.2-release]
	at net.minecraft.client.resources.ReloadListener.func_215269_a(SourceFile:13) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?]
	at net.minecraft.resources.AsyncReloader.func_219557_a(SourceFile:71) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(ThreadTaskExecutor.java:189) ~[?:?]
	at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(ThreadTaskExecutor.java:151) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213161_c(ThreadTaskExecutor.java:167) ~[?:?]
	at net.minecraft.client.Minecraft.func_238189_a_(Minecraft.java:1863) ~[?:?]

I think overwrite default definition is expected behaviour.

commented

OK, so we will use IRecipe from vanilla instead of our own JsonReloadListener. I think you can overwrite the internal datapacks now but everything should be rewritten.๐Ÿค”

commented

OK, so we will use IRecipe from vanilla instead of our own JsonReloadListener. I think you can overwrite the internal datapacks now but everything should be rewritten.๐Ÿค”

Maybe, there's any chance to do this without rewrite?
Just remove that Exception should work?

commented

OK, so we will use IRecipe from vanilla instead of our own JsonReloadListener. I think you can overwrite the internal datapacks now but everything should be rewritten.๐Ÿค”

Maybe, there's any chance to do this without rewrite? Just remove that Exception should work?

IRecipe has a loading order that your own datapack will overwrite the internal datapack while regular datapack doesn't. So in regular datapack, the internal datapack maybe overwrite your datapack, which is not what you want.