Closed Pheotis closed 5 months ago
This no longer crashes, but does still print a warning. This stack trace should probably be suppressed and replaced with a more descriptive console error. Something like "A gate was found in the world with an invalid gateformat. Gates {names} were not loaded"
[WARN]: [Stargate] Could not find the format ''broken.gate''. Check the full startup log for more information
[WARN]: [Stargate] java.lang.IllegalArgumentException: Could not find gate format
at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.util.database.PortalStorageHelper.loadPortalData(PortalStorageHelper.java:157)
at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.util.LegacyPortalStorageLoader.readPortal(LegacyPortalStorageLoader.java:103)
at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.util.LegacyPortalStorageLoader.loadPortalsFromStorage(LegacyPortalStorageLoader.java:80)
at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.migration.DataMigration6.migratePortals(DataMigration6.java:157)
at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.migration.DataMigration6.run(DataMigration6.java:98)
at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.migration.DataMigrator.run(DataMigrator.java:97)
at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.Stargate.migrateConfigurationAndData(Stargate.java:354)
at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.Stargate.onEnable(Stargate.java:154)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:287)
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202)
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:519)
at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:604)
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:553)
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:675)
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437)
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:323)
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1136)
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323)
at java.base/java.lang.Thread.run(Thread.java:1583)
Bug Description
If a gate with an invalid gatefile is present in legacy, the migrator will lead to a crash in the rewrite.
Reproduction Steps
In the latest legacy, tested on spigot 1.17.1, create a custom gatefile such as this:
Change the gatefile to be invalid (tested by removing the entrance indicator)
Desired Behaviour
Either the gates with this format should fail to load, or perhaps they should be fixed somehow, possibly by adding the entrance at a random traversable block.
Observed Behaviour
Trace Logs
Tested on windows, spigot 1.17.1, and the latest paper 1.20.6. Tested with legacy 0.11.5.9 and nightly 3 of the rewrite.
Other Information
No response