mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-25 15:35:11 +01:00
Refactored NMS packages
This commit is contained in:
parent
1f958e5eb9
commit
f2c100538b
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_15_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_15_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.BlockBreakWrapper;
|
||||
import net.minecraft.server.v1_15_R1.BlockPosition;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_15_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_15_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.ChatComponentWrapper;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_15_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_15_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.CooldownWrapper;
|
||||
import net.minecraft.server.v1_15_R1.EntityHuman;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_15_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_15_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.OpenInventoryWrapper;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_15_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_15_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.RepairCostWrapper;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_15_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_15_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.TridentStackWrapper;
|
||||
import net.minecraft.server.v1_15_R1.EntityThrownTrident;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.BlockBreakWrapper;
|
||||
import net.minecraft.server.v1_16_R1.BlockPosition;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R1;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.CooldownWrapper;
|
||||
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.OpenInventoryWrapper;
|
||||
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.RepairCostWrapper;
|
||||
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R1;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R1;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.TridentStackWrapper;
|
||||
import net.minecraft.server.v1_16_R1.EntityThrownTrident;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R2;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R2;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.BlockBreakWrapper;
|
||||
import net.minecraft.server.v1_16_R2.BlockPosition;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R2;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R2;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R2;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R2;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.CooldownWrapper;
|
||||
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R2;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R2;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.OpenInventoryWrapper;
|
||||
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R2;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R2;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.RepairCostWrapper;
|
||||
import org.bukkit.craftbukkit.v1_16_R2.inventory.CraftItemStack;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R2;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R2;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.TridentStackWrapper;
|
||||
import net.minecraft.server.v1_16_R2.EntityThrownTrident;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R3;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R3;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.BlockBreakWrapper;
|
||||
import net.minecraft.server.v1_16_R3.BlockPosition;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R3;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R3;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R3;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R3;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.CooldownWrapper;
|
||||
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R3;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R3;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.OpenInventoryWrapper;
|
||||
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R3;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R3;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.RepairCostWrapper;
|
||||
import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack;
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.v1_16_R3;
|
||||
package com.willfp.ecoenchants.nms.v1_16_R3;
|
||||
|
||||
import com.willfp.ecoenchants.nms.api.TridentStackWrapper;
|
||||
import net.minecraft.server.v1_16_R3.EntityThrownTrident;
|
@ -25,7 +25,7 @@ public class BlockBreak {
|
||||
|
||||
static {
|
||||
try {
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants." + EcoEnchantsPlugin.NMS_VERSION + ".BlockBreak");
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants.nms." + EcoEnchantsPlugin.NMS_VERSION + ".BlockBreak");
|
||||
if (BlockBreakWrapper.class.isAssignableFrom(class2)) {
|
||||
blockBreakWrapper = (BlockBreakWrapper) class2.getConstructor().newInstance();
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class ChatComponent {
|
||||
|
||||
static {
|
||||
try {
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants." + EcoEnchantsPlugin.NMS_VERSION + ".ChatComponent");
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants.nms." + EcoEnchantsPlugin.NMS_VERSION + ".ChatComponent");
|
||||
if (ChatComponentWrapper.class.isAssignableFrom(class2)) {
|
||||
chatComponentWrapper = (ChatComponentWrapper) class2.getConstructor().newInstance();
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class Cooldown {
|
||||
|
||||
static {
|
||||
try {
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants." + EcoEnchantsPlugin.NMS_VERSION + ".Cooldown");
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants.nms." + EcoEnchantsPlugin.NMS_VERSION + ".Cooldown");
|
||||
if (CooldownWrapper.class.isAssignableFrom(class2)) {
|
||||
cooldown = (CooldownWrapper) class2.getConstructor().newInstance();
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class OpenInventory {
|
||||
|
||||
static {
|
||||
try {
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants." + EcoEnchantsPlugin.NMS_VERSION + ".OpenInventory");
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants.nms." + EcoEnchantsPlugin.NMS_VERSION + ".OpenInventory");
|
||||
if (OpenInventoryWrapper.class.isAssignableFrom(class2)) {
|
||||
openInventoryWrapper = (OpenInventoryWrapper) class2.getConstructor().newInstance();
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public class RepairCost {
|
||||
|
||||
static {
|
||||
try {
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants." + EcoEnchantsPlugin.NMS_VERSION + ".RepairCost");
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants.nms." + EcoEnchantsPlugin.NMS_VERSION + ".RepairCost");
|
||||
if (RepairCostWrapper.class.isAssignableFrom(class2)) {
|
||||
repairCostWrapper = (RepairCostWrapper) class2.getConstructor().newInstance();
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public class TridentStack {
|
||||
|
||||
static {
|
||||
try {
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants." + EcoEnchantsPlugin.NMS_VERSION + ".TridentStack");
|
||||
final Class<?> class2 = Class.forName("com.willfp.ecoenchants.nms." + EcoEnchantsPlugin.NMS_VERSION + ".TridentStack");
|
||||
if (TridentStackWrapper.class.isAssignableFrom(class2)) {
|
||||
tridentStackWrapper = (TridentStackWrapper) class2.getConstructor().newInstance();
|
||||
}
|
||||
|
@ -80,6 +80,20 @@ public class Loader {
|
||||
Logger.info("");
|
||||
Logger.info("==========================================");
|
||||
|
||||
/*
|
||||
Check server version is supported
|
||||
*/
|
||||
|
||||
if(!Arrays.asList(
|
||||
"v1_15_R1",
|
||||
"v1_16_R1",
|
||||
"v1_16_R2",
|
||||
"v1_16_R3"
|
||||
).contains(EcoEnchantsPlugin.NMS_VERSION)) {
|
||||
Logger.error("Your server version (" + EcoEnchantsPlugin.NMS_VERSION + ") is not supported!");
|
||||
Bukkit.getPluginManager().disablePlugin(EcoEnchantsPlugin.getInstance());
|
||||
}
|
||||
|
||||
/*
|
||||
Load Configs
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user