Fixed debug

This commit is contained in:
Verox 2023-09-19 17:55:19 +02:00
parent 8b651a29a5
commit ff90f30a59

View File

@ -10,7 +10,10 @@ import cn.nukkit.item.Item;
import cn.nukkit.item.customitem.CustomItem; import cn.nukkit.item.customitem.CustomItem;
import cn.nukkit.plugin.PluginBase; import cn.nukkit.plugin.PluginBase;
import org.reflections.Reflections; import org.reflections.Reflections;
import org.reflections.scanners.SubTypesScanner;
import org.reflections.scanners.TypeAnnotationsScanner; import org.reflections.scanners.TypeAnnotationsScanner;
import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder;
import java.io.File; import java.io.File;
import java.net.MalformedURLException; import java.net.MalformedURLException;
@ -37,7 +40,10 @@ public class Plugin extends PluginBase {
// Register Blocks // Register Blocks
Reflections blockReflections = new Reflections("com.cimeyclust.addonreader.resources.custom_blocks"); Reflections blockReflections = new Reflections("com.cimeyclust.addonreader.resources.custom_blocks");
int count = blockReflections.getStore().get(TypeAnnotationsScanner.class.getSimpleName()).keySet().size(); Reflections reflections = new Reflections(new ConfigurationBuilder()
.setUrls(ClasspathHelper.forPackage("com.cimeyclust.addonreader.resources.custom_blocks"))
.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner()));
int count = reflections.getStore().get(TypeAnnotationsScanner.class.getSimpleName()).keySet().size();
System.out.println("Number of classes found: " + count); System.out.println("Number of classes found: " + count);
// Log super classes of each class in the package // Log super classes of each class in the package