Using parent & hopefully fixed #109

This commit is contained in:
Norbi Peti 2019-10-23 02:40:34 +02:00
parent f1cec2ced1
commit 88c1d100e9
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
3 changed files with 15 additions and 33 deletions

View file

@ -9,9 +9,8 @@ before_install: | # Wget BuildTools and run if cached folder not found
fi
language: java
jdk:
- oraclejdk8
- oraclejdk11
sudo: true
dist: trusty # Needed for Java 8, although we might not need Java 8
deploy:
# deploy develop to the staging environment
- provider: script

22
pom.xml
View file

@ -2,6 +2,12 @@
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>com.github.TBMCPlugins.ButtonCore</groupId>
<artifactId>CorePOM</artifactId>
<version>master-SNAPSHOT</version>
</parent>
<groupId>com.github.TBMCPlugins</groupId>
<artifactId>DiscordPlugin</artifactId>
<version>master-SNAPSHOT</version>
@ -34,22 +40,6 @@
</resources>
<finalName>DiscordPlugin</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version>
<configuration>
<source>10</source>
<target>10</target>
<!-- <compilerArgs>
<arg>-processor</arg>
<arg>buttondevteam.buttonproc.ButtonProcessor, lombok.core.AnnotationProcessor</arg>
</compilerArgs> -->
<!-- <annotationProcessors>
<annotationProcessor>lombok.launch.AnnotationProcessorHider$AnnotationProcessor</annotationProcessor>
<annotationProcessor>buttondevteam.buttonproc.ButtonProcessor</annotationProcessor>
</annotationProcessors> -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

View file

@ -142,22 +142,15 @@ public class PlayerListWatcher {
}
});
plist = currentPL;
try {
Field mpf = mock.getClass().getField("maxPlayers");
mpf.setAccessible(true);
Field modf = mpf.getClass().getDeclaredField("modifiers");
modf.setAccessible(true);
modf.set(mpf, mpf.getModifiers() & ~Modifier.FINAL);
mpf.set(mock, mpf.get(plist));
} catch (NoSuchFieldException ignored) {
//The field no longer exists on 1.14
for (var plc = dplc; plc != null; plc = plc.getSuperclass()) { //Set all fields
for (var f : plc.getDeclaredFields()) {
f.setAccessible(true);
Field modf = f.getClass().getDeclaredField("modifiers");
modf.setAccessible(true);
modf.set(f, f.getModifiers() & ~Modifier.FINAL);
f.set(mock, f.get(plist));
}
}
Field plf = mock.getClass().getField("players");
plf.setAccessible(true);
Field modf = plf.getClass().getDeclaredField("modifiers");
modf.setAccessible(true);
modf.set(plf, plf.getModifiers() & ~Modifier.FINAL);
plf.set(mock, plf.get(plist));
}
try {
server.getClass().getMethod("a", dplc).invoke(server, up ? mock : plist);