Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crash when ran with Etched #1

Closed
SSJ3Bane opened this issue Jul 31, 2021 · 4 comments
Closed

Server crash when ran with Etched #1

SSJ3Bane opened this issue Jul 31, 2021 · 4 comments

Comments

@SSJ3Bane
Copy link

SSJ3Bane commented Jul 31, 2021

Running the mod on a server alongside Etched causes a crash during startup.
Description: Exception in server tick loop

java.lang.UnsupportedOperationException: null
	at java.util.AbstractList.add(AbstractList.java:148) ~[?:1.8.0_292] {}
	at java.util.AbstractList.add(AbstractList.java:108) ~[?:1.8.0_292] {}
	at com.song.castle_in_the_sky.events.ServerEvents.onVillageTradeRegister(ServerEvents.java:62) ~[castle_in_the_sky:1.16.5] {re:classloading}
	at net.minecraftforge.eventbus.ASMEventHandler_71_ServerEvents_onVillageTradeRegister_VillagerTradesEvent.invoke(.dynamic) ~[?:?] {}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.common.VillagerTradingManager.postVillagerEvents(VillagerTradingManager.java:92) ~[forge:?] {re:classloading}
	at net.minecraftforge.common.VillagerTradingManager.loadTrades(VillagerTradingManager.java:58) ~[forge:?] {re:classloading}
	at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerAboutToStart(ServerLifecycleHooks.java:95) ~[forge:?] {re:mixin,re:classloading}
	at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:166) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:621) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:betterendforge.mixins.json:MinecraftServerMixin,pl:mixin:APP:structure_gel.mixins.json:MinecraftServerMixin,pl:mixin:APP:upstream.mixins.json:MixinMinecraftServer,pl:mixin:APP:blame.mixins.json:MinecraftServerAccessor,pl:mixin:APP:globaldataandresourcepacks.mixins.json:MinecraftServerMixin,pl:mixin:APP:byg.mixins.json:server.MixinMinecraftServer,pl:mixin:APP:charm.mixins.json:accessor.MinecraftServerAccessor,pl:mixin:A,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:betterendforge.mixins.json:MinecraftServerMixin,pl:mixin:APP:structure_gel.mixins.json:MinecraftServerMixin,pl:mixin:APP:upstream.mixins.json:MixinMinecraftServer,pl:mixin:APP:blame.mixins.json:MinecraftServerAccessor,pl:mixin:APP:globaldataandresourcepacks.mixins.json:MinecraftServerMixin,pl:mixin:APP:byg.mixins.json:server.MixinMinecraftServer,pl:mixin:APP:charm.mixins.json:accessor.MinecraftServerAccessor,pl:mixin:A,pl:runtimedistcleaner:A}
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292] {}

I believe this is caused when adding custom trades from Castle In The Sky to villagers. From the look of it, a try catch for a null object, or just ensuring the trades list being added to isn't null, would prevent this.

@SongXia-NYU
Copy link
Collaborator

SongXia-NYU commented Jul 31, 2021

Hi SSJ3Bane,
Thank you for reporting this!
The list should not be null. After I looked up the problem it is probably the Arrays.asList() method in the Etched mod that causes the problem.
It seems that the Etched Mod overrides the trading list inside the registerVillagerTrades method which causes other mods cannot add new trades.
A better solution is creating an issue on their side and let them change
Arrays.asList(listing)
with
new ArrayList<>(Arrays.asList(listing))

If they don't respond I will fix it on my side.

@SSJ3Bane
Copy link
Author

Gotcha, the stacktrace first pointed to Castle In The Sky, figured it could have been there. I'll go let them know. Thanks!

@SongXia-NYU
Copy link
Collaborator

No worries. I will try to fix it on my side later today.

@SongXia-NYU
Copy link
Collaborator

Should fix in 0.2.6

SongXia-NYU added a commit that referenced this issue Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants