fix: Should fix the disconnect issue when pretty much all existing spell packs are present in the game

Mods were registering spells on the client and server side in a different order (perhaps related to the OS), causing a mismatch in spell networkIDs. This will ensure that spells are sorted alphabetically and redistributes a new ID.
This commit is contained in:
WinDanesz
2022-04-17 20:43:59 +02:00
parent ea27b1a081
commit 3155aa6815
3 changed files with 42 additions and 1 deletions
@@ -20,6 +20,7 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardryLoot;
import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.SpellNetworkIDSorter;
import electroblob.wizardry.util.SpellProperties;
import electroblob.wizardry.util.WandHelper;
import electroblob.wizardry.worldgen.WorldGenCrystalFlower;
@@ -202,6 +203,8 @@ public class Wizardry {
public void postInit(FMLPostInitializationEvent event){
proxy.initialiseLayers();
proxy.initialiseAnimations();
SpellNetworkIDSorter.init();
}
@EventHandler