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:
2024-02-18 13:49:30 +01:00
parent 2393352770
commit 92a9afa22c
6 changed files with 8 additions and 22 deletions

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