mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-01-26 01:01:29 +01:00
Merge branch 'development'
This commit is contained in:
commit
7c778fc90a
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -170,10 +170,7 @@ public enum CompatibleBiome {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCompatible() {
|
public boolean isCompatible() {
|
||||||
Version version = versions.getLast();
|
return getBiome() != null;
|
||||||
ServerVersion.isServerVersionAtLeast(version.version);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Version> getVersions() {
|
public List<Version> getVersions() {
|
||||||
@ -181,11 +178,14 @@ public enum CompatibleBiome {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Biome getBiome() {
|
public Biome getBiome() {
|
||||||
|
try {
|
||||||
for (Version version : versions) {
|
for (Version version : versions) {
|
||||||
if (ServerVersion.isServerVersionAtLeast(version.version)) {
|
if (ServerVersion.isServerVersionAtLeast(version.version)) {
|
||||||
return Biome.valueOf(version.biome);
|
return Biome.valueOf(version.biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (IllegalArgumentException ignore) { // This means the supporter biome server version is wrongly configured
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -6,46 +6,53 @@ import java.lang.reflect.Method;
|
|||||||
|
|
||||||
public enum MethodMapping {
|
public enum MethodMapping {
|
||||||
|
|
||||||
MC_ITEM_STACK__GET_TAG("getTag", "s"),
|
MC_ITEM_STACK__GET_TAG("getTag", "getTag", "s"),
|
||||||
MC_ITEM_STACK__SET_TAG("setTag", "c", ClassMapping.NBT_TAG_COMPOUND.getClazz()),
|
MC_ITEM_STACK__SET_TAG("setTag", "setTag", "c", ClassMapping.NBT_TAG_COMPOUND.getClazz()),
|
||||||
|
|
||||||
MC_NBT_TAG_COMPOUND__SET("set", "a", String.class, ClassMapping.NBT_BASE.getClazz()),
|
MC_NBT_TAG_COMPOUND__SET("set", "set", "a", String.class, ClassMapping.NBT_BASE.getClazz()),
|
||||||
MC_NBT_TAG_COMPOUND__SET_SHORT("setShort", "a", String.class),
|
MC_NBT_TAG_COMPOUND__SET_SHORT("setShort", "setShort", "a", String.class),
|
||||||
MC_NBT_TAG_COMPOUND__SET_STRING("setString", "a", String.class, String.class),
|
MC_NBT_TAG_COMPOUND__SET_STRING("setString", "setString", "a", String.class, String.class),
|
||||||
MC_NBT_TAG_COMPOUND__REMOVE("remove", "r", String.class, short.class),
|
MC_NBT_TAG_COMPOUND__REMOVE("remove", "remove", "r", String.class, short.class),
|
||||||
|
|
||||||
CB_ITEM_STACK__AS_NMS_COPY("asNMSCopy", ItemStack.class),
|
CB_ITEM_STACK__AS_NMS_COPY("asNMSCopy", "asNMSCopy", ItemStack.class),
|
||||||
CB_ITEM_STACK__AS_CRAFT_MIRROR("asCraftMirror", ClassMapping.ITEM_STACK.getClazz()),
|
CB_ITEM_STACK__AS_CRAFT_MIRROR("asCraftMirror", "asCraftMirror", ClassMapping.ITEM_STACK.getClazz()),
|
||||||
|
|
||||||
MC_NBT_TAG_LIST__ADD("a", "add", "add", ClassMapping.NBT_BASE.getClazz()),
|
MC_NBT_TAG_LIST__ADD("add", "a", "add", "add", ClassMapping.NBT_BASE.getClazz()),
|
||||||
|
|
||||||
WORLD_BOARDER__SET_CENTER("setCenter", "setCenter", "c", double.class, double.class),
|
WORLD_BOARDER__SET_CENTER("setCenter", "setCenter", "setCenter", "c", double.class, double.class),
|
||||||
WORLD_BOARDER__SET_SIZE("setSize", "setSize", "a", double.class),
|
WORLD_BOARDER__SET_SIZE("setSize", "setSize", "setSize", "a", double.class),
|
||||||
|
|
||||||
WORLD_BOARDER__SET_WARNING_TIME("setWarningTime", "setWarningTime", "b", int.class),
|
WORLD_BOARDER__SET_WARNING_TIME("setWarningTime", "setWarningTime", "setWarningTime", "b", int.class),
|
||||||
WORLD_BOARDER__SET_WARNING_DISTANCE("setWarningDistance", "setWarningDistance", "c", int.class),
|
WORLD_BOARDER__SET_WARNING_DISTANCE("setWarningDistance", "setWarningDistance", "setWarningDistance", "c", int.class),
|
||||||
WORLD_BOARDER__TRANSITION_SIZE_BETWEEN("transitionSizeBetween", "transitionSizeBetween", "a", double.class, double.class, long.class);
|
WORLD_BOARDER__TRANSITION_SIZE_BETWEEN("transitionSizeBetween", "transitionSizeBetween", "transitionSizeBetween", "a", double.class, double.class, long.class);
|
||||||
|
|
||||||
|
private final String saneFallback;
|
||||||
private final String _1_14;
|
private final String _1_14;
|
||||||
private final String _1_17;
|
private final String _1_17;
|
||||||
private final String _1_18;
|
private final String _1_18;
|
||||||
private final Class<?>[] paramaters;
|
private final Class<?>[] paramaters;
|
||||||
|
|
||||||
MethodMapping(String _1_14, String _1_17, String _1_18, Class<?>... paramaters) {
|
MethodMapping(String saneFallback, String _1_14, String _1_17, String _1_18, Class<?>... paramaters) {
|
||||||
|
this.saneFallback = saneFallback;
|
||||||
|
|
||||||
this._1_14 = _1_14;
|
this._1_14 = _1_14;
|
||||||
this._1_17 = _1_17;
|
this._1_17 = _1_17;
|
||||||
this._1_18 = _1_18;
|
this._1_18 = _1_18;
|
||||||
this.paramaters = paramaters;
|
this.paramaters = paramaters;
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodMapping(String _1_17, String _1_18, Class<?>... paramaters) {
|
MethodMapping(String saneFallback, String _1_17, String _1_18, Class<?>... paramaters) {
|
||||||
|
this.saneFallback = saneFallback;
|
||||||
|
|
||||||
this._1_14 = null;
|
this._1_14 = null;
|
||||||
this._1_17 = _1_17;
|
this._1_17 = _1_17;
|
||||||
this._1_18 = _1_18;
|
this._1_18 = _1_18;
|
||||||
this.paramaters = paramaters;
|
this.paramaters = paramaters;
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodMapping(String _1_18, Class<?>... paramaters) {
|
MethodMapping(String saneFallback, String _1_18, Class<?>... paramaters) {
|
||||||
|
this.saneFallback = saneFallback;
|
||||||
|
|
||||||
this._1_14 = null;
|
this._1_14 = null;
|
||||||
this._1_17 = null;
|
this._1_17 = null;
|
||||||
this._1_18 = _1_18;
|
this._1_18 = _1_18;
|
||||||
@ -54,7 +61,6 @@ public enum MethodMapping {
|
|||||||
|
|
||||||
public Method getMethod(Class<?> clazz) {
|
public Method getMethod(Class<?> clazz) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String methodName = _1_18;
|
String methodName = _1_18;
|
||||||
switch (ServerVersion.getServerVersion()) {
|
switch (ServerVersion.getServerVersion()) {
|
||||||
case V1_14:
|
case V1_14:
|
||||||
@ -67,12 +73,28 @@ public enum MethodMapping {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
Method method = clazz.getDeclaredMethod(methodName, paramaters);
|
Method method = clazz.getDeclaredMethod(methodName, paramaters);
|
||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
|
|
||||||
return method;
|
return method;
|
||||||
} catch (Exception e) {
|
} catch (NoSuchMethodException ex) {
|
||||||
|
if (saneFallback != null) {
|
||||||
|
try {
|
||||||
|
Method method = clazz.getDeclaredMethod(saneFallback, paramaters);
|
||||||
|
method.setAccessible(true);
|
||||||
|
|
||||||
|
return method;
|
||||||
|
} catch (NoSuchMethodException innerEx) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
innerEx.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ public class SongodaCore {
|
|||||||
/**
|
/**
|
||||||
* @since coreRevision 6
|
* @since coreRevision 6
|
||||||
*/
|
*/
|
||||||
private final static String coreVersion = "2.6.4";
|
private final static String coreVersion = "2.6.5";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is specific to the website api
|
* This is specific to the website api
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>SongodaCore-Modules</artifactId>
|
<artifactId>SongodaCore-Modules</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.5</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<!-- Run 'mvn versions:set -DgenerateBackupPoms=false -DnewVersion=X.Y.Z' to update version recursively -->
|
<!-- Run 'mvn versions:set -DgenerateBackupPoms=false -DnewVersion=X.Y.Z' to update version recursively -->
|
||||||
|
Loading…
Reference in New Issue
Block a user