Merge remote-tracking branch 'origin/1.12' into 1.12

This commit is contained in:
Jared 2018-02-11 01:32:16 +02:00
commit 4caab1437a
4 changed files with 103 additions and 1 deletions

View file

@ -60,6 +60,7 @@ dependencies {
deobfCompile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.0.+"
deobfCompile "mezz.jei:jei_1.12.2:4.8.5.+"
deobfCompile "com.blamejared:MTLib:3.0.+"
deobfCompile "vazkii.botania:Botania:r1.10-353"
deobfCompile("cofh:ThermalExpansion:1.12.2-5.+:deobf") {
exclude group: 'mezz.jei'

View file

@ -0,0 +1,40 @@
package com.blamejared.compat.botania.expansions;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.annotations.ModOnly;
import crafttweaker.annotations.ZenRegister;
import crafttweaker.api.item.IItemStack;
import crafttweaker.api.minecraft.CraftTweakerMC;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenExpansion;
import stanhebben.zenscript.annotations.ZenMethod;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.ILexicon;
import vazkii.botania.api.lexicon.KnowledgeType;
import vazkii.botania.common.item.ItemLexicon;
@ZenExpansion("crafttweaker.item.IItemstack")
@ModOnly("botania")
@ZenRegister
public class KnowledgeAddition {
@ZenMethod
public void addBotaniaKnowledge(IItemStack stack, String knowledge){
ILexicon lexicon = (ILexicon) stack;
ItemStack mcItemStack = CraftTweakerMC.getItemStack(stack);
if (stack == null || stack.isEmpty()){
if (stack instanceof ItemLexicon){
if (BotaniaAPI.knowledgeTypes.containsKey(knowledge)){
KnowledgeType knowledgeType = BotaniaAPI.knowledgeTypes.get(knowledge);
if (!lexicon.isKnowledgeUnlocked(mcItemStack, knowledgeType)){
((ItemLexicon) stack).unlockKnowledge(mcItemStack, knowledgeType);
}
} else {
CraftTweakerAPI.logError("Provided String is not a valid Knowledge Type");
}
} else {
CraftTweakerAPI.logError("Only Works With The Botania Lexicon");
}
}
}
}

View file

@ -0,0 +1,57 @@
package com.blamejared.compat.botania.handlers;
import com.blamejared.ModTweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.IAction;
import crafttweaker.annotations.ModOnly;
import crafttweaker.annotations.ZenRegister;
import net.minecraft.util.text.TextFormatting;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import vazkii.botania.api.BotaniaAPI;
@ZenClass("mods.botania.Knowledge")
@ModOnly("botania")
@ZenRegister
public class Knowledge {
private static final String typeName = "Botania Knowledge Variable:";
@ZenMethod
public static void registerKnowledgeType(String unlocalized, String color, boolean autoUnlock){
if (unlocalized == null || unlocalized.isEmpty()) {
CraftTweakerAPI.logError("Found null String in " + typeName + " name");
} else if (color == null || color.isEmpty()){
CraftTweakerAPI.logError("Found null String in " + typeName + " color");
} else {
ModTweaker.LATE_ADDITIONS.add(new Add(unlocalized, color, autoUnlock));
}
}
private static class Add implements IAction {
String unlocalized;
String color;
boolean autoUnlock;
public Add(String name, String color, boolean autoUnlock) {
this.unlocalized = name;
this.color = color;
this.autoUnlock = autoUnlock;
}
@Override
public void apply() {
BotaniaAPI.registerKnowledgeType(unlocalized, TextFormatting.getValueByName(color.toUpperCase()), autoUnlock);
}
@Override
public String describe() {
String Output;
if (autoUnlock){
Output = "Enabled";
} else {
Output = "Disabled";
}
return "Adding Knowledge Type: " + unlocalized + " With Auto-Unlock: " + Output;
}
}
}

View file

@ -28,7 +28,7 @@ mods.botania.RuneAltar.removeRecipe(<botania:rune>);
mods.botania.Lexicon.addCategory("mtdev");
mods.botania.Lexicon.addEntry("deventry", "mtdev", <minecraft:nether_star>);
mods.botania.Lexicon.setEntryKnowledgeType("deventry", "alfheim");
mods.botania.Lexicon.setEntryKnowledgeType("deventry", "deventry");
mods.botania.Lexicon.addTextPage("devpage", "deventry", 0);
mods.botania.Lexicon.addRunePage("devpage2", "deventry", 1, [<minecraft:apple>], [[<minecraft:nether_star>, <minecraft:beacon>, <minecraft:stone>]], [40]);
mods.botania.Lexicon.addPetalPage("devpage3", "deventry", 2, [<minecraft:apple>], [[<minecraft:stone>, <minecraft:nether_star>]]);
@ -36,4 +36,8 @@ mods.botania.Lexicon.addPetalPage("devpage3", "deventry", 2, [<minecraft:apple>]
mods.botania.Lexicon.removeCategory("botania.category.generationFlowers");
mods.botania.Lexicon.removeEntry("botania.entry.relics");
mods.botania.KnowledgeType.AddKnowledgeType("deventry", "DARK_AQUA", true);
mods.botania.KnowledgeType.AddKnowledgeType("jared", "GOLD", false);
recipes.addShapeless(<botania:lexicon>.withTag({"knowledge.jared" : true}), [[<botania:lexicon>, <minecraft:diamond>]]);
//This lexicon stuff is tiring. So it's unfinished.