Mine and Slash

Mine and Slash

3M Downloads

[Bug]: Server couldn't place player in world

DDDot opened this issue ยท 21 comments

commented

Describe the bug you're experiencing

Hi. I'm running a Mohist server on 1.20.1. I just added the Mine and slash mod into my server. The mod is half-way added in and we have played for sometime on the server. After adding the mod, I couldn't log into my server. The error msg is here down below. I found that the problem is with the dependency mod Library of Exile 2.0.2 after excluding the mods one by one. The mods for my client and server are the same and I can launch the game without any issue in single-player mode.

Couldn't place player in world
java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.Level.m_6042_()" because "p_178877_.world" is null
at net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket.(ClientboundInitializeBorderPacket.java:30) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.players.PlayerList.m_11229_(PlayerList.java:959) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.players.PlayerList.m_11261_(PlayerList.java:307) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_143699_(ServerLoginPacketListenerImpl.java:176) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_10055_(ServerLoginPacketListenerImpl.java:163) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_9933_(ServerLoginPacketListenerImpl.java:75) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.network.Connection.m_129483_(Connection.java:272) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerConnectionListener.m_9721_(ServerConnectionListener.java:149) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:1180) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:360) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:1071) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:910) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:286) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at java.lang.Thread.run(Unknown Source) [?:?]

Reproducability

just log into the server with Library of Exile 2.0.2 added
The mods in the server are (exclude from The-Harvest-1.20.1-1.0.0, Dungeon-Realm-1.20.1-1.0.3, Mine_and_lash-Compatibility-1.20.1-1.0.0 since they need Library of Exile and Mine and slash to run):
appleskin-forge-mc1.20.1-2.5.1
Aquaculture-1.20.1-2.5.3
aquaculturedelight-1.1.1-forge-1.20.1
BetterPingDisplay-1.20.1-1.1
BiomesOPlenty-forge-1.20.1-19.0.0.94
casualness_delight-1.20.1-0.4n
chloride-FORGE-mc1.20.1-v1.5.4
create-1.20.1-6.0.2
culturaldelights-0.16.2
curios-forge-5.12.1+1.20.1
Delightful-1.20.1-3.7.1
dungeons_enhanced-1.20.1-5.4.0
embeddium-0.3.31+mc1.20.1
Endless Ammo Lib v1.1
FarmersDelight-1.20.1-1.2.7
farmersrespite-1.20.1-2.1.2
ferritecore-6.0.1-forge
framework-forge-1.20.1-0.7.12
fruitsdelight-1.0.21
GlitchCore-forge-1.20.1-0.0.1.1
guccivuitton-1.20.1-0.2.2
gundurability-1.7.0
IMBlocker-5.0.2-1.19.4-1.20.4
infernalmobs-1.20.1.6
inventoryhud.forge.1.20.1-3.4.26
invtweaks-1.20.1-1.2.0
Jade-1.20.1-Forge-11.12.3
jeed-1.20-2.2.5
jei-1.20.1-forge-15.20.0.106
JustEnoughResources-1.20.1-1.4.0.247
lradd-1.20.1-0.2.4
maxstuff-1.7.1
modernfix-forge-5.20.2+mc1.20.1
oceanic_delight-1.0.3-forge-1.20.1
oculus-mc1.20.1-1.8.0
Ping-1.20.1-1.10.2
Ping-Wheel-1.10.1-forge-1.20.1
player-animation-lib-forge-1.0.2-rc1+1.20
refurbished_furniture-forge-1.20.1-1.0.9
structure_gel-1.20.1-2.16.2
tacz-1.20.1-1.1.4-hotfix-all
TerraBlender-forge-1.20.1-3.0.1.7
twilightforest-1.20.1-4.3.2508-universal
Xaeros_Minimap_25.1.0_Forge_1.20
XaerosWorldMap_1.39.2_Forge_1.20

Mod up to date

  • Before submitting this issue I updated to the newest version and reproduced it

Tested Without Custom Mine and Slash Datapacks

  • In case I used Mine and Slash datapacks, I ran Mine and Slash in a new instance without custom datapacks and confirmed the bug still exists

Mine and Slash version

6.2.1

Logs

there are no crash log, the error message is in the description

commented

You do not have to ping me, i can't figure out what's the problem. Can you get another server that isn't mohist?

commented

sry I thought the comment didn't get to you. I'll try on another server to see if the problem still occurs.

commented

Hi it's me again. I just came across the same problem and some other issues as I continued exploring mine and slash's contents on the server.

The first thing is that I attempted to enter the dungeon using the adventure maps I found in the chests around the world. It's werid that the level requirements of the maps are changing as I level up. The level requirments are always equivalent to my mine and slash level, and it's the same for all the maps. When I tried to enter the dungeon using the Map device, it said that I can't get in because I haven't met the level requirement of the map (which is odd because there are green check marks in the description of the maps indicating that I can get in).

The second problem happens when I tried to enter the harvest map via the "Harvest" block. I could get in the harvest world but when I first got in I could only hear the sound around me but I can't see anything. The screen is frozen at the "loading the map" screen, and as the screen was freezing I could still hear myself getting attacked by the monsters in the harvest world. When I quit the game and tried to get in again, the problem similar to last night's took place and the server gave me this error message:

Couldn't place player in world
java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.Level.m_6042_()" because "p_178877_.world" is null
at net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket.(ClientboundInitializeBorderPacket.java:30) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.players.PlayerList.m_11229_(PlayerList.java:959) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.players.PlayerList.m_11261_(PlayerList.java:307) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_143699_(ServerLoginPacketListenerImpl.java:176) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_10055_(ServerLoginPacketListenerImpl.java:163) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_9933_(ServerLoginPacketListenerImpl.java:75) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.network.Connection.m_129483_(Connection.java:272) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerConnectionListener.m_9721_(ServerConnectionListener.java:149) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:1180) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:360) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:1071) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:910) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:286) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at java.lang.Thread.run(Unknown Source) [?:?]

So I was wonding that maybe this world loading code is used in multiple places in the mod? And could you please take a look at this problem again? I am still stuck in the harvest world and can't get out......

commented

DId you report this to mohist?

commented

Actually i have an idea for a fix

commented

Check with 2.0.3 in, 20minutes or so

commented

Check with 2.0.3 in, 20minutes or so

You're so responsive man. However I just ran the Build.dat and there are some issues with it. The error message is:

Configure project :
MixinGradle is skipping eclipse integration, extension not found

FAILURE: Build failed with an exception.

Could not create domain object 'curseforge' (Curseforge)

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.9/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 2m 52s

commented

Uh, just install from curseforge

And for that, you just have to remove the publishing part from gradle or make a dummy file it asks for, that's where my api key is for uploading stuff, which i of course have to gitignore

commented

oh I just checked and installed, on both client and server. But I got similar error message when I logged in:

Couldn't place player in world
java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.Level.m_6042_()" because "p_178877_.world" is null
at net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket.(ClientboundInitializeBorderPacket.java:30) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.players.PlayerList.m_11229_(PlayerList.java:959) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.players.PlayerList.m_11261_(PlayerList.java:307) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_143699_(ServerLoginPacketListenerImpl.java:176) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_10055_(ServerLoginPacketListenerImpl.java:163) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.m_9933_(ServerLoginPacketListenerImpl.java:75) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.network.Connection.m_129483_(Connection.java:272) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.network.ServerConnectionListener.m_9721_(ServerConnectionListener.java:149) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:1180) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:360) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:1071) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:910) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:286) ~[server-1.20.1-20230612.114412-srg.jar%23292!/:?]
at java.lang.Thread.run(Unknown Source) [?:?]

I have reported this issue to mohist on github just now btw, but no response yet.

commented

Try 2.0.4

commented

It works! I can log into the server now. Thanks for the fix and this excellent mod!

commented

Nice. Honestly this part of the code is a bit wacky and there might be a better way to do it but hopefully works for now

commented

It works well definately. I logged in and Mine and slash functioned perfectly well now without any problems.

commented

Hi I just used a 1.20.1 forge server (forge version: forge-1.20.1-47.4.0) and add the same mods on the mohist server to reproduce the issue. The harvest's bug didn't occur and I can get in the dungeon correctly. But the adventure map's bug still exists. Also I have reported these problems on mohist's github and currently still waiting for responses.

commented

wait send the log for the dungeon realm bug, also explain what's wrong please.

And yes it turns out this one is a mohist problem

commented

Got some help from the forge discord:

Seems that they add a world field to WorldBorder which they they initialize in Level via a  https://github.com/MohistMC/Mohist/blob/d7f27f30c9c4d68e0d348fe2238b13fdf6bd66b3/patches/minecraft/net/minecraft/world/level/Level.java.patch#L198C8-L199C31.
So likely just some mod interaction of either creating a new WorldBorder or that code never running

TBH I'd just note it down as Mohist being Mohist, I personally wouldn't provide support for it

Found your code, and yep, it's because Mohist expects the WorldBorder from getWorldBorder to be only a single instance and not recreated like you do in your mixin in LibraryOfExile.
They only populate their world field in the constructor of Level and (at least from a quick scan) never again.

If you want to support Mohist you could maybe get away with adding (and populating) a public Level world field to your MapWorldBorder, I honestly can't remember bytecode wise if that would work or not atm, or do some reflection to see if the field is present on the upstream object and reflectively set it on yours.

Honestly I'd just write it down as an Incompatibility and move on

Tldr report to mohist

commented

yeah I've reported the bug to mohist on github.

As to the map, there are no logs for the dungeon map bug. It's just the level requirement of the maps changing as the player levels up. The level requirement is always the same as the my mine and slash level and I can't get in the dungeon via the map device because it says that my level is too low, but in fact it's not.

commented

Oh that's not a bug, will be clarified in the future. Just level up more

commented

oh ok. gonna continue exploring

commented

Closing as this should be fixed by mohist instead. If they refuse, i can try to work around it somehow but until then disabling the border override in all the server configs of my dimensions should fix the issue, albeit you will need to wipe both the dimension folder in your save/server and do the command to wipe data ingame every time the dimensions get full and you start being sent to place outside of world borders