Remove eclipse compiler from poms

This commit is contained in:
fullwall 2022-06-08 14:07:33 +08:00
parent 2a6a69d8be
commit 4c3224efad
11 changed files with 233 additions and 286 deletions

4
dist/pom.xml vendored
View File

@ -1,6 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.citizensnpcs</groupId>

View File

@ -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);
}
}

View File

@ -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";

View File

@ -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();
}
}

View File

@ -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!

View File

@ -49,17 +49,9 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>1.8</source>
<target>1.8</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.8</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@ -1,7 +1,5 @@
<!-- Citizens build file -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.citizensnpcs</groupId>
@ -49,17 +47,9 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>1.8</source>
<target>1.8</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.8</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@ -1,7 +1,5 @@
<!-- Citizens build file -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.citizensnpcs</groupId>
@ -49,17 +47,9 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>1.8</source>
<target>1.8</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.8</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@ -48,23 +48,15 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>1.8</source>
<target>1.8</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.8</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<version>1.2.4</version>
<executions>
<execution>
<phase>package</phase>

View File

@ -48,23 +48,15 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>1.8</source>
<target>1.8</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.8</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<version>1.2.4</version>
<executions>
<execution>
<phase>package</phase>

View File

@ -44,25 +44,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>1.8</source>
<target>1.8</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.8</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<version>1.2.4</version>
<executions>
<execution>
<phase>package</phase>
@ -96,13 +88,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>