Prepare 1.20.2 full support

- Update some POM files
- OBC reflection should not try to parse relocation package version
- NMS reflection dependency update
This commit is contained in:
Marc Baloup 2024-02-18 13:49:30 +01:00
parent 2393352770
commit 92a9afa22c
6 changed files with 8 additions and 22 deletions

View File

@ -56,7 +56,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10</version>
<version>2.10.1</version>
</dependency>
</dependencies>

View File

@ -94,7 +94,7 @@
<dependency>
<groupId>net.fabricmc</groupId>
<artifactId>mapping-io</artifactId>
<version>0.3.0</version>
<version>0.5.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -169,7 +169,7 @@ public class NMSReflect {
}
MemoryMappingTree tree = new MemoryMappingTree();
MappingReader.read(new InputStreamReader(mappingsInputStream, StandardCharsets.UTF_8), MappingFormat.TINY_2, tree);
MappingReader.read(new InputStreamReader(mappingsInputStream, StandardCharsets.UTF_8), MappingFormat.TINY_2_FILE, tree);
List<ClassMapping> classes = new ArrayList<>();
for (MappingTree.ClassMapping cls : tree.getClasses()) {

View File

@ -10,18 +10,7 @@ import fr.pandacube.lib.reflect.ReflectClass;
*/
public class OBCReflect {
private static final String OBC_PACKAGE_PREFIX = "org.bukkit.craftbukkit.";
private static final String OBC_PACKAGE_VERSION;
static {
String name = Bukkit.getServer().getClass().getName()
.substring(OBC_PACKAGE_PREFIX.length());
name = name.substring(0, name.indexOf("."));
OBC_PACKAGE_VERSION = name;
}
private static final String CRAFTBUKKIT_PACKAGE = Bukkit.getServer().getClass().getPackage().getName();
/**
* Returns the OBC class that has the provided name, wrapped into a {@link ReflectClass}.
@ -31,10 +20,7 @@ public class OBCReflect {
* @throws ClassNotFoundException if the provided class was not found in {@code OBC} package.
*/
public static ReflectClass<?> ofClass(String obcClass) throws ClassNotFoundException {
return Reflect.ofClass(OBC_PACKAGE_PREFIX + OBC_PACKAGE_VERSION + "." + obcClass);
return Reflect.ofClass(CRAFTBUKKIT_PACKAGE + "." + obcClass);
}
}

View File

@ -27,7 +27,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version> <!-- Match the version imported by Paper API/BungeeCord API if possible -->
<version>32.1.2-jre</version> <!-- Match the version imported by Paper API/BungeeCord API if possible -->
</dependency>
</dependencies>

View File

@ -56,8 +56,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<bungeecord.version>1.20-R0.3-SNAPSHOT</bungeecord.version>
<paper.version>1.20.1-R0.1</paper.version>
<mc.version>1.20.1</mc.version>
<paper.version>1.20.2-R0.1</paper.version>
<mc.version>1.20.2</mc.version>
</properties>
<modules>