Merge pull request #54 from FrankHeijden/fix/the-old
Bring back the old
This commit is contained in:
commit
3fe86fd7f7
1 changed files with 11 additions and 5 deletions
|
|
@ -20,14 +20,20 @@ public class RCraftingManager {
|
||||||
static {
|
static {
|
||||||
if (MinecraftReflectionVersion.MINOR >= 17) {
|
if (MinecraftReflectionVersion.MINOR >= 17) {
|
||||||
reflection = MinecraftReflection.of("net.minecraft.world.item.crafting.CraftingManager");
|
reflection = MinecraftReflection.of("net.minecraft.world.item.crafting.CraftingManager");
|
||||||
} else {
|
} else if (MinecraftReflectionVersion.MINOR >= 12) {
|
||||||
reflection = MinecraftReflection.of("net.minecraft.server.%s.CraftingManager");
|
reflection = MinecraftReflection.of("net.minecraft.server.%s.CraftingManager");
|
||||||
|
} else {
|
||||||
|
reflection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MinecraftReflectionVersion.MINOR > 12) {
|
||||||
getCraftingManagerMethod = Arrays.stream(RMinecraftServer.getReflection().getClazz().getDeclaredMethods())
|
getCraftingManagerMethod = Arrays.stream(RMinecraftServer.getReflection().getClazz().getDeclaredMethods())
|
||||||
.filter(m -> m.getReturnType().equals(reflection.getClazz()))
|
.filter(m -> m.getReturnType().equals(reflection.getClazz()))
|
||||||
.findAny()
|
.findAny()
|
||||||
.get();
|
.get();
|
||||||
|
} else {
|
||||||
|
getCraftingManagerMethod = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private RCraftingManager() {}
|
private RCraftingManager() {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue