@@ -45,7 +45,7 @@ public PluginData(String modId, String resourcePath, IOreSpawnPlugin plugin) {
4545 }
4646 }
4747
48- private List <PluginData > dataStore = new ArrayList <>();
48+ private static List <PluginData > dataStore = new ArrayList <>();
4949
5050 private String getAnnotationItem (String item , final ASMData asmData ) {
5151 if (asmData .getAnnotationInfo ().get (item ) != null ) {
@@ -60,16 +60,14 @@ public void load(FMLPreInitializationEvent event) {
6060 final String modId = getAnnotationItem ("modid" , asmDataItem );
6161 final String resourceBase = getAnnotationItem ("resourcePath" , asmDataItem );
6262 final String clazz = asmDataItem .getClassName ();
63-
64- if ( event .getModMetadata ().modId .equals (modId ) ) {
65- IOreSpawnPlugin integration ;
66- try {
67- integration = Class .forName (clazz ).asSubclass (IOreSpawnPlugin .class ).newInstance ();
68- PluginData pd = new PluginData ( modId , resourceBase , integration );
69- dataStore .add (pd );
70- } catch (final Exception ex ) {
71- OreSpawn .LOGGER .error ("Couldn't load integrations for " + modId , ex );
72- }
63+ IOreSpawnPlugin integration ;
64+ try {
65+ integration = Class .forName (clazz ).asSubclass (IOreSpawnPlugin .class ).newInstance ();
66+ PluginData pd = new PluginData ( modId , resourceBase , integration );
67+ dataStore .add (pd );
68+ OreSpawn .LOGGER .fatal ("Loaded plugin {} (modId: {}, resourcePath: {})" , clazz , modId , resourceBase );
69+ } catch (final Exception ex ) {
70+ OreSpawn .LOGGER .error ("Couldn't load integrations for " + modId , ex );
7371 }
7472 }
7573 }
@@ -81,11 +79,8 @@ public void register() {
8179 public void scanResources (PluginData pd ) {
8280 String base = String .format ("assets/%s/%s" , pd .modId , pd .resourcePath );
8381 URL resURL = getClass ().getClassLoader ().getResource (base );
84- if ( resURL == null ) {
85- // nothing to load!
86- return ;
87- }
88-
82+ OreSpawn .LOGGER .fatal ("Got {} from getResource({})" , resURL .toString (), base );
83+
8984 URI uri ;
9085 try {
9186 uri = resURL .toURI ();
@@ -106,14 +101,11 @@ public void scanResources(PluginData pd) {
106101 myPath = Paths .get (uri );
107102 }
108103
109- if ( !myPath .toFile ().exists () ) {
110- return ;
111- }
112-
113104 Stream <Path > walk = Files .walk (myPath , 1 );
114105 for (Iterator <Path > it = walk .iterator (); it .hasNext ();){
115106 Path p = it .next ();
116107 String name = p .getFileName ().toString ();
108+ OreSpawn .LOGGER .fatal ("path {} in walk" , p .toString ());
117109 if ( "json" .equals (FilenameUtils .getExtension (name )) ) {
118110 InputStream reader = null ;
119111 Path target = Paths .get ("." ,"orespawn" ,"os3" ,String .format ("%s.json" , pd .modId ));
@@ -123,6 +115,7 @@ public void scanResources(PluginData pd) {
123115 walk .close ();
124116 return ;
125117 }
118+ OreSpawn .LOGGER .fatal ("Extracting {} to {}" , p .toString (), target .toString ());
126119 reader = Files .newInputStream (p );
127120 FileUtils .copyInputStreamToFile (reader , target .toFile ());
128121 IOUtils .closeQuietly (reader );
0 commit comments