Skip to content

Commit

Permalink
Revive CommonUtil#loadClasses
Browse files Browse the repository at this point in the history
  • Loading branch information
StavWasPlayZ committed Sep 10, 2024
1 parent 59400a9 commit a09a121
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/com/cstav/genshinstrument/util/CommonUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.cstav.genshinstrument.util;

import com.cstav.genshinstrument.GInstrumentMod;
import com.google.common.collect.Lists;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
Expand Down Expand Up @@ -85,6 +86,19 @@ public static int doublyPyWrap(int index, final int arrLength) {
}


public static void loadClasses(final Class<?>[] classes) {
for (final Class<?> loadMe : classes) {

try {
Class.forName(loadMe.getName());
} catch (ClassNotFoundException e) {
GInstrumentMod.LOGGER.error("Failed to load class "+ loadMe.getSimpleName() +": class not found", e);
}

}
}


@SuppressWarnings("unchecked")
public static <T> T getStaticFinalField(final Class<?> clazz, final String name, Class<T> type) {
try {
Expand Down

0 comments on commit a09a121

Please sign in to comment.