mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-25 12:25:37 +01:00
Minor cleanup in adapters
This commit is contained in:
parent
922e4478dc
commit
697ad1b3ce
@ -22,25 +22,25 @@ import net.coreprotect.utility.Util;
|
||||
public class BukkitAdapter implements BukkitInterface {
|
||||
|
||||
public static BukkitInterface ADAPTER;
|
||||
public static final int BUKKIT_v1_13 = 13;
|
||||
public static final int BUKKIT_v1_14 = 14;
|
||||
public static final int BUKKIT_v1_15 = 15;
|
||||
public static final int BUKKIT_v1_16 = 16;
|
||||
public static final int BUKKIT_v1_17 = 17;
|
||||
public static final int BUKKIT_V1_13 = 13;
|
||||
public static final int BUKKIT_V1_14 = 14;
|
||||
public static final int BUKKIT_V1_15 = 15;
|
||||
public static final int BUKKIT_V1_16 = 16;
|
||||
public static final int BUKKIT_V1_17 = 17;
|
||||
|
||||
public static void loadAdapter() {
|
||||
switch (ConfigHandler.SERVER_VERSION) {
|
||||
case BUKKIT_v1_13:
|
||||
case BUKKIT_v1_14:
|
||||
case BUKKIT_V1_13:
|
||||
case BUKKIT_V1_14:
|
||||
BukkitAdapter.ADAPTER = new BukkitAdapter();
|
||||
break;
|
||||
case BUKKIT_v1_15:
|
||||
case BUKKIT_V1_15:
|
||||
BukkitAdapter.ADAPTER = new Bukkit_v1_15();
|
||||
break;
|
||||
case BUKKIT_v1_16:
|
||||
case BUKKIT_V1_16:
|
||||
BukkitAdapter.ADAPTER = new Bukkit_v1_16();
|
||||
break;
|
||||
case BUKKIT_v1_17:
|
||||
case BUKKIT_V1_17:
|
||||
default:
|
||||
BukkitAdapter.ADAPTER = new Bukkit_v1_17();
|
||||
break;
|
||||
|
@ -10,29 +10,29 @@ public class PaperAdapter implements PaperInterface {
|
||||
|
||||
public static PaperInterface ADAPTER;
|
||||
public static final int PAPER_UNAVAILABLE = 0;
|
||||
public static final int PAPER_v1_13 = BukkitAdapter.BUKKIT_v1_13;
|
||||
public static final int PAPER_v1_14 = BukkitAdapter.BUKKIT_v1_14;
|
||||
public static final int PAPER_v1_15 = BukkitAdapter.BUKKIT_v1_15;
|
||||
public static final int PAPER_v1_16 = BukkitAdapter.BUKKIT_v1_16;
|
||||
public static final int PAPER_v1_17 = BukkitAdapter.BUKKIT_v1_17;
|
||||
public static final int PAPER_V1_13 = BukkitAdapter.BUKKIT_V1_13;
|
||||
public static final int PAPER_V1_14 = BukkitAdapter.BUKKIT_V1_14;
|
||||
public static final int PAPER_V1_15 = BukkitAdapter.BUKKIT_V1_15;
|
||||
public static final int PAPER_V1_16 = BukkitAdapter.BUKKIT_V1_16;
|
||||
public static final int PAPER_V1_17 = BukkitAdapter.BUKKIT_V1_17;
|
||||
|
||||
public static void loadAdapter() {
|
||||
int PAPER_VERSION = ConfigHandler.SERVER_VERSION;
|
||||
int paperVersion = ConfigHandler.SERVER_VERSION;
|
||||
if (!ConfigHandler.isPaper) {
|
||||
PAPER_VERSION = PAPER_UNAVAILABLE;
|
||||
paperVersion = PAPER_UNAVAILABLE;
|
||||
}
|
||||
|
||||
switch (PAPER_VERSION) {
|
||||
switch (paperVersion) {
|
||||
case PAPER_UNAVAILABLE:
|
||||
PaperAdapter.ADAPTER = new PaperAdapter();
|
||||
break;
|
||||
case PAPER_v1_13:
|
||||
case PAPER_v1_14:
|
||||
case PAPER_v1_15:
|
||||
case PAPER_V1_13:
|
||||
case PAPER_V1_14:
|
||||
case PAPER_V1_15:
|
||||
PaperAdapter.ADAPTER = new PaperHandler();
|
||||
break;
|
||||
case PAPER_v1_16:
|
||||
case PAPER_v1_17:
|
||||
case PAPER_V1_16:
|
||||
case PAPER_V1_17:
|
||||
default:
|
||||
PaperAdapter.ADAPTER = new Paper_v1_16();
|
||||
break;
|
||||
|
@ -13,29 +13,29 @@ public class SpigotAdapter implements SpigotInterface {
|
||||
|
||||
public static SpigotInterface ADAPTER;
|
||||
public static final int SPIGOT_UNAVAILABLE = 0;
|
||||
public static final int SPIGOT_v1_13 = BukkitAdapter.BUKKIT_v1_13;
|
||||
public static final int SPIGOT_v1_14 = BukkitAdapter.BUKKIT_v1_14;
|
||||
public static final int SPIGOT_v1_15 = BukkitAdapter.BUKKIT_v1_15;
|
||||
public static final int SPIGOT_v1_16 = BukkitAdapter.BUKKIT_v1_16;
|
||||
public static final int SPIGOT_v1_17 = BukkitAdapter.BUKKIT_v1_17;
|
||||
public static final int SPIGOT_V1_13 = BukkitAdapter.BUKKIT_V1_13;
|
||||
public static final int SPIGOT_V1_14 = BukkitAdapter.BUKKIT_V1_14;
|
||||
public static final int SPIGOT_V1_15 = BukkitAdapter.BUKKIT_V1_15;
|
||||
public static final int SPIGOT_V1_16 = BukkitAdapter.BUKKIT_V1_16;
|
||||
public static final int SPIGOT_V1_17 = BukkitAdapter.BUKKIT_V1_17;
|
||||
|
||||
public static void loadAdapter() {
|
||||
int SPIGOT_VERSION = ConfigHandler.SERVER_VERSION;
|
||||
int spigotVersion = ConfigHandler.SERVER_VERSION;
|
||||
if (!ConfigHandler.isSpigot) {
|
||||
SPIGOT_VERSION = SPIGOT_UNAVAILABLE;
|
||||
spigotVersion = SPIGOT_UNAVAILABLE;
|
||||
}
|
||||
|
||||
switch (SPIGOT_VERSION) {
|
||||
switch (spigotVersion) {
|
||||
case SPIGOT_UNAVAILABLE:
|
||||
SpigotAdapter.ADAPTER = new SpigotAdapter();
|
||||
break;
|
||||
case SPIGOT_v1_13:
|
||||
case SPIGOT_v1_14:
|
||||
case SPIGOT_v1_15:
|
||||
case SPIGOT_V1_13:
|
||||
case SPIGOT_V1_14:
|
||||
case SPIGOT_V1_15:
|
||||
SpigotAdapter.ADAPTER = new SpigotHandler();
|
||||
break;
|
||||
case SPIGOT_v1_16:
|
||||
case SPIGOT_v1_17:
|
||||
case SPIGOT_V1_16:
|
||||
case SPIGOT_V1_17:
|
||||
default:
|
||||
SpigotAdapter.ADAPTER = new Spigot_v1_16();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user