MC Dungeons Weapons

MC Dungeons Weapons

8M Downloads

[Bug Report]: Server Crash when disabling Enchantments for MCDW and MCDA via config

gamerpotion opened this issue ยท 10 comments

commented

Describe the bug; What happened?

Server doesnt restart when we disable enchantments for MCDW and MCDA via config. See below. Could be caused by Universal Shops mod possibly - https://www.curseforge.com/minecraft/mc-mods/universal-shops

// I let you down. Sorry :(

Time: 2023-02-28 14:02:29
Description: Exception in server tick loop

java.lang.IllegalStateException: Accidentally adding the same item stack twice [Enchanted Book] to a Creative Mode Tab: MC Dungeons Weapons (Enchantments)
    at net.minecraft.class_1761$class_7703.method_45417(class_1761.java:236)
    at net.minecraft.class_1761$class_7704.method_45420(class_1761.java:262)
    at chronosacaria.mcdw.Mcdw.lambda$static$4(Mcdw.java:48)
    at net.minecraft.class_1761.method_47306(class_1761.java:95)
    at net.minecraft.class_1761.polymer$getContentsWith(class_1761.java:2036)
    at eu.pb4.universalshops.gui.setup.SelectItemGui.updateCachedItems(SelectItemGui.java:109)
    at eu.pb4.universalshops.UniversalShopsMod.lambda$onInitialize$0(UniversalShopsMod.java:40)
    at net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents.lambda$static$2(ServerLifecycleEvents.java:49)
    at net.minecraft.server.MinecraftServer.handler$bdb000$fabric-lifecycle-events-v1$afterSetupServer(MinecraftServer.java:6324)
    at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:655)
    at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:264)
    at java.base/java.lang.Thread.run(Thread.java:833)```


### Expected Behavior

It should allow for them to be disabled.

### Mod Version

6.0.0 + 3.0.0

### Minecraft Launcher

Vanilla

### Operating System

Windows

### Modpack

DarkRPG 5.6.0 (1.19.3)

### Additional context

_No response_
commented

Hey Gamer! If you try removing Universal Shops does the crash still happen? That'd be the easiest way to narrow down who's really causing it.

commented

Just to add to above, I tested this whole process with an enchant from MoreGems - https://beta.curseforge.com/minecraft/mc-mods/more-gems-fabric

added bow to shop, disabled enchantment, and game loaded ok. So am guessing something to do with that Enchantment books Tab in creative? and it clashing with universal shops items?

"enableFloating": false,

commented

Yeah, it's issue with this mod seamingly adding empty books (as it's likely not registered), which then crashes in vanilla code

commented

Hey! :D
I myself havent been able to replicate in SP as not sure what item/enchant the players were using
I cant disable the univeral shop on server either as players have got items set up for sale on there.
Im guessing some item that is on sale in the shops with the enchants we were trying to disable may be causing this? @Patbox

commented

Okay, looked at the code and it shouldn't happen, as it's cached once server started. Could you check if client crashes when you open one of this mods tabs (after disabling them that is)?

commented

Universal Shops uses Item Groups to get list of items you can set the shop to use (if you don't have it in inventory). Error seamingly happens because the same stack is added to the same tab twice (empty enchanting book)? My guess is that it's caused by enchantments being initialized too late compared to item groups. Will move that in US through

commented

Just tested in a SP setting, not getting any errors and looks like it removed the enchantment from the item that had the enchant inside a shop for sale




"VOID_STRIKE": false,

commented

It's issue with enchanting book tab, it doesn't happen in that one?

commented

Ok I gave it another go with different item and enchant. This time it crashed the same way as on the server, soon as I tried to enter the world. So I cant enter the world to check the tab as it crashes
crashes when trying to create a brand new world as well
Disabled Universal Shops and it didnt crash

"ECHO": false

// My bad.

Time: 2023-02-28 17:02:34
Description: Exception in server tick loop

java.lang.IllegalStateException: Accidentally adding the same item stack twice [Enchanted Book] to a Creative Mode Tab: MC Dungeons Weapons (Enchantments)
	at net.minecraft.class_1761$class_7703.method_45417(class_1761.java:236)
	at net.minecraft.class_1761$class_7704.method_45420(class_1761.java:262)
	at chronosacaria.mcdw.Mcdw.lambda$static$4(Mcdw.java:48)
	at net.minecraft.class_1761.method_47306(class_1761.java:95)
	at net.minecraft.class_1761.polymer$getContentsWith(class_1761.java:2536)
	at eu.pb4.universalshops.gui.setup.SelectItemGui.updateCachedItems(SelectItemGui.java:109)
	at eu.pb4.universalshops.UniversalShopsMod.lambda$onInitialize$0(UniversalShopsMod.java:40)
	at net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents.lambda$static$2(ServerLifecycleEvents.java:49)
	at net.minecraft.server.MinecraftServer.handler$bnk000$fabric-lifecycle-events-v1$afterSetupServer(MinecraftServer.java:5824)
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:655)
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:264)
	at java.base/java.lang.Thread.run(Thread.java:833)
commented

Just uploaded to CF so we'll see how long that takes.