Add option to supress unrecognized recipe errors

This commit is contained in:
Ben Kerllenevich
2021-08-28 08:48:12 -04:00
parent b298361124
commit 348846b9e1

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ben Kerllenevich <ben@omega24.dev>
Date: Sat, 28 Aug 2021 08:47:04 -0400
Subject: [PATCH] Add option to supress unrecognized recipe errors
diff --git a/src/main/java/net/minecraft/stats/ServerRecipeBook.java b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
index 63a4fa2408edf84b490ca39e824977135d78eff0..ca9fbc35b6c43b771116ed8607397f22456975dd 100644
--- a/src/main/java/net/minecraft/stats/ServerRecipeBook.java
+++ b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
@@ -121,7 +121,7 @@ public class ServerRecipeBook extends RecipeBook {
ResourceLocation minecraftkey = new ResourceLocation(s);
Optional<? extends Recipe<?>> optional = recipeManager.byKey(minecraftkey);
- if (!optional.isPresent()) {
+ if (!optional.isPresent() && !net.pl3x.purpur.PurpurConfig.loggerSuppressUnrecognizedRecipeErrors) { // Purpur
ServerRecipeBook.LOGGER.error("Tried to load unrecognized recipe: {} removed now.", minecraftkey);
} else {
handler.accept((Recipe) optional.get());
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 07bdddf241df745f483a7318f5c08ac791958d05..54215cfbef7b5517151f02976be4a92b1c97b188 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -486,9 +486,11 @@ public class PurpurConfig {
public static boolean loggerSuppressInitLegacyMaterialError = false;
public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
+ public static boolean loggerSuppressUnrecognizedRecipeErrors = false;
private static void loggerSettings() {
loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
+ loggerSuppressUnrecognizedRecipeErrors = getBoolean("settings.logger.suppress-unrecognized-recipe-errors", loggerSuppressUnrecognizedRecipeErrors);
}
public static boolean tpsCatchup = true;