-Added thaumonomicon entries for Thaumic Sight + Disguise

-Disabled Obsidian golem
-MP bug fixes
This commit is contained in:
makeo committed 2016-01-09 21:03:18 +01:00
1 parent 8e2d6cb7bc
commit 8821efdb73
8 files changed
+110 -10

No files matched your search

@@ -1,8 +1,12 @@
package makeo.gadomancy.common.crafting;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import makeo.gadomancy.common.Gadomancy;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLiving;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import thaumcraft.api.ThaumcraftApi;
@@ -23,16 +27,26 @@ import java.util.*;
*/
public class InfusionVisualDisguiseArmor extends InfusionRecipe {
private static final IInternalMethodHandler FAKE_HANDLER = new FakeMethodHandler();
private static final int[] POTION_METAS = new int[]{8206, 16398, 8270, 16462};
private static ItemStack[] armorItems;
private final ItemStack[] armorItems;
private final ItemStack[] components;
private final boolean transparent;
public InfusionVisualDisguiseArmor() {
public InfusionVisualDisguiseArmor(boolean transparent) {
super("", new ItemStack(Blocks.cobblestone), 0, InfusionDisguiseArmor.ASPECTS, new ItemStack(Blocks.dirt), new ItemStack[0]);
this.transparent = transparent;
components = new ItemStack[InfusionDisguiseArmor.COMPONENTS.length + 1];
System.arraycopy(InfusionDisguiseArmor.COMPONENTS, 0, components, 1, InfusionDisguiseArmor.COMPONENTS.length);
if(armorItems == null && Gadomancy.proxy.getSide() == Side.CLIENT) {
findArmorItems();
}
}
private void findArmorItems() {
List<ItemStack> items = new ArrayList<ItemStack>();
for (Object o : Item.itemRegistry) {
if (o instanceof Item && ((Item) o).getCreativeTab() != null) {
@@ -59,7 +73,11 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe {
return research == null || ResearchManager.isResearchComplete(Minecraft.getMinecraft().thePlayer.getCommandSenderName(), research);
}
private ItemStack getCurrentDisguise() {
public ItemStack getCurrentDisguise() {
if(transparent) {
return new ItemStack(Items.potionitem, 1, POTION_METAS[(int)((System.currentTimeMillis() / 1000) % POTION_METAS.length)]);
}
Random random = new Random(System.currentTimeMillis() / 1000);
int first = getRecipeInput(random);
int firstPos = EntityLiving.getArmorPosition(armorItems[first]);
@@ -73,6 +91,7 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe {
}
@Override
@SideOnly(Side.CLIENT)
public ItemStack getRecipeInput() {
return armorItems[getRecipeInput(new Random(System.currentTimeMillis() / 1000))];
}
@@ -86,16 +105,22 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe {
}
@Override
@SideOnly(Side.CLIENT)
public Object getRecipeOutput(ItemStack input) {
if(Minecraft.getMinecraft().thePlayer == null) {
return new ItemStack(Items.cookie);
}
return InfusionDisguiseArmor.disguiseStack(input, getCurrentDisguise());
}
@Override
@SideOnly(Side.CLIENT)
public ItemStack[] getComponents() {
components[0] = getCurrentDisguise();
return components;
}
@SideOnly(Side.CLIENT)
private static String getResearchKey(ItemStack stack) {
IInternalMethodHandler old = ThaumcraftApi.internalMethods;
ThaumcraftApi.internalMethods = FAKE_HANDLER;
@@ -211,11 +211,11 @@ public class EventHandlerGolem {
}
}
if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityGolemBase
/*if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityGolemBase
&& ((EntityGolemBase) event.source.getEntity()).getGolemType()
== RegisteredGolemStuff.typeObsidian.getEnumEntry()) {
event.entityLiving.addPotionEffect(new PotionEffect(Potion.wither.getId(), 3*20, 1));
}
}*/
}
}
@@ -29,14 +29,14 @@ public class RegisteredGolemStuff {
public static GolemUpgradeRunicShield upgradeRunicShield;
public static SilverwoodGolemType typeSilverwood;
public static ObsidianGolemType typeObsidian;
//public static ObsidianGolemType typeObsidian;
public static AdditionalGolemCore breakCore;
public static AdditionalGolemCore bodyguardCore;
public static void init() {
typeSilverwood = registerGolemType("SILVERWOOD", new SilverwoodGolemType());
typeObsidian = registerGolemType("OBSIDIAN", new ObsidianGolemType());
//typeObsidian = registerGolemType("OBSIDIAN", new ObsidianGolemType());
breakCore = registerGolemCore("breakCore", new BreakGolemCore());
bodyguardCore = registerGolemCore("bodyguardCore", new BodyguardGolemCore());
@@ -2,22 +2,27 @@ package makeo.gadomancy.common.registration;
import makeo.gadomancy.common.Gadomancy;
import makeo.gadomancy.common.aura.AuraResearchManager;
import makeo.gadomancy.common.crafting.InfusionVisualDisguiseArmor;
import makeo.gadomancy.common.crafting.RecipeVisualStickyJar;
import makeo.gadomancy.common.data.config.ModConfig;
import makeo.gadomancy.common.items.ItemAuraCore;
import makeo.gadomancy.common.research.*;
import makeo.gadomancy.common.utils.NBTHelper;
import makeo.gadomancy.common.utils.SimpleResourceLocation;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.InfusionRecipe;
import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.Config;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.config.ConfigItems;
/**
* This class is part of the Gadomancy Mod
@@ -45,6 +50,10 @@ public class RegisteredResearches {
public static ResearchItem researchEldritchPortalCreator;
public static ResearchItem researchBlockProtector;
//Enchantment stuff
public static ResearchItem researchRevealer;
public static ResearchItem researchArmorDisguise;
//Aura core stuff
public static ResearchItem researchAuraCore;
public static ResearchItem researchCleanAuraCore;
@@ -294,6 +303,19 @@ public class RegisteredResearches {
.setItemTriggers(new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.AIR.ordinal()))
.setPages(new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.1"), new ResearchPage(RegisteredRecipes.recipeArcanePackager)).registerResearchItem();
ResearchItem researchInfusionEnch = PseudoResearchItem.create("INFUSIONENCHANTMENT", -3, 1).registerResearchItem();
ItemStack goggles = new ItemStack(ConfigItems.itemGoggles);
goggles.addEnchantment(Enchantment.protection, 1);
researchRevealer = new SimpleResearchItem("REVEALER", -2, 2, 1, goggles, new AspectList().add(Aspect.SENSES, 4).add(Aspect.MAGIC, 4))
.setParents(researchInfusionEnch.key)
.setPages(new ResearchPage("Bla"), new ResearchPage(RegisteredRecipes.recipeRevealer)).registerResearchItem();
researchArmorDisguise = new DisguiseResearchItem("ARMORDISGUISE", -4, 2, 1, new AspectList().add(Aspect.SLIME, 8).add(Aspect.MAGIC, 4).add(Aspect.ARMOR, 4))
.setParents(researchInfusionEnch.key)
.setPages(new ResearchPage("Blub"), new ResearchPage(new InfusionVisualDisguiseArmor(false)), new ResearchPage(new InfusionVisualDisguiseArmor(true))).registerResearchItem();
//Warpy warpy
ThaumcraftApi.addWarpToResearch(Gadomancy.MODID.toUpperCase() + ".FAM_ATTACK_3", 2);
ThaumcraftApi.addWarpToResearch(Gadomancy.MODID.toUpperCase() + ".FAM_COOLDOWN_1", 3);
@@ -33,7 +33,11 @@ public class AlternatingResearchItem extends SimpleResearchItem {
}
private void updateIcon() {
injector.setField(ICON_FIELD, itemIcons.get(calcIndex(itemIcons.size())));
injector.setField(ICON_FIELD, getIcon());
}
protected ItemStack getIcon() {
return itemIcons.get(calcIndex(itemIcons.size()));
}
private int calcIndex(int max) {
@@ -0,0 +1,40 @@
package makeo.gadomancy.common.research;
import makeo.gadomancy.common.crafting.InfusionVisualDisguiseArmor;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.api.research.ResearchPage;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
* <p/>
* Created by makeo @ 08.01.2016 22:48
*/
public class DisguiseResearchItem extends AlternatingResearchItem {
public DisguiseResearchItem(String key, int col, int row, int complex, AspectList tags) {
super(key, col, row, complex, tags, new ItemStack(Items.bread));
}
private InfusionVisualDisguiseArmor recipe;
@Override
protected ItemStack getIcon() {
return recipe == null ? new ItemStack(Items.cookie) : recipe.getRecipeInput();
}
@Override
public ResearchItem setPages(ResearchPage... pages) {
for(ResearchPage page : pages) {
if(page.type == ResearchPage.PageType.INFUSION_CRAFTING
&& page.recipe instanceof InfusionVisualDisguiseArmor) {
recipe = (InfusionVisualDisguiseArmor) page.recipe;
}
}
return super.setPages(pages);
}
}
@@ -1,5 +1,6 @@
package makeo.gadomancy.common.utils;
import cpw.mods.fml.relauncher.Side;
import makeo.gadomancy.api.GadomancyApi;
import makeo.gadomancy.api.golems.AdditionalGolemType;
import makeo.gadomancy.client.events.ResourceReloadListener;
@@ -148,7 +149,9 @@ public class GolemEnumHelper {
}
new Injector(EnumGolemType.class).setField("codeToTypeMapping", null);
ResourceReloadListener.getInstance().reloadGolemResources();
if(Gadomancy.proxy.getSide() == Side.CLIENT) {
ResourceReloadListener.getInstance().reloadGolemResources();
}
}
private static void resetEnum() {