forked from BRNSystems/RegexingHoppers
Stop spamming console
This commit is contained in:
parent
45e8d2e26d
commit
4edeadf4f9
@ -22,7 +22,7 @@ public class RegexingHoppers implements ModInitializer {
|
|||||||
// This code runs as soon as Minecraft is in a mod-load-ready state.
|
// This code runs as soon as Minecraft is in a mod-load-ready state.
|
||||||
// However, some things (like resources) may still be uninitialized.
|
// However, some things (like resources) may still be uninitialized.
|
||||||
// Proceed with mild caution.
|
// Proceed with mild caution.
|
||||||
LOGGER.info("RegexingHoppers initialized!");
|
LOGGER.debug("RegexingHoppers initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean shouldNotMove(Inventory hopper, String itemName) {
|
public static boolean shouldNotMove(Inventory hopper, String itemName) {
|
||||||
@ -33,7 +33,7 @@ public class RegexingHoppers implements ModInitializer {
|
|||||||
String customName = factory.getDisplayName().getLiteralString();
|
String customName = factory.getDisplayName().getLiteralString();
|
||||||
|
|
||||||
// Log the custom name used for matching
|
// Log the custom name used for matching
|
||||||
LOGGER.info("Custom regex pattern from hopper: {}", customName);
|
LOGGER.debug("Custom regex pattern from hopper: {}", customName);
|
||||||
|
|
||||||
if (customName != null && !customName.isEmpty()) {
|
if (customName != null && !customName.isEmpty()) {
|
||||||
if (hopper instanceof HopperBlockEntity) {
|
if (hopper instanceof HopperBlockEntity) {
|
||||||
@ -48,7 +48,7 @@ public class RegexingHoppers implements ModInitializer {
|
|||||||
|
|
||||||
// Log the result of the regex matching
|
// Log the result of the regex matching
|
||||||
boolean matches = matcher.matches();
|
boolean matches = matcher.matches();
|
||||||
LOGGER.info("Regex matching result: {}", matches);
|
LOGGER.debug("Regex matching result: {}", matches);
|
||||||
|
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
if (hopper instanceof HopperBlockEntity) {
|
if (hopper instanceof HopperBlockEntity) {
|
||||||
@ -59,15 +59,15 @@ public class RegexingHoppers implements ModInitializer {
|
|||||||
return !matches;
|
return !matches;
|
||||||
} catch (PatternSyntaxException e) {
|
} catch (PatternSyntaxException e) {
|
||||||
// Log exception if regex pattern is invalid
|
// Log exception if regex pattern is invalid
|
||||||
LOGGER.info("Invalid regex pattern: {}", customName, e);
|
LOGGER.debug("Invalid regex pattern: {}", customName, e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Log case when custom name is null or empty
|
// Log case when custom name is null or empty
|
||||||
LOGGER.info("Custom name is null or empty, not performing regex matching.");
|
LOGGER.debug("Custom name is null or empty, not performing regex matching.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Log if hopper is not an instance of NamedScreenHandlerFactory
|
// Log if hopper is not an instance of NamedScreenHandlerFactory
|
||||||
LOGGER.info("Hopper is not an instance of NamedScreenHandlerFactory.");
|
LOGGER.debug("Hopper is not an instance of NamedScreenHandlerFactory.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default return value in case no conditions are met
|
// Default return value in case no conditions are met
|
||||||
|
Loading…
Reference in New Issue
Block a user