Skip to content

Commit a0542b7

Browse files
committed
🐛 修复合成表API导致的服务端崩溃
1 parent 8bd93f6 commit a0542b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/club/mcams/carpet/helpers/rule/recipeRule/RecipeRuleHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
public class RecipeRuleHelper {
4444
@SuppressWarnings("ExtractMethodRecommender")
4545
public static void onPlayerLoggedIn(MinecraftServer server, ServerPlayerEntity player) {
46-
if (server != null && !server.isStopping() && !server.isStopped() && hasActiveRecipeRule()) {
46+
if (server != null && hasActiveRecipeRule()) {
4747
RecipeManager recipeManager = server.getRecipeManager();
4848
//#if MC>=12002
4949
//$$ Collection<RecipeEntry<?>> allRecipes = recipeManager.values();
@@ -72,7 +72,7 @@ public static void onPlayerLoggedIn(MinecraftServer server, ServerPlayerEntity p
7272

7373
@SuppressWarnings("ExtractMethodRecommender")
7474
public static void onValueChange(MinecraftServer server) {
75-
if (server != null && !server.isStopping() && !server.isStopped()) {
75+
if (server != null) {
7676
AmsRecipeManager.clearRecipeListMemory(AmsRecipeBuilder.getInstance());
7777
AmsServerCustomRecipes.getInstance().buildRecipes();
7878
server.execute(() -> {
@@ -99,7 +99,7 @@ public static void onValueChange(MinecraftServer server) {
9999
}
100100

101101
public static void onServerLoadedWorlds(MinecraftServer server) {
102-
if (server != null && !server.isStopping() && !server.isStopped() && hasActiveRecipeRule()) {
102+
if (server != null && hasActiveRecipeRule()) {
103103
server.execute(() -> {
104104
CommandManager commandManager = server.getCommandManager();
105105
commandManager.execute(server.getCommandSource(), "/reload");

0 commit comments

Comments
 (0)