9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-04 15:41:38 +00:00

Merge pull request #14 from Xiao-MoMi/main

Refresh recipes(上游更新)
This commit is contained in:
jhqwqmc
2025-02-13 03:31:26 +08:00
committed by GitHub
2 changed files with 25 additions and 1 deletions

View File

@@ -257,7 +257,7 @@ public class BukkitRecipeManager implements RecipeManager<ItemStack> {
}
// send to players
Reflections.method$DedicatedPlayerList$reloadRecipes.invoke(Reflections.field$CraftServer$playerList.get(Bukkit.getServer()));
// now we need to remove the fake `exact`
if (VersionHelper.isVersionNewerThan1_21_4()) {

View File

@@ -4050,4 +4050,28 @@ public class Reflections {
}
method$RecipeManager$byKey = requireNonNull(method$RecipeManager$byKey0);
}
public static final Class<?> clazz$CraftServer = requireNonNull(
ReflectionUtils.getClazz(
BukkitReflectionUtils.assembleCBClass("CraftServer")
)
);
public static final Class<?> clazz$DedicatedPlayerList = requireNonNull(
ReflectionUtils.getClazz(
BukkitReflectionUtils.assembleMCClass("server.dedicated.DedicatedPlayerList")
)
);
public static final Field field$CraftServer$playerList = requireNonNull(
ReflectionUtils.getDeclaredField(
clazz$CraftServer, clazz$DedicatedPlayerList, 0
)
);
public static final Method method$DedicatedPlayerList$reloadRecipes = requireNonNull(
ReflectionUtils.getMethod(
clazz$DedicatedPlayerList, new String[] {"reloadRecipeData", "reloadRecipes"}
)
);
}