Skip to content

Commit

Permalink
🐛 修复合成表API导致的服务端崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
1024-byteeeee committed Oct 4, 2024
1 parent 8bd93f6 commit a0542b7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
public class RecipeRuleHelper {
@SuppressWarnings("ExtractMethodRecommender")
public static void onPlayerLoggedIn(MinecraftServer server, ServerPlayerEntity player) {
if (server != null && !server.isStopping() && !server.isStopped() && hasActiveRecipeRule()) {
if (server != null && hasActiveRecipeRule()) {
RecipeManager recipeManager = server.getRecipeManager();
//#if MC>=12002
//$$ Collection<RecipeEntry<?>> allRecipes = recipeManager.values();
Expand Down Expand Up @@ -72,7 +72,7 @@ public static void onPlayerLoggedIn(MinecraftServer server, ServerPlayerEntity p

@SuppressWarnings("ExtractMethodRecommender")
public static void onValueChange(MinecraftServer server) {
if (server != null && !server.isStopping() && !server.isStopped()) {
if (server != null) {
AmsRecipeManager.clearRecipeListMemory(AmsRecipeBuilder.getInstance());
AmsServerCustomRecipes.getInstance().buildRecipes();
server.execute(() -> {
Expand All @@ -99,7 +99,7 @@ public static void onValueChange(MinecraftServer server) {
}

public static void onServerLoadedWorlds(MinecraftServer server) {
if (server != null && !server.isStopping() && !server.isStopped() && hasActiveRecipeRule()) {
if (server != null && hasActiveRecipeRule()) {
server.execute(() -> {
CommandManager commandManager = server.getCommandManager();
commandManager.execute(server.getCommandSource(), "/reload");
Expand Down

0 comments on commit a0542b7

Please sign in to comment.