Stargate Rewritten

Stargate Rewritten

241 Downloads

Deleting a default gate from the plugin's gates folder results in an IllegalArgumentException

Pheotis opened this issue ยท 5 comments

commented

Background

When stargate is first run, it copies the three default gates from its resources folder into the installation's gates folder.
That folder is editable by users.

Description

When a user deletes a default gate file and restarts the server, the plugin fails to load (instead printing an IAE).

Trace

[09:44:22] [Server thread/INFO]: [Stargate] Enabling Stargate v0.10.7.3
[09:44:22] [Server thread/INFO]: [Stargate] Stargate v.0.10.7.3 is enabled.
[09:44:22] [Server thread/ERROR]: Error occurred while enabling Stargate v0.10.7.3 (Is it up to date?)
java.lang.IllegalArgumentException: The embedded resource 'gates/nether.gate' cannot be found in plugins\Stargate-0.10.7.3.jar
	at org.bukkit.plugin.java.JavaPlugin.saveResource(JavaPlugin.java:192) ~[patched_1.17.jar:git-Paper-69]
	at net.TheDgtl.Stargate.Stargate.saveDefaultGates(Stargate.java:280) ~[?:?]
	at net.TheDgtl.Stargate.Stargate.onEnable(Stargate.java:163) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.17.jar:git-Paper-69]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.jar:git-Paper-69]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.jar:git-Paper-69]
	at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.17.jar:git-Paper-69]
	at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.17.jar:git-Paper-69]
	at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:643) ~[patched_1.17.jar:git-Paper-69]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:304) ~[patched_1.17.jar:git-Paper-69]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1118) ~[patched_1.17.jar:git-Paper-69]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[patched_1.17.jar:git-Paper-69]
	at java.lang.Thread.run(Thread.java:831) [?:?]
[09:44:22] [Server thread/INFO]: [Stargate] Disabling Stargate v0.10.7.3

Repro Steps

  1. Start a server with a fresh install of stargate.
  2. Make a default gate.
  3. Stop the server
  4. Delete that default gate's .gate file from plugins/stargate/gates.
  5. Restart the server.
    Stargate has now disabled itself due to the IAE.

Note that this was tested with verifyPortals: false.

commented

@Thorinwasher Unfortunately, this issue can be repro'd with the latest release, within which the gates folder is populated.

image

I have also confirmed that the jar is populated on the test instance.

This is not the same file referenced in the stacktrace

commented

Note: this issue has now been reproduced by a user on Stargate 10.8.0

Considering that tags were added in 10.7, and that the populator was refactored in that version to handle the wool gate, that may be related to the issue.

image

commented

After some testing, we have not been able to reproduce the issue further.
It appears to be associated with an as of yet unidentified chain of events.

For now, this will be tagged as can not repro.
If someone else experiences this, please comment on this issue to detail your experience.

commented

This issue is related to an incorrect compilation on the jar file, mainly it's missing some resources, which can be seen if you unzip the jar file. There should be a gates folder inside of the jar, like this:
image

I guess we have to more explicitly define that this should be done in the jar compilation (which I don't know how currently)

commented

@Thorinwasher Unfortunately, this issue can be repro'd with the latest release, within which the gates folder is populated.

image

I have also confirmed that the jar is populated on the test instance.