diff --git a/libs/Botania r1.3-149-deobf.jar b/libs/Botania r1.3-154 custom build-deobf.jar similarity index 86% rename from libs/Botania r1.3-149-deobf.jar rename to libs/Botania r1.3-154 custom build-deobf.jar index 42ad927..7f8a04a 100644 Binary files a/libs/Botania r1.3-149-deobf.jar and b/libs/Botania r1.3-154 custom build-deobf.jar differ diff --git a/src/main/java/modtweaker/ModTweaker.java b/src/main/java/modtweaker/ModTweaker.java index 789cc5e..a0ef095 100644 --- a/src/main/java/modtweaker/ModTweaker.java +++ b/src/main/java/modtweaker/ModTweaker.java @@ -7,9 +7,12 @@ import minetweaker.api.minecraft.MineTweakerMC; import minetweaker.api.player.IPlayer; import minetweaker.api.server.ICommandFunction; import minetweaker.mc1710.MineTweakerMod; +import modtweaker.commands.MobMappingLogger; import modtweaker.mods.botania.Botania; +import modtweaker.mods.botania.commands.BotaniaBrewLogger; import modtweaker.mods.botania.lexicon.commands.LexiconCategoryLogger; import modtweaker.mods.botania.lexicon.commands.LexiconEntryLogger; +import modtweaker.mods.botania.lexicon.commands.LexiconKnowledgeTypesLogger; import modtweaker.mods.botania.lexicon.commands.LexiconPageLogger; import modtweaker.mods.exnihilo.ExNihilo; import modtweaker.mods.extendedworkbench.ExtendedWorkbench; @@ -86,6 +89,8 @@ public class ModTweaker { } }); + MineTweakerAPI.server.addMineTweakerCommand("mobs", new String[] { "/minetweaker mobs", " Outputs a list of mob class mapping keys" }, new MobMappingLogger()); + if (TweakerPlugin.isLoaded("Mekanism")) { MineTweakerAPI.server.addMineTweakerCommand("gases", new String[] { "/minetweaker gases", " Outputs a list of all gas names in the game to the minetweaker log" }, new GasLogger()); } @@ -102,6 +107,8 @@ public class ModTweaker { MineTweakerAPI.server.addMineTweakerCommand("lexiconCategories", new String[] { "/minetweaker lexiconCategories", " Outputs a list of lexicon categories" }, new LexiconCategoryLogger()); MineTweakerAPI.server.addMineTweakerCommand("lexiconEntries", new String[] { "/minetweaker lexiconEntries", "/minetweaker lexiconEntries [CATEGORY]", " Outputs a list of lexicon entries" }, new LexiconEntryLogger()); MineTweakerAPI.server.addMineTweakerCommand("lexiconPages", new String[] { "/minetweaker lexiconPages", "/minetweaker lexiconPages [ENTRY]", " Outputs a list of lexicon pages for the entry" }, new LexiconPageLogger()); + MineTweakerAPI.server.addMineTweakerCommand("botaniaBrews", new String[] { "/minetweaker botaniaBrews", " Outputs a list of keys for botania brews" }, new BotaniaBrewLogger()); + MineTweakerAPI.server.addMineTweakerCommand("lexiconKnowledgeTypes", new String[] { "/minetweaker lexiconKnowledgeTypes", " Outputs a list of keys for lexicon knowledge types" }, new LexiconKnowledgeTypesLogger()); } } diff --git a/src/main/java/modtweaker/commands/MobMappingLogger.java b/src/main/java/modtweaker/commands/MobMappingLogger.java new file mode 100644 index 0000000..c56ac4e --- /dev/null +++ b/src/main/java/modtweaker/commands/MobMappingLogger.java @@ -0,0 +1,30 @@ +package modtweaker.commands; + +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import net.minecraft.entity.EntityList; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.lexicon.LexiconCategory; +import minetweaker.MineTweakerAPI; +import minetweaker.MineTweakerImplementationAPI; +import minetweaker.api.player.IPlayer; +import minetweaker.api.server.ICommandFunction; + +public class MobMappingLogger implements ICommandFunction{ + + @Override + public void execute(String[] arguments, IPlayer player) { + Set keys=EntityList.stringToClassMapping.keySet(); + System.out.println("Mob Keys: " + keys.size()); + for (String key : keys) { + System.out.println("Mob Key " + key); + MineTweakerAPI.logCommand(key); + } + + if (player != null) { + player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir")); + } + } +} diff --git a/src/main/java/modtweaker/mods/botania/commands/BotaniaBrewLogger.java b/src/main/java/modtweaker/mods/botania/commands/BotaniaBrewLogger.java new file mode 100644 index 0000000..7f9f0ec --- /dev/null +++ b/src/main/java/modtweaker/mods/botania/commands/BotaniaBrewLogger.java @@ -0,0 +1,29 @@ +package modtweaker.mods.botania.commands; + +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.lexicon.LexiconCategory; +import minetweaker.MineTweakerAPI; +import minetweaker.MineTweakerImplementationAPI; +import minetweaker.api.player.IPlayer; +import minetweaker.api.server.ICommandFunction; + +public class BotaniaBrewLogger implements ICommandFunction{ + + @Override + public void execute(String[] arguments, IPlayer player) { + Set brew_keys=BotaniaAPI.brewMap.keySet(); + System.out.println("Brews: " + brew_keys.size()); + for (String key : brew_keys) { + System.out.println("Brew " + key); + MineTweakerAPI.logCommand(key); + } + + if (player != null) { + player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir")); + } + } +} diff --git a/src/main/java/modtweaker/mods/botania/handlers/Lexicon.java b/src/main/java/modtweaker/mods/botania/handlers/Lexicon.java index d033f0d..025f5fd 100644 --- a/src/main/java/modtweaker/mods/botania/handlers/Lexicon.java +++ b/src/main/java/modtweaker/mods/botania/handlers/Lexicon.java @@ -16,14 +16,17 @@ import modtweaker.mods.botania.BotaniaHelper; import modtweaker.mods.botania.lexicon.AddCategory; import modtweaker.mods.botania.lexicon.AddEntry; import modtweaker.mods.botania.lexicon.AddPage; +import modtweaker.mods.botania.lexicon.AddRecipeMapping; import modtweaker.mods.botania.lexicon.RemoveCategory; import modtweaker.mods.botania.lexicon.RemoveEntry; import modtweaker.mods.botania.lexicon.RemovePage; +import modtweaker.mods.botania.lexicon.RemoveRecipeMapping; import modtweaker.mods.botania.lexicon.SetCategoryIcon; import modtweaker.mods.botania.lexicon.SetCategoryPriority; import modtweaker.mods.botania.lexicon.SetEntryKnowledgeType; import modtweaker.util.BaseListAddition; import modtweaker.util.BaseListRemoval; +import net.minecraft.entity.EntityList; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; @@ -34,6 +37,7 @@ import vazkii.botania.api.lexicon.KnowledgeType; import vazkii.botania.api.lexicon.LexiconCategory; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.lexicon.LexiconPage; +import vazkii.botania.api.lexicon.LexiconRecipeMappings; import vazkii.botania.api.recipe.RecipeBrew; import vazkii.botania.api.recipe.RecipeElvenTrade; import vazkii.botania.api.recipe.RecipeManaInfusion; @@ -113,6 +117,11 @@ public class Lexicon { MineTweakerAPI.getLogger().logError("Cannot find lexicon entry "+entry); return; } + if(EntityList.stringToClassMapping.containsKey(entity)) + { + MineTweakerAPI.getLogger().logError("No such entity "+entity); + return; + } LexiconPage page=new PageEntity(entity, entity, size); MineTweakerAPI.apply(new AddPage(name,lexiconEntry,page,page_number)); } @@ -347,4 +356,34 @@ public class Lexicon { MineTweakerAPI.apply(new SetCategoryIcon(lexiconCategory,icon)); } + @ZenMethod + public static void addRecipeMapping(IItemStack stack, String Entry, int page) { + LexiconEntry lexiconEntry=BotaniaHelper.findEntry(Entry); + if(LexiconRecipeMappings.getDataForStack(toStack(stack))!=null) + { + MineTweakerAPI.getLogger().logError("There is already a recipe mapping for "+stack); + return; + } + if(lexiconEntry==null) + { + MineTweakerAPI.getLogger().logError("Cannot find lexicon entry "+Entry); + return; + } + if(lexiconEntry.pages.size() types=BotaniaAPI.knowledgeTypes.keySet(); + System.out.println("Knowledge Types: " + types.size()); + for (String key : types) { + System.out.println("Knowledge Type " + key); + MineTweakerAPI.logCommand(key); + } + + if (player != null) { + player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir")); + } + } +}