3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Stop allowing everyone to change the instance

Dieser Commit ist enthalten in:
Matsv 2016-04-02 21:45:24 +02:00
Ursprung 233a2ba5df
Commit aabd9247a6

Datei anzeigen

@ -1,6 +1,7 @@
package us.myles.ViaVersion.api; package us.myles.ViaVersion.api;
import lombok.Getter; import lombok.Getter;
import org.apache.commons.lang.Validate;
import us.myles.ViaVersion.ViaVersionPlugin; import us.myles.ViaVersion.ViaVersionPlugin;
public class ViaVersion { public class ViaVersion {
@ -11,6 +12,7 @@ public class ViaVersion {
private static ViaVersionConfig config; private static ViaVersionConfig config;
public static void setInstance(ViaVersionPlugin plugin) { public static void setInstance(ViaVersionPlugin plugin) {
Validate.isTrue(instance == null, "Instance is already set");
ViaVersion.instance = plugin; ViaVersion.instance = plugin;
ViaVersion.config = plugin; ViaVersion.config = plugin;
} }