MarkusBordihn / BOs-Adaptive-Performance-Tweaks

Adaptive Performance Tweaks is a collection of Minecraft Forge server-side Mod which automatically adjust specific settings on the server to allow a more balanced TPS/FPS.
Other
4 stars 2 forks source link

Server Crashing from ADPT #27

Closed Zelioth closed 1 year ago

Zelioth commented 1 year ago

Describe the bug Recently cleaned up my mod pack and server of mods that cause issues and really changed the dynamic of gameplay. This change fixed a ton of bugs but I guess opened up the window for new ones. Recently I am getting crashes from

Cannot invoke "net.minecraft.world.level.block.entity.BlockEntity.m58901()" because the return value of "net.minecraft.world.level.BaseSpawner.getSpawnerBlockEntity()" is null

which is new or is newly reported in our crash reports.

To Reproduce Steps to reproduce the behavior: install the mod run the server poof

Is the issue happening in combination with other mods? (If yes, please provide a full list) My mod pack is Friends United. So maybe

crash-2022-11-11_15.35.30-server.txt crash-2022-11-11_15.50.19-server.txt

MarkusBordihn commented 1 year ago

Thanks for the report. I will add an additional checks to avoid this kind of errors.

It looks like that your world data contains references to blocks entities which are no longer available. My patch will only make sure to skip these kind of issue, but on the long term you should use the "optimize" function from the client to get rid of these block references to avoid any other side effects.

MarkusBordihn commented 1 year ago

Should be online in the next minutes over https://www.curseforge.com/minecraft/mc-mods/adaptive-performance-tweaks-spawn/files/4081684 .

Zelioth commented 1 year ago

Howdy, Thanks for the quick reply. I do wanna ask what exactly you mean by

references to blocks entities which are no longer available

how exactly do you see that information or am I just not reading the report enough haha. The world is brand new, freshly generated due to my mod pack "Friends United" being updated and so much being changed we did a reset. So I'm not sure why blocks wouldn't be existing.

Secondly how exactly would I do this

" "optimize" function from the client to get rid of these block references to avoid any other side effects."

are you saying this is a feature in your absolutely wonderful mods.. No joke your mods are a life saver

MarkusBordihn commented 1 year ago

Normally the getSpawnerBlockEntity() function returns null if the entity to the corresponding block is no longer available. This mostly happens in the case when data-packs or mods with the entity definitions are removed, but still exist in the world data. The same effect could be also caused by other optimization mods which unloads chunks or something like this.

If this is a brand new, freshly generated world, you could safely ignore it.

By "Edit" a world inside the client, you can run the "Optimize World" feature.

image

This remove all former artifacts by using "Erase cached data". It's useful if you remove mods or data-packs and don't want to re-use them to remove their artifacts. Please make sure to test this only on a backup version of the world.

You can do the same with server worlds, you just need to download them and load them into the client.