mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 04:22:32 +00:00
Fix #1375 Split up the loot tables for every plugin
This commit is contained in:
1 parent
60debc45f3
commit
716167e3ec
38 files changed
+823
-774
No files matched your search
@@ -51,4 +51,9 @@ public @interface ForestryPlugin {
|
||||
*/
|
||||
String help() default "";
|
||||
|
||||
/**
|
||||
* @return The name of the loot table file, if any.
|
||||
*/
|
||||
String lootTable() default "";
|
||||
|
||||
}
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.world.gen.IChunkGenerator;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
@@ -326,6 +327,18 @@ public class PluginManager {
|
||||
return lootPoolNames;
|
||||
}
|
||||
|
||||
public static Set<String> getLootTableFiles() {
|
||||
Set<String> lootTableNames = new HashSet<>();
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
ForestryPlugin info = plugin.getClass().getAnnotation(ForestryPlugin.class);
|
||||
String lootTableFolder = info.lootTable();
|
||||
if (!lootTableFolder.isEmpty()) {
|
||||
lootTableNames.add(lootTableFolder);
|
||||
}
|
||||
}
|
||||
return lootTableNames;
|
||||
}
|
||||
|
||||
private static boolean isEnabled(Configuration config, IForestryPlugin plugin) {
|
||||
ForestryPlugin info = plugin.getClass().getAnnotation(ForestryPlugin.class);
|
||||
|
||||
|
||||
Reference in new issue
Block a user