apace100 / apoli

MIT License
40 stars 46 forks source link

Using a wrong dimension in a Modify Player Spawn power creates issues and is not catched #19

Closed Creerio closed 1 year ago

Creerio commented 3 years ago

Minecraft and Java Informations

Launcher used : MultiMC V0.6.14-develop-3011

Minecraft version : 1.18.1 w/ Fabric loader 0.12.11

Java version : Openjdk 17.0.1

Mod versions : Origins v1.3.1, Apoli v2.2.2, Fabric API 0.44.0

Summary of the issue

Selecting an origin with a Modify Player Spawn power using a wrong dimension creates issues.

After new world generation, the game stops the world's loading. Video of world loading with error in MMC logs

It also blocks the respawn button from working properly when dying with no respawn point in an already created world. Same thing with the gamerule doImmediateRespawn set to true, except it's a bit weirder. Video of issue with world and gamerule

Usually, when having a wrong json power file, the mod detects it and blocks it's loading while logging the info, allowing the datapack's creator to understand where the issue is. In this case, it does not. It even attempts to spawn the player there which is not possible, creating theses issues.

For context : The original issue was that I thought an overworld modify player spawn power did no longer work (unlike the 1.16.5 version of origins in which I had no problems), however as pointed out by eehunter (comment under this one), I've made a typo in my power file.

Error message

See this hatebin

How to reproduce it

Step 1 : Create an origin datapack, it must contain at least one origin using a Modify Player Spawn with a wrong dimension power, for example you can use this one

Step 2 : Load it in any world, either a new one or an already created one

Step 3 : If you created a new one, select the origin having the problematic power. If you're using one you've already made before, change your origin to that and kill yourself.

Step 4 : Check your minecraft logs, you should have the error message.

eehunter commented 2 years ago

snow_mountain_spawn.json line 5 "dimension": "minecraft:owerworld", Typo in minecraft:overworld The error message is caused by an invalid RegistryKey. getSpawn should log an error message and return null if world is null (I.E. RegistryKey<World> dimension does not contain a valid dimension key)

Creerio commented 2 years ago

Welp.. I should have verified the dimension name.. It does work as intended with the right one.

Thanks for the help, I will modify the original issue since having an invalid dimension still creates an issue when spawning the player or when reading the json power file (unlike other powers which have their errors catched and logged).