This method is reflected into. Set plugin variables. @param identifier The plugin's identifier.
(PluginIdentifier identifier, URLClassLoader classLoader)
| 30 | * @param identifier The plugin's identifier. |
| 31 | */ |
| 32 | private void initializePlugin(PluginIdentifier identifier, URLClassLoader classLoader) { |
| 33 | if(this.identifier != null) { |
| 34 | Grasscutter.getLogger().warn(this.identifier.name + " had a reinitialization attempt."); |
| 35 | return; |
| 36 | } |
| 37 | |
| 38 | this.identifier = identifier; |
| 39 | this.classLoader = classLoader; |
| 40 | this.dataFolder = new File(PLUGIN(), identifier.name); |
| 41 | this.logger = LoggerFactory.getLogger(identifier.name); |
| 42 | |
| 43 | if(!this.dataFolder.exists() && !this.dataFolder.mkdirs()) { |
| 44 | Grasscutter.getLogger().warn("Failed to create plugin data folder for " + this.identifier.name); |
| 45 | return; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * The plugin's identifier instance. |