mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 01:04:12 +00:00
#245 Add localized plugin description comments to modules.cfg too
This commit is contained in:
1 parent
ccd91f91d5
commit
c43d057339
1 file changed
+5
-1
@@ -36,6 +36,7 @@ import java.util.Set;
|
||||
import net.minecraft.command.CommandHandler;
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
@@ -121,7 +122,7 @@ public class PluginManager {
|
||||
|
||||
config.load();
|
||||
config.addCustomCategoryComment(CATEGORY_MODULES, "Disabling these modules can greatly change how the mod functions.\n"
|
||||
+ "Your milage may vary, please report any issues.");
|
||||
+ "Your mileage may vary, please report any issues.");
|
||||
|
||||
Set<Module> toLoad = EnumSet.allOf(Module.class);
|
||||
Iterator<Module> it = toLoad.iterator();
|
||||
@@ -274,8 +275,11 @@ public class PluginManager {
|
||||
}
|
||||
|
||||
private static boolean isEnabled(Configuration config, Module m) {
|
||||
Plugin info = m.instance().getClass().getAnnotation(Plugin.class);
|
||||
|
||||
boolean defaultValue = true;
|
||||
Property prop = config.get(CATEGORY_MODULES, m.toString().toLowerCase(Locale.ENGLISH).replace('_', '.'), defaultValue);
|
||||
prop.comment = StatCollector.translateToLocal(info.unlocalizedDescription());
|
||||
return prop.getBoolean(true);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user