aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-11-01 13:38:55 +0800
committershedaniel <daniel@shedaniel.me>2023-05-29 21:18:42 +0800
commitf266a137d50b9b24bf89dfe74dd37318dece2e39 (patch)
treed1ed5a11d607bd746d39efd9b8e0f88d2421bd5a /runtime/src/main/java
parent1015291341a0fc77de2e9cd5d71de9cb2a310425 (diff)
downloadRoughlyEnoughItems-f266a137d50b9b24bf89dfe74dd37318dece2e39.tar.gz
RoughlyEnoughItems-f266a137d50b9b24bf89dfe74dd37318dece2e39.tar.bz2
RoughlyEnoughItems-f266a137d50b9b24bf89dfe74dd37318dece2e39.zip
Fix some debug logger messages
Diffstat (limited to 'runtime/src/main/java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/search/method/InputMethodRegistryImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/transfer/MenuInfoRegistryImpl.java25
2 files changed, 25 insertions, 2 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/search/method/InputMethodRegistryImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/search/method/InputMethodRegistryImpl.java
index 8cac7824a..ca2e79e77 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/search/method/InputMethodRegistryImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/search/method/InputMethodRegistryImpl.java
@@ -98,7 +98,7 @@ public class InputMethodRegistryImpl implements InputMethodRegistry {
}).join();
service.shutdown();
- InternalLogger.getInstance().debug("Registered %d input methods: ", inputMethods.size(),
+ InternalLogger.getInstance().debug("Registered %d input methods: %s", inputMethods.size(),
inputMethods.values().stream().map(inputMethod -> inputMethod.getName().getString()).collect(Collectors.joining(", ")));
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/transfer/MenuInfoRegistryImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/transfer/MenuInfoRegistryImpl.java
index 9278d4e79..7ce40503f 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/common/transfer/MenuInfoRegistryImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/common/transfer/MenuInfoRegistryImpl.java
@@ -32,6 +32,7 @@ import me.shedaniel.rei.api.common.transfer.info.MenuInfo;
import me.shedaniel.rei.api.common.transfer.info.MenuInfoProvider;
import me.shedaniel.rei.api.common.transfer.info.MenuInfoRegistry;
import me.shedaniel.rei.api.common.transfer.info.MenuSerializationProviderContext;
+import me.shedaniel.rei.impl.common.InternalLogger;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.nbt.CompoundTag;
@@ -53,11 +54,28 @@ public class MenuInfoRegistryImpl implements MenuInfoRegistry {
map.computeIfAbsent(category, id -> Maps.newLinkedHashMap())
.computeIfAbsent(menuClass, c -> Lists.newArrayList())
.add(menuInfo);
+ InternalLogger.getInstance().debug("Added menu info for %s [%s]: %s", menuClass, category, menuInfo);
}
@Override
public <D extends Display> void registerGeneric(Predicate<CategoryIdentifier<?>> categoryPredicate, MenuInfoProvider<?, D> menuInfo) {
- mapGeneric.computeIfAbsent(categoryPredicate, id -> Lists.newArrayList()).add(menuInfo);
+ mapGeneric.computeIfAbsent(new Predicate<>() {
+ @Override
+ public boolean test(CategoryIdentifier<?> categoryIdentifier) {
+ return categoryPredicate.test(categoryIdentifier);
+ }
+
+ @Override
+ public int hashCode() {
+ return System.identityHashCode(this);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return this == obj;
+ }
+ }, id -> Lists.newArrayList()).add(menuInfo);
+ InternalLogger.getInstance().debug("Added generic menu info for: %s", menuInfo);
}
@Override
@@ -128,6 +146,11 @@ public class MenuInfoRegistryImpl implements MenuInfoRegistry {
}
@Override
+ public void endReload() {
+ InternalLogger.getInstance().debug("Registered %d menu infos", infoSize());
+ }
+
+ @Override
public void acceptPlugin(REIServerPlugin plugin) {
plugin.registerMenuInfo(this);
}