Skip to content

Commit

Permalink
Add additional logging for better debugging
Browse files Browse the repository at this point in the history
Signed-off-by: TheSilkMiner <thesilkminer@outlook.com>
  • Loading branch information
TheSilkMiner committed Jun 18, 2022
1 parent b5ad22c commit f80319a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ public abstract class RegistryMixin {
@Unique
private static <T> void contenttweaker$freezeBuiltins$registerCotObjects0(final Registry<T> registry) {
final ObjectType<T> type = ContentTweakerCore.core().metaRegistry().objectTypes().get(registry.key());
if (type == null) return;
if (type == null) {
ContentTweakerCore.LOGGER.info("Unknown registry '{}': are you missing object types for it?", registry.key());
return;
}
ContentTweakerCore.LOGGER.info("Registering objects for type '{}'", type);
try {
ContentTweakerCore.core().registryButler().executeForRegistry(FabricGameRegistry.of(registry, type));
} catch (final Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ public abstract class GameDataMixin {
final BiFunction<ObjectType<T>, U, GameRegistry<T>> creator
) {
final ObjectType<T> type = ContentTweakerCore.core().metaRegistry().objectTypes().get(key);
if (type == null) return;
if (type == null) {
ContentTweakerCore.LOGGER.info("Unknown registry '{}': are you missing an object type for it?", key);
return;
}
ContentTweakerCore.LOGGER.info("Registering objects for type '{}'", type);
try {
ContentTweakerCore.core().registryButler().executeForRegistry(creator.apply(type, registry));
} catch (final Throwable e) {
Expand Down

0 comments on commit f80319a

Please sign in to comment.