From 4c3224efad62271c4647478b173fa4023181e0fc Mon Sep 17 00:00:00 2001 From: fullwall Date: Wed, 8 Jun 2022 14:07:33 +0800 Subject: [PATCH] Remove eclipse compiler from poms --- dist/pom.xml | 124 ++++++++------- .../main/java/net/citizensnpcs/Citizens.java | 2 +- .../java/net/citizensnpcs/util/Messages.java | 2 +- .../main/java/net/citizensnpcs/util/NMS.java | 39 ++--- .../src/main/resources/messages_en.properties | 2 +- v1_14_R1/pom.xml | 12 +- v1_15_R1/pom.xml | 146 ++++++++---------- v1_16_R3/pom.xml | 146 ++++++++---------- v1_17_R1/pom.xml | 14 +- v1_18_R2/pom.xml | 14 +- v1_19_R1/pom.xml | 18 +-- 11 files changed, 233 insertions(+), 286 deletions(-) diff --git a/dist/pom.xml b/dist/pom.xml index 2d4993d23..4f3fa9b2f 100644 --- a/dist/pom.xml +++ b/dist/pom.xml @@ -1,64 +1,62 @@ - - 4.0.0 - - net.citizensnpcs - citizens-parent - 2.0.30-SNAPSHOT - - citizens - pom - - - - org.apache.maven.plugins - maven-assembly-plugin - - Citizens-${CITIZENS_VERSION}-b${BUILD_NUMBER} - false - - 3.2.0 - - - package-all - package - - single - - - false - - src/main/assembly/all-jar.xml - - - - - - - - - - ${project.groupId} - citizens-main - ${project.version} - jar - compile - - - ${project.groupId} - citizens-v1_8_R3 - ${project.version} - jar - compile - - - ${project.groupId} - citizens-v1_12_R1 - ${project.version} - jar - compile - + + 4.0.0 + + net.citizensnpcs + citizens-parent + 2.0.30-SNAPSHOT + + citizens + pom + + + + org.apache.maven.plugins + maven-assembly-plugin + + Citizens-${CITIZENS_VERSION}-b${BUILD_NUMBER} + false + + 3.2.0 + + + package-all + package + + single + + + false + + src/main/assembly/all-jar.xml + + + + + + + + + + ${project.groupId} + citizens-main + ${project.version} + jar + compile + + + ${project.groupId} + citizens-v1_8_R3 + ${project.version} + jar + compile + + + ${project.groupId} + citizens-v1_12_R1 + ${project.version} + jar + compile + ${project.groupId} citizens-v1_16_R3 @@ -87,5 +85,5 @@ jar compile - - + + \ No newline at end of file diff --git a/main/src/main/java/net/citizensnpcs/Citizens.java b/main/src/main/java/net/citizensnpcs/Citizens.java index a30db2e30..a90c36280 100644 --- a/main/src/main/java/net/citizensnpcs/Citizens.java +++ b/main/src/main/java/net/citizensnpcs/Citizens.java @@ -426,8 +426,8 @@ public class Citizens extends JavaPlugin implements CitizensPlugin { Economy economy = provider.getProvider(); Bukkit.getPluginManager().registerEvents(new PaymentListener(economy), this); } + Messaging.logTr(Messages.LOADED_ECONOMY); } catch (NoClassDefFoundError e) { - Messaging.logTr(Messages.ERROR_LOADING_ECONOMY); } } diff --git a/main/src/main/java/net/citizensnpcs/util/Messages.java b/main/src/main/java/net/citizensnpcs/util/Messages.java index 95d1bc43b..a268fd76f 100644 --- a/main/src/main/java/net/citizensnpcs/util/Messages.java +++ b/main/src/main/java/net/citizensnpcs/util/Messages.java @@ -108,7 +108,6 @@ public class Messages { public static final String ERROR_GETTING_ID_MAPPING = "citizens.nms-errors.getting-id-mapping"; public static final String ERROR_GETTING_METHOD = "citizens.nms-errors.getting-method"; public static final String ERROR_INITALISING_SUB_PLUGIN = "citizens.sub-plugins.error-on-load"; - public static final String ERROR_LOADING_ECONOMY = "citizens.economy.error-loading"; public static final String ERROR_RESTORING_GOALS = "citizens.nms-errors.restoring-goals"; public static final String ERROR_SETTING_ENTITY_PERSISTENT = "citizens.nms-errors.error-setting-persistent"; public static final String ERROR_SETTING_LOOKCLOSE_RANGE = "citizens.commands.npc.lookclose.error-random-range"; @@ -216,6 +215,7 @@ public class Messages { public static final String LOAD_NAME_NOT_FOUND = "citizens.notifications.npc-name-not-found"; public static final String LOAD_TASK_NOT_SCHEDULED = "citizens.load-task-error"; public static final String LOAD_UNKNOWN_NPC_TYPE = "citizens.notifications.unknown-npc-type"; + public static final String LOADED_ECONOMY = "citizens.economy.loaded"; public static final String LOADING_SUB_PLUGIN = "citizens.sub-plugins.load"; public static final String LOCALE_NOTIFICATION = "citizens.notifications.locale"; public static final String LOOKCLOSE_RANDOM_DELAY_SET = "citizens.commands.npc.lookclose.random-look-delay-set"; diff --git a/main/src/main/java/net/citizensnpcs/util/NMS.java b/main/src/main/java/net/citizensnpcs/util/NMS.java index 74bc12568..d79b3b6cd 100644 --- a/main/src/main/java/net/citizensnpcs/util/NMS.java +++ b/main/src/main/java/net/citizensnpcs/util/NMS.java @@ -116,8 +116,8 @@ public class NMS { return getFinalSetter(clazz, field, true); } - public static MethodHandle getFinalSetter(Class clazz, String field, boolean log) { - Field f; + public static MethodHandle getFinalSetter(Class clazz, String fieldName, boolean log) { + Field field; if (MODIFIERS_FIELD == null) { if (UNSAFE == null) { try { @@ -125,52 +125,52 @@ public class NMS { } catch (Exception e) { e.printStackTrace(); if (log) { - Messaging.logTr(Messages.ERROR_GETTING_FIELD, field, e.getLocalizedMessage()); + Messaging.logTr(Messages.ERROR_GETTING_FIELD, fieldName, e.getLocalizedMessage()); } return null; } - UNSAFE_STATIC_FIELD_OFFSET = NMS - .getMethodHandle(UNSAFE.getClass(), "staticFieldOffset", true, Field.class).bindTo(UNSAFE); - UNSAFE_FIELD_OFFSET = NMS.getMethodHandle(UNSAFE.getClass(), "objectFieldOffset", true, Field.class) + UNSAFE_STATIC_FIELD_OFFSET = getMethodHandle(UNSAFE.getClass(), "staticFieldOffset", true, Field.class) .bindTo(UNSAFE); - UNSAFE_PUT_OBJECT = NMS - .getMethodHandle(UNSAFE.getClass(), "putObject", true, Object.class, long.class, Object.class) + UNSAFE_FIELD_OFFSET = getMethodHandle(UNSAFE.getClass(), "objectFieldOffset", true, Field.class) .bindTo(UNSAFE); + UNSAFE_PUT_OBJECT = getMethodHandle(UNSAFE.getClass(), "putObject", true, Object.class, long.class, + Object.class).bindTo(UNSAFE); } - f = NMS.getField(clazz, field, log); - if (f == null) { + field = NMS.getField(clazz, fieldName, log); + if (field == null) { return null; } try { - boolean isStatic = Modifier.isStatic(f.getModifiers()); - long offset = (long) (isStatic ? UNSAFE_STATIC_FIELD_OFFSET.invoke(f) : UNSAFE_FIELD_OFFSET.invoke(f)); + boolean isStatic = Modifier.isStatic(field.getModifiers()); + long offset = (long) (isStatic ? UNSAFE_STATIC_FIELD_OFFSET.invoke(field) + : UNSAFE_FIELD_OFFSET.invoke(field)); return isStatic ? MethodHandles.insertArguments(UNSAFE_PUT_OBJECT, 0, clazz, offset) : MethodHandles.insertArguments(UNSAFE_PUT_OBJECT, 1, offset); } catch (Throwable t) { t.printStackTrace(); if (log) { - Messaging.logTr(Messages.ERROR_GETTING_FIELD, field, t.getLocalizedMessage()); + Messaging.logTr(Messages.ERROR_GETTING_FIELD, fieldName, t.getLocalizedMessage()); } return null; } } - f = getField(clazz, field, log); - if (f == null) { + field = getField(clazz, fieldName, log); + if (field == null) { return null; } try { - MODIFIERS_FIELD.setInt(f, f.getModifiers() & ~Modifier.FINAL); + MODIFIERS_FIELD.setInt(field, field.getModifiers() & ~Modifier.FINAL); } catch (Exception e) { if (log) { - Messaging.logTr(Messages.ERROR_GETTING_FIELD, field, e.getLocalizedMessage()); + Messaging.logTr(Messages.ERROR_GETTING_FIELD, fieldName, e.getLocalizedMessage()); } return null; } try { - return LOOKUP.unreflectSetter(f); + return LOOKUP.unreflectSetter(field); } catch (Exception e) { if (log) { - Messaging.logTr(Messages.ERROR_GETTING_FIELD, field, e.getLocalizedMessage()); + Messaging.logTr(Messages.ERROR_GETTING_FIELD, fieldName, e.getLocalizedMessage()); } } return null; @@ -402,6 +402,7 @@ public class NMS { } ADD_OPENS.invoke(GET_MODULE.invoke(from), from.getPackage().getName(), GET_MODULE.invoke(to)); } catch (Exception e) { + e.printStackTrace(); } } diff --git a/main/src/main/resources/messages_en.properties b/main/src/main/resources/messages_en.properties index 0a7f3ad06..0ef21cdb5 100644 --- a/main/src/main/resources/messages_en.properties +++ b/main/src/main/resources/messages_en.properties @@ -303,7 +303,7 @@ citizens.commands.waypoints.opendoors.enabled=[[{0}]] will now open doors while citizens.commands.waypoints.opendoors.disabled=[[{0}]] will no longer doors while pathfinding. citizens.commands.wolf.traits-updated=[[{0}]]''s Traits were updated. Angry:[[{1}]], Sitting:[[{2}]], Tamed:[[{3}]], Collar Color:[[{4}]] citizens.conversations.selection.invalid-choice=[[{0}]] is not a valid option. -citizens.economy.error-loading=Vault not found -> no economy handling. +citizens.economy.loaded=Loaded economy handling via Vault. citizens.economy.minimum-cost-required=Need at least [[{0}]]. citizens.economy.money-withdrawn=Withdrew [[{0}]] for your NPC. citizens.editors.already-in-editor=You''re already in an editor! diff --git a/v1_14_R1/pom.xml b/v1_14_R1/pom.xml index 25d2d548c..05717e8cd 100644 --- a/v1_14_R1/pom.xml +++ b/v1_14_R1/pom.xml @@ -48,18 +48,10 @@ org.apache.maven.plugins maven-compiler-plugin 3.8.1 - - eclipse + 1.8 1.8 - - - - org.codehaus.plexus - plexus-compiler-eclipse - 2.8.8 - - + diff --git a/v1_15_R1/pom.xml b/v1_15_R1/pom.xml index 8c075627b..60491c66e 100644 --- a/v1_15_R1/pom.xml +++ b/v1_15_R1/pom.xml @@ -1,86 +1,76 @@ - - 4.0.0 - - net.citizensnpcs - citizens-parent - 2.0.30-SNAPSHOT - - citizens-v1_15_R1 + + 4.0.0 + + net.citizensnpcs + citizens-parent + 2.0.30-SNAPSHOT + + citizens-v1_15_R1 - - UTF-8 - 1.15.2-R0.1-SNAPSHOT - + + UTF-8 + 1.15.2-R0.1-SNAPSHOT + - - - everything - http://repo.citizensnpcs.co - - + + + everything + http://repo.citizensnpcs.co + + - - - ${project.groupId} - citizens-main - ${project.version} - jar - provided - - - org.spigotmc - spigot - ${craftbukkit.version} - jar - provided - - + + + ${project.groupId} + citizens-main + ${project.version} + jar + provided + + + org.spigotmc + spigot + ${craftbukkit.version} + jar + provided + + - - clean package install - ${basedir}/src/main/java + + clean package install + ${basedir}/src/main/java - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - eclipse - 1.8 - 1.8 - - - - org.codehaus.plexus - plexus-compiler-eclipse - 2.8.8 - - - + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + - - org.apache.maven.plugins - maven-shade-plugin - 3.2.1 - - - package - - shade - - - - - - - + + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + + package + + shade + + + + + + + \ No newline at end of file diff --git a/v1_16_R3/pom.xml b/v1_16_R3/pom.xml index 9507641c1..af7ada30e 100644 --- a/v1_16_R3/pom.xml +++ b/v1_16_R3/pom.xml @@ -1,86 +1,76 @@ - - 4.0.0 - - net.citizensnpcs - citizens-parent - 2.0.30-SNAPSHOT - - citizens-v1_16_R3 + + 4.0.0 + + net.citizensnpcs + citizens-parent + 2.0.30-SNAPSHOT + + citizens-v1_16_R3 - - UTF-8 - 1.16.5-R0.1-SNAPSHOT - + + UTF-8 + 1.16.5-R0.1-SNAPSHOT + - - - everything - http://repo.citizensnpcs.co - - + + + everything + http://repo.citizensnpcs.co + + - - - ${project.groupId} - citizens-main - ${project.version} - jar - provided - - - org.spigotmc - spigot - ${craftbukkit.version} - jar - provided - - + + + ${project.groupId} + citizens-main + ${project.version} + jar + provided + + + org.spigotmc + spigot + ${craftbukkit.version} + jar + provided + + - - clean package install - ${basedir}/src/main/java + + clean package install + ${basedir}/src/main/java - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - eclipse - 1.8 - 1.8 - - - - org.codehaus.plexus - plexus-compiler-eclipse - 2.8.8 - - - + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + - - org.apache.maven.plugins - maven-shade-plugin - 3.2.1 - - - package - - shade - - - - - - - + + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + + package + + shade + + + + + + + \ No newline at end of file diff --git a/v1_17_R1/pom.xml b/v1_17_R1/pom.xml index ef7b71b58..f0dd9bda2 100644 --- a/v1_17_R1/pom.xml +++ b/v1_17_R1/pom.xml @@ -47,24 +47,16 @@ org.apache.maven.plugins maven-compiler-plugin 3.8.1 - - eclipse + 1.8 1.8 - - - - org.codehaus.plexus - plexus-compiler-eclipse - 2.8.8 - - + net.md-5 specialsource-maven-plugin - 1.2.2 + 1.2.4 package diff --git a/v1_18_R2/pom.xml b/v1_18_R2/pom.xml index badea8197..7c6cacbe2 100644 --- a/v1_18_R2/pom.xml +++ b/v1_18_R2/pom.xml @@ -47,24 +47,16 @@ org.apache.maven.plugins maven-compiler-plugin 3.8.1 - - eclipse + 1.8 1.8 - - - - org.codehaus.plexus - plexus-compiler-eclipse - 2.8.8 - - + net.md-5 specialsource-maven-plugin - 1.2.2 + 1.2.4 package diff --git a/v1_19_R1/pom.xml b/v1_19_R1/pom.xml index a784daa88..3f9d27c2e 100644 --- a/v1_19_R1/pom.xml +++ b/v1_19_R1/pom.xml @@ -10,7 +10,7 @@ UTF-8 - 1.19-R0.1-SNAPSHOT + 1.19-R0.1-SNAPSHOT @@ -44,25 +44,17 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 - eclipse 1.8 1.8 - - - org.codehaus.plexus - plexus-compiler-eclipse - 2.8.8 - - net.md-5 specialsource-maven-plugin - 1.2.2 + 1.2.4 package @@ -96,13 +88,13 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.2.2 org.apache.maven.plugins maven-shade-plugin - 3.2.1 + 3.3.0 package