Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Newer versioned aliases on older servers

Open TheLimeGlass opened this issue 2 years ago • 1 comments

Skript/Server Version

Skript 2.6.2
Spigot 1.12.2

Bug Description

If you go from a higher version 1.19 in my case to 1.12. The materials.json should be deleted or moved to another folder. We can't have Skript use a version that was generated on a newer version, otherwise it will error.

My suggestion: Add a version tag to the materials.json if it doesn't already, and if the version tag is not greater than the current version of Minecraft, delete it or move it and let Skript generate the version for the server.

Expected Behavior

Not error

Steps to Reproduce

Install any version greater than 1.12 with Skript. Stop and switch the server to 1.12 with the same materials.json and it will error.

Errors or Screenshots

[Server thread/ERROR]: Error occurred while enabling Skript v2.6.2-nightly-d35ada0 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
	at ch.njol.skript.aliases.Aliases.<clinit>(Aliases.java:143) ~[?:?]
	at ch.njol.skript.Skript.onEnable(Skript.java:474) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) [spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
Caused by: java.lang.IllegalArgumentException: No enum constant org.bukkit.Material.GRANITE
	at java.lang.Enum.valueOf(Unknown Source) ~[?:1.8.0_291]
	at org.bukkit.Material.valueOf(Material.java:1) ~[spigot-1.12.2.jar:git-Spigot-79a30d7-f4830a1]
	at ch.njol.skript.aliases.MaterialRegistry.load(MaterialRegistry.java:60) ~[?:?]
	at ch.njol.skript.aliases.ItemData.<clinit>(ItemData.java:101) ~[?:?]
	... 13 more
[03:14:06] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[03:14:06] [Server thread/INFO]: Done (1.529s)! For help, type "help" or "?"
[03:15:32] [Server thread/INFO]: Stopping the server
[03:15:32] [Server thread/INFO]: Stopping server

TheLimeGlass avatar Jul 02 '22 09:07 TheLimeGlass

This happens when downgrading server version, https://github.com/SkriptLang/Skript/issues/1815 These issues were usually closed saying how to fix it, but I agree that we should actually fix this.

Downgrading prio because downgrading server isn't common

TPGamesNL avatar Jul 02 '22 13:07 TPGamesNL