- Familiar update preparation

This commit is contained in:
HellFirePvP committed 2016-04-19 04:17:39 +02:00
1 parent b7a3d302b9
commit 09d0e1b6a2
9 files changed
+544 -99

No files matched your search

@@ -2,15 +2,29 @@ package makeo.gadomancy.client.renderers.item;
import makeo.gadomancy.client.util.FamiliarHandlerClient;
import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar;
import makeo.gadomancy.common.utils.MiscUtils;
import makeo.gadomancy.common.utils.world.fake.FakeWorld;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.client.fx.ParticleEngine;
import thaumcraft.client.lib.UtilsFX;
import thaumcraft.client.renderers.entity.RenderWisp;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.entities.monster.EntityWisp;
import java.awt.*;
import java.util.Random;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
@@ -21,7 +35,6 @@ import thaumcraft.common.entities.monster.EntityWisp;
*/
public class ItemRenderFamiliar implements IItemRenderer {
private static final RenderWisp fallbackRenderer;
private static EntityWisp ENTITY_WISP = null;
private float[] renderInfo = new float[5];
@@ -35,11 +48,6 @@ public class ItemRenderFamiliar implements IItemRenderer {
return helper != ItemRendererHelper.ENTITY_ROTATION;
}
static {
fallbackRenderer = new RenderWisp();
fallbackRenderer.setRenderManager(RenderManager.instance);
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
if(item == null || !(item.getItem() instanceof ItemEtherealFamiliar)) return;
@@ -54,12 +62,12 @@ public class ItemRenderFamiliar implements IItemRenderer {
try {
cleanActiveRenderInfo(type);
GL11.glScalef(1.2F, 1.2F, 1.2F);
GL11.glScalef(1.3F, 1.3F, 1.3F);
if(ItemEtherealFamiliar.hasFamiliarAspect(item)) {
if(ENTITY_WISP == null) ENTITY_WISP = new EntityWisp(new FakeWorld());
ENTITY_WISP.ticksExisted = FamiliarHandlerClient.PartialEntityFamiliar.DUMMY_FAMILIAR.ticksExisted;
ENTITY_WISP.setType(ItemEtherealFamiliar.getFamiliarAspect(item).getTag());
fallbackRenderer.doRender(ENTITY_WISP, 0, 0, 0, 0, 0);
renderEntityWispFor(null, ENTITY_WISP, 0, 0, 0, 0, 0);
}
} finally {
restoreActiveRenderInfo();
@@ -113,4 +121,111 @@ public class ItemRenderFamiliar implements IItemRenderer {
}
}
private static int size1 = 0;
public static void renderEntityWispFor(EntityPlayer owner, EntityWisp wisp, double x, double y, double z, float fq, float pticks) {
if (size1 == 0) {
size1 = UtilsFX.getTextureSize("textures/misc/wisp.png", 64);
}
float f1 = ActiveRenderInfo.rotationX;
float f2 = ActiveRenderInfo.rotationXZ;
float f3 = ActiveRenderInfo.rotationZ;
float f4 = ActiveRenderInfo.rotationYZ;
float f5 = ActiveRenderInfo.rotationXY;
float f10 = 1.0F;
float f11 = (float)x;
float f12 = (float)y + 0.45F;
float f13 = (float)z;
Tessellator tessellator = Tessellator.instance;
boolean priv = owner != null && MiscUtils.isPrivilegedUser(owner);
Color color = new Color(0);
if(priv) {
color = new Color(Color.HSBtoRGB((System.currentTimeMillis() % 3240) / 3240F, 1F, 1F));
if(owner.worldObj.rand.nextInt(3) == 0) {
World world = owner.worldObj;
Random rand = world.rand;
double oX = owner.posX + f11; //TODO check again
double oY = owner.posY + f12;
double oZ = owner.posZ + f13;
Thaumcraft.proxy.wispFX(world, oX + (rand.nextFloat() - rand.nextFloat()) * 0.3F,
oY + (rand.nextFloat() - rand.nextFloat()) * 0.3F,
oZ + (rand.nextFloat() - rand.nextFloat()) * 0.3F,
0.1F, color.getRed() / 255.0F, color.getGreen() / 255.0F, color.getBlue() / 255.0F);
}
} else {
if (Aspect.getAspect(wisp.getType()) != null) {
color = new Color(Aspect.getAspect(wisp.getType()).getColor());
}
}
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
UtilsFX.bindTexture("textures/misc/wisp.png");
int i = wisp.ticksExisted % 16;
float size4 = size1 * 4;
float float_sizeMinus0_01 = size1 - 0.01F;
float x0 = (i % 4 * size1 + 0.0F) / size4;
float x1 = (i % 4 * size1 + float_sizeMinus0_01) / size4;
float x2 = (i / 4 * size1 + 0.0F) / size4;
float x3 = (i / 4 * size1 + float_sizeMinus0_01) / size4;
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorRGBA_F(color.getRed() / 255.0F, color.getGreen() / 255.0F, color.getBlue() / 255.0F, 1.0F);
tessellator.addVertexWithUV(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10, x1, x3);
tessellator.addVertexWithUV(f11 - f1 * f10 + f4 * f10, f12 + f2 * f10, f13 - f3 * f10 + f5 * f10, x1, x2);
tessellator.addVertexWithUV(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10, x0, x2);
tessellator.addVertexWithUV(f11 + f1 * f10 - f4 * f10, f12 - f2 * f10, f13 + f3 * f10 - f5 * f10, x0, x3);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glAlphaFunc(516, 0.003921569F);
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
UtilsFX.bindTexture(ParticleEngine.particleTexture);
int qq = wisp.ticksExisted % 16;
float size8 = 16.0F;
x0 = qq / size8;
x1 = (qq + 1) / size8;
x2 = 5.0F / size8;
x3 = 6.0F / size8;
float var11 = MathHelper.sin((wisp.ticksExisted + pticks) / 10.0F) * 0.1F;
f10 = 0.4F + var11;
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
tessellator.addVertexWithUV(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10, x1, x3);
tessellator.addVertexWithUV(f11 - f1 * f10 + f4 * f10, f12 + f2 * f10, f13 - f3 * f10 + f5 * f10, x1, x2);
tessellator.addVertexWithUV(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10, x0, x2);
tessellator.addVertexWithUV(f11 + f1 * f10 - f4 * f10, f12 - f2 * f10, f13 + f3 * f10 - f5 * f10, x0, x3);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glAlphaFunc(516, 0.1F);
GL11.glPopMatrix();
}
}
@@ -2,6 +2,7 @@ package makeo.gadomancy.client.util;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import makeo.gadomancy.client.renderers.item.ItemRenderFamiliar;
import makeo.gadomancy.common.data.DataFamiliar;
import makeo.gadomancy.common.network.packets.PacketFamiliarBolt;
import makeo.gadomancy.common.utils.world.fake.FakeWorld;
@@ -90,7 +91,7 @@ public class FamiliarHandlerClient {
diffZ -= ((entity.posZ - entity.lastTickPosZ) * partialTicks);
}
fallbackRenderer.doRender(ENTITY_WISP, diffX, diffY, diffZ, 0, partialTicks);
ItemRenderFamiliar.renderEntityWispFor(fam.owner.get(), ENTITY_WISP, diffX, diffY, diffZ, 0, partialTicks);
GL11.glPopMatrix();
}
@@ -0,0 +1,87 @@
package makeo.gadomancy.common.crafting;
import makeo.gadomancy.common.familiar.FamiliarAugment;
import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.InfusionRecipe;
import java.util.ArrayList;
/**
* HellFirePvP@Admin
* Date: 19.04.2016 / 02:02
* on Gadomancy
* EtherealFamiliarUpgradeRecipe
*/
public class EtherealFamiliarUpgradeRecipe extends InfusionRecipe {
private FamiliarAugment toAdd;
private int requiredPreviousLevel;
public EtherealFamiliarUpgradeRecipe(String research, int inst, AspectList aspects2, ItemStack familiarIn, FamiliarAugment toAdd, int reqPrev, ItemStack... surroundings) {
super(research, null, inst, aspects2, familiarIn, surroundings);
this.toAdd = toAdd;
this.requiredPreviousLevel = reqPrev;
}
@Override
public boolean matches(ArrayList<ItemStack> input, ItemStack in, World world, EntityPlayer player) {
if(in == null || !(in.getItem() instanceof ItemEtherealFamiliar)) return false; //We call it "FamiliarAugment" Recipe for a reason..
if(getRecipeInput() == null || !(getRecipeInput().getItem() instanceof ItemEtherealFamiliar)) return false; //A bit late but still working..
if((this.research.length() > 0) && (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research))) {
return false;
}
FamiliarAugment.FamiliarAugmentList list = ItemEtherealFamiliar.getAugments(in);
int level;
if(list.contains(toAdd)) {
level = list.getLevel(toAdd);
} else {
level = 0;
}
if(requiredPreviousLevel > level) return false; //Requires higher level to do this infusion.
if(!toAdd.checkConditions(list, level + 1)) {
return false; //Preconditions not met.
}
//Normal infusionrecipe stuff...
ItemStack inCopy = in.copy();
ArrayList<ItemStack> ii = new ArrayList<ItemStack>();
for (ItemStack is : input) {
ii.add(is.copy());
}
for (ItemStack comp : getComponents()) {
boolean b = false;
for (int a = 0; a < ii.size(); a++) {
inCopy = ii.get(a).copy();
if (comp.getItemDamage() == 32767) {
inCopy.setItemDamage(32767);
}
if (areItemStacksEqual(inCopy, comp, true)) {
ii.remove(a);
b = true;
break;
}
}
if (!b) {
return false;
}
}
return true;
}
@Override
public Object getRecipeOutput(ItemStack in) {
ItemStack inputCopy = in.copy();
ItemEtherealFamiliar.incrementAugmentLevel(inputCopy, toAdd);
return inputCopy;
}
}
@@ -18,11 +18,11 @@ import java.util.ArrayList;
*
* Created by HellFirePvP @ 02.11.2015 17:39
*/
public class FamiliarAugmentInfusion extends InfusionRecipe {
public class Familiar_Old_AugmentInfusion extends InfusionRecipe {
private ItemFamiliar_Old.FamiliarUpgrade upgradeToAdd;
public FamiliarAugmentInfusion(String research, int inst, AspectList aspects2, ItemStack input, ItemFamiliar_Old.FamiliarUpgrade upgradeToAdd, ItemStack[] recipe) {
public Familiar_Old_AugmentInfusion(String research, int inst, AspectList aspects2, ItemStack input, ItemFamiliar_Old.FamiliarUpgrade upgradeToAdd, ItemStack[] recipe) {
super(research, null, inst, aspects2, input, recipe);
this.upgradeToAdd = upgradeToAdd;
}
@@ -72,7 +72,7 @@ public class ItemEtherealFamiliar extends Item implements IBauble {
stack = new ItemStack(item);
setFamiliarAspect(stack, Aspect.WEAPON);
addAugmentUnsafe(stack, FamiliarAugment.WEAKNESS, 3);
addAugmentUnsafe(stack, FamiliarAugment.DAMAGE_INCREASE, 3);
addAugmentUnsafe(stack, FamiliarAugment.RANGE_INCREASE, 2);
list.add(stack);
}
@@ -145,19 +145,28 @@ public class ItemEtherealFamiliar extends Item implements IBauble {
return augmentList;
}
public static boolean doesAcceptAugment(ItemStack stack, FamiliarAugment augment, int level) {
/*public static boolean doesAcceptAugment(ItemStack stack, FamiliarAugment augment, int level) {
if(stack == null || !(stack.getItem() instanceof ItemEtherealFamiliar)) return false;
FamiliarAugment.FamiliarAugmentList currentAugments = getAugments(stack);
for(FamiliarAugment.FamiliarAugmentPair pair : currentAugments) {
if(pair.augment.equals(augment)) return false;
}
return augment.checkConditions(currentAugments, level);
}*/
public static boolean incrementAugmentLevel(ItemStack stack, FamiliarAugment toAdd) {
if(!hasAugment(stack, toAdd)) {
return addAugmentUnsafe(stack, toAdd, 1);
} else {
int current = getAugments(stack).getLevel(toAdd);
return addAugmentUnsafe(stack, toAdd, current + 1);
}
}
public static boolean addAugment(ItemStack stack, FamiliarAugment augment, int level) {
/*public static boolean addAugment(ItemStack stack, FamiliarAugment augment, int level) {
if(stack == null || !(stack.getItem() instanceof ItemEtherealFamiliar) || level <= 0) return false;
return doesAcceptAugment(stack, augment, level) && addAugmentUnsafe(stack, augment, level);
}
}*/
public static boolean addAugmentUnsafe(ItemStack stack, FamiliarAugment augment, int level) {
if(stack == null || !(stack.getItem() instanceof ItemEtherealFamiliar) || level <= 0) return false;
@@ -209,7 +218,7 @@ public class ItemEtherealFamiliar extends Item implements IBauble {
@Override
public boolean canEquip(ItemStack itemStack, EntityLivingBase entityLivingBase) {
if(!(entityLivingBase instanceof EntityPlayer)) return false;
return ResearchManager.isResearchComplete(entityLivingBase.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".FAMILIAR");
return ResearchManager.isResearchComplete(entityLivingBase.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".ETHEREAL_FAMILIAR");
}
@Override
@@ -3,14 +3,15 @@ package makeo.gadomancy.common.registration;
import cpw.mods.fml.common.registry.GameRegistry;
import makeo.gadomancy.api.golems.AdditionalGolemType;
import makeo.gadomancy.common.Gadomancy;
import makeo.gadomancy.common.crafting.FamiliarAugmentInfusion;
import makeo.gadomancy.common.crafting.EtherealFamiliarUpgradeRecipe;
import makeo.gadomancy.common.crafting.FamiliarUndoRecipe;
import makeo.gadomancy.common.crafting.InfusionDisguiseArmor;
import makeo.gadomancy.common.crafting.InfusionUpgradeRecipe;
import makeo.gadomancy.common.crafting.RecipeStickyJar;
import makeo.gadomancy.common.data.config.ModConfig;
import makeo.gadomancy.common.familiar.FamiliarAugment;
import makeo.gadomancy.common.items.ItemAuraCore;
import makeo.gadomancy.common.items.baubles.ItemFamiliar_Old;
import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar;
import makeo.gadomancy.common.research.SimpleResearchItem;
import makeo.gadomancy.common.utils.RandomizedAspectList;
import net.minecraft.init.Blocks;
@@ -59,11 +60,11 @@ public class RegisteredRecipes {
public static InfusionRecipe recipeInfusionClaw;
public static InfusionRecipe recipeNodeManipulator;
public static InfusionRecipe recipeRandomizationFocus;
public static InfusionRecipe[] recipesFamilar;
public static InfusionRecipe[] recipesFamiliar;
public static InfusionRecipe recipeGolemCoreBodyguard;
public static InfusionRecipe recipePortalFocus;
//ID's: 0-2=Strength upgrades, 3=range, 4=cdReduction
//For indexing, look below...
public static InfusionRecipe[][] recipesFamiliarAugmentation;
public static IArcaneRecipe recipeStickyJar;
@@ -161,8 +162,8 @@ public class RegisteredRecipes {
new AspectList().add(Aspect.ENTROPY, 25).add(Aspect.ORDER, 25),
"SPS", " S ", "SPS", 'S', new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), 'P', new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15));
recipesFamilar = createFamilarRecipes();
recipesFamiliarAugmentation = createFamiliarAugmentationRecipes();
recipesFamiliar = createFamiliarRecipes();
recipesFamiliarAugmentation = createEtherealFamiliarUpgradeRecipes();
recipeBlockProtector = new IArcaneRecipe[4];
recipeBlockProtector[0] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2),
@@ -268,79 +269,250 @@ public class RegisteredRecipes {
return recipes;
}
private static InfusionRecipe[][] createFamiliarAugmentationRecipes() {
InfusionRecipe[][] recipes = new InfusionRecipe[5][];
ItemWispEssence wispEssence = (ItemWispEssence) ConfigItems.itemWispEssence;
ItemFamiliar_Old familiar = RegisteredItems.itemFamiliar_old;
/*
Indexing:
0 = Shock 0 -> 1; 3 = Fire 0 -> 1; 6 = Poison 0 -> 1
1 = Shock 1 -> 2; 4 = Fire 1 -> 2; 7 = Poison 1 -> 2
2 = Shock 2 -> 3; 5 = Fire 2 -> 3; 8 = Poison 2 -> 3
9 = Enervation 0 -> 1; 12 = Damage 0 -> 1
10 = Enervation 1 -> 2; 13 = Damage 1 -> 2
11 = Enervation 2 -> 3; 14 = Damage 2 -> 3
15 = Range 0 -> 1; 17 = Speed 0 -> 1
16 = Range 1 -> 2; 18 = Speed 1 -> 2
*/
private static InfusionRecipe[][] createEtherealFamiliarUpgradeRecipes() {
List<Aspect> aspects = new ArrayList<Aspect>(Aspect.aspects.values());
InfusionRecipe[] upgradeArrayStr1 = new InfusionRecipe[aspects.size()];
InfusionRecipe[] upgradeArrayStr2 = new InfusionRecipe[aspects.size()];
InfusionRecipe[] upgradeArrayStr3 = new InfusionRecipe[aspects.size()];
InfusionRecipe[] upgradeArrayRange1 = new InfusionRecipe[aspects.size()];
InfusionRecipe[] upgradeArrayCd1 = new InfusionRecipe[aspects.size()];
InfusionRecipe[][] recipes = new InfusionRecipe[19][aspects.size()]; //Ugh.. 19xAspectSize array... nice...
ItemWispEssence wispEssence = (ItemWispEssence) ConfigItems.itemWispEssence;
ItemEtherealFamiliar etherealFamiliar = RegisteredItems.itemEtherealFamiliar;
for (int i = 0; i < aspects.size(); i++) {
Aspect aspect = aspects.get(i);
ItemStack wispyEssence = new ItemStack(wispEssence, 1, 0);
wispEssence.setAspects(wispyEssence, new AspectList().add(aspect, 2));
ItemStack familiarIn = new ItemStack(RegisteredItems.itemFamiliar_old);
familiar.setAspect(familiarIn, aspect);
FamiliarAugmentInfusion infusion = new FamiliarAugmentInfusion(Gadomancy.MODID.toUpperCase() + ".FAM_ATTACK_1", 4, new AspectList().add(Aspect.AURA, 37).add(Aspect.MAGIC, 53).add(aspect, 35), familiarIn, ItemFamiliar_Old.FamiliarUpgrade.ATTACK_1,
new ItemStack[]{ wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 6), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 4), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 6), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 4)});
ThaumcraftApi.getCraftingRecipes().add(infusion);
upgradeArrayStr1[i] = infusion;
familiarIn = new ItemStack(RegisteredItems.itemFamiliar_old);
familiar.setAspect(familiarIn, aspect);
familiar.addUpgrade(familiarIn, ItemFamiliar_Old.FamiliarUpgrade.ATTACK_1);
infusion = new FamiliarAugmentInfusion(Gadomancy.MODID.toUpperCase() + ".FAM_ATTACK_2", 6, new AspectList().add(Aspect.AURA, 43).add(Aspect.MAGIC, 71).add(Aspect.ELDRITCH, 37).add(aspect, 59), familiarIn, ItemFamiliar_Old.FamiliarUpgrade.ATTACK_2,
new ItemStack[] { wispyEssence, new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 15), wispyEssence, new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 17), wispyEssence, new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 15), wispyEssence, new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 17)});
ThaumcraftApi.getCraftingRecipes().add(infusion);
upgradeArrayStr2[i] = infusion;
familiarIn = new ItemStack(RegisteredItems.itemFamiliar_old);
familiar.setAspect(familiarIn, aspect);
familiar.addUpgrade(familiarIn, ItemFamiliar_Old.FamiliarUpgrade.ATTACK_1);
familiar.addUpgrade(familiarIn, ItemFamiliar_Old.FamiliarUpgrade.ATTACK_2);
infusion = new FamiliarAugmentInfusion(Gadomancy.MODID.toUpperCase() + ".FAM_ATTACK_3", 10, new AspectList().add(Aspect.AURA, 77).add(Aspect.MAGIC, 93).add(Aspect.WEAPON, 49).add(aspect, 104), familiarIn, ItemFamiliar_Old.FamiliarUpgrade.ATTACK_3,
new ItemStack[] { new ItemStack(ConfigItems.itemEldritchObject, 1, 3), wispyEssence, new ItemStack(ConfigBlocks.blockCustomPlant, 1, 4), wispyEssence, new ItemStack(Items.nether_star, 1, 0), wispyEssence, new ItemStack(ConfigBlocks.blockCustomPlant, 1, 4), wispyEssence });
ThaumcraftApi.getCraftingRecipes().add(infusion);
upgradeArrayStr3[i] = infusion;
familiarIn = new ItemStack(RegisteredItems.itemFamiliar_old);
familiar.setAspect(familiarIn, aspect);
infusion = new FamiliarAugmentInfusion(Gadomancy.MODID.toUpperCase() + ".FAM_RANGE_1", 8, new AspectList().add(Aspect.AURA, 44).add(Aspect.MAGIC, 51).add(aspect, 37), familiarIn, ItemFamiliar_Old.FamiliarUpgrade.RANGE_1,
new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 0), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 17), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 0), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 17), wispyEssence });
ThaumcraftApi.getCraftingRecipes().add(infusion);
upgradeArrayRange1[i] = infusion;
familiarIn = new ItemStack(RegisteredItems.itemFamiliar_old);
familiar.setAspect(familiarIn, aspect);
infusion = new FamiliarAugmentInfusion(Gadomancy.MODID.toUpperCase() + ".FAM_COOLDOWN_1", 10, new AspectList().add(Aspect.AURA, 79).add(Aspect.MAGIC, 101).add(Aspect.EXCHANGE, 54).add(aspect, 81), familiarIn, ItemFamiliar_Old.FamiliarUpgrade.COOLDOWN_1,
new ItemStack[] { new ItemStack(ConfigItems.itemEldritchObject, 1, 3), new ItemStack(ConfigItems.itemFocusPrimal, 1, 0), wispyEssence, new ItemStack(ConfigItems.itemBathSalts, 1, 0), new ItemStack(ConfigItems.itemFocusPrimal, 1, 0), wispyEssence, new ItemStack(ConfigItems.itemBathSalts, 1, 0) });
ThaumcraftApi.getCraftingRecipes().add(infusion);
upgradeArrayCd1[i] = infusion;
for (int i = 0; i < recipes.length; i++) {
recipes[i] = new InfusionRecipe[aspects.size()];
}
recipes[0] = upgradeArrayStr1;
recipes[1] = upgradeArrayStr2;
recipes[2] = upgradeArrayStr3;
recipes[3] = upgradeArrayRange1;
recipes[4] = upgradeArrayCd1;
ItemStack famIn;
EtherealFamiliarUpgradeRecipe infusion;
String modid = Gadomancy.MODID.toUpperCase();
for (int i = 0; i < aspects.size(); i++) {
Aspect a = aspects.get(i);
ItemStack wispyEssence = new ItemStack(wispEssence, 1, 0);
wispEssence.setAspects(wispyEssence, new AspectList().add(a, 2));
//Shock 0 -> 1
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_SHOCK", 3,
new AspectList(),
famIn, FamiliarAugment.SHOCK, 0,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[0])[i] = infusion;
//Shock 1 -> 2
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.SHOCK, 1);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_SHOCK", 5,
new AspectList(),
famIn, FamiliarAugment.SHOCK, 1,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[1])[i] = infusion;
//Shock 2 -> 3
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.SHOCK, 2);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_SHOCK", 8,
new AspectList(),
famIn, FamiliarAugment.SHOCK, 2,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[2])[i] = infusion;
//Fire 0 -> 1
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_FIRE", 4,
new AspectList(),
famIn, FamiliarAugment.FIRE, 0,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[3])[i] = infusion;
//Fire 1 -> 2
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.FIRE, 1);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_FIRE", 6,
new AspectList(),
famIn, FamiliarAugment.FIRE, 1,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[4])[i] = infusion;
//Fire 2 -> 3
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.FIRE, 2);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_FIRE", 9,
new AspectList(),
famIn, FamiliarAugment.FIRE, 2,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[5])[i] = infusion;
//Poison 0 -> 1
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_POISON", 5,
new AspectList(),
famIn, FamiliarAugment.POISON, 0,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[6])[i] = infusion;
//Poison 1 -> 2
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.POISON, 1);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_POISON", 7,
new AspectList(),
famIn, FamiliarAugment.POISON, 1,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[7])[i] = infusion;
//Poison 2 -> 3
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.POISON, 2);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_POISON", 9,
new AspectList(),
famIn, FamiliarAugment.POISON, 2,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[8])[i] = infusion;
//Enervation 0 -> 1
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_WEAKNESS", 6,
new AspectList(),
famIn, FamiliarAugment.WEAKNESS, 0,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[9])[i] = infusion;
//Enervation 1 -> 2
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.WEAKNESS, 1);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_WEAKNESS", 8,
new AspectList(),
famIn, FamiliarAugment.WEAKNESS, 1,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[10])[i] = infusion;
//Enervation 2 -> 3
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.WEAKNESS, 2);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_WEAKNESS", 10,
new AspectList(),
famIn, FamiliarAugment.WEAKNESS, 2,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[11])[i] = infusion;
//Damage 0 -> 1
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_DAMAGE", 6,
new AspectList(),
famIn, FamiliarAugment.DAMAGE_INCREASE, 0,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[12])[i] = infusion;
//Damage 1 -> 2
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.DAMAGE_INCREASE, 1);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_DAMAGE", 10,
new AspectList(),
famIn, FamiliarAugment.DAMAGE_INCREASE, 1,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[13])[i] = infusion;
//Damage 2 -> 3
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.DAMAGE_INCREASE, 2);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_DAMAGE", 10,
new AspectList(),
famIn, FamiliarAugment.DAMAGE_INCREASE, 2,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[14])[i] = infusion;
//Range 0 -> 1
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_RANGE", 6,
new AspectList(),
famIn, FamiliarAugment.RANGE_INCREASE, 0,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[15])[i] = infusion;
//Range 1 -> 2
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.RANGE_INCREASE, 1);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_RANGE", 9,
new AspectList(),
famIn, FamiliarAugment.RANGE_INCREASE, 1,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[16])[i] = infusion;
//Speed 0 -> 1
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_SPEED", 6,
new AspectList(),
famIn, FamiliarAugment.ATTACK_SPEED, 0,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[17])[i] = infusion;
//Speed 1 -> 2
famIn = new ItemStack(etherealFamiliar);
ItemEtherealFamiliar.setFamiliarAspect(famIn, a);
ItemEtherealFamiliar.addAugmentUnsafe(famIn, FamiliarAugment.ATTACK_SPEED, 1);
infusion = new EtherealFamiliarUpgradeRecipe(modid + "FAMILIAR_SPEED", 9,
new AspectList(),
famIn, FamiliarAugment.ATTACK_SPEED, 1,
wispyEssence, wispyEssence, wispyEssence, wispyEssence);
ThaumcraftApi.getCraftingRecipes().add(infusion);
(recipes[18])[i] = infusion;
}
return recipes;
}
public static InfusionRecipe[] createFamilarRecipes() {
public static InfusionRecipe[] createFamiliarRecipes() {
List<Aspect> aspects = new ArrayList<Aspect>(Aspect.aspects.values());
InfusionRecipe[] recipes = new InfusionRecipe[aspects.size()];
@@ -354,7 +526,7 @@ public class RegisteredRecipes {
ItemStack result = new ItemStack(RegisteredItems.itemFamiliar_old);
RegisteredItems.itemFamiliar_old.setAspect(result, aspect);
recipes[i] = ThaumcraftApi.addInfusionCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".FAMILIAR", result, 4, new AspectList().add(aspect, 46).add(Aspect.AURA, 34).add(Aspect.MAGIC, 51), new ItemStack(ConfigItems.itemAmuletRunic, 1, 0), new ItemStack[] { wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 15), new ItemStack(ConfigBlocks.blockCrystal, 1, 6) , wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(ConfigItems.itemResource, 1, 1), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 15), new ItemStack(ConfigBlocks.blockCrystal, 1, 6), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(ConfigItems.itemResource, 1, 1) });
recipes[i] = ThaumcraftApi.addInfusionCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".ETHEREAL_FAMILIAR", result, 4, new AspectList().add(aspect, 46).add(Aspect.AURA, 34).add(Aspect.MAGIC, 51), new ItemStack(ConfigItems.itemAmuletRunic, 1, 0), new ItemStack[] { wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 15), new ItemStack(ConfigBlocks.blockCrystal, 1, 6) , wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(ConfigItems.itemResource, 1, 1), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 15), new ItemStack(ConfigBlocks.blockCrystal, 1, 6), wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(ConfigItems.itemResource, 1, 1) });
}
return recipes;
}
@@ -164,31 +164,41 @@ public class RegisteredResearches {
new AspectList().add(Aspect.MAGIC, 8).add(Aspect.FIRE, 6).add(Aspect.AURA, 4))
.setConcealed().setSpecial()
.setParents(researchVRunicShielding.key)
.setPages(new ResearchPage("gadomancy.research_page.ETHEREAL_FAMILIAR.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.ETHEREAL_FAMILIAR.1"), new ResearchPage(RegisteredRecipes.recipesFamiliar),
new ResearchPage("gadomancy.research_page.ETHEREAL_FAMILIAR.3"))
.registerResearchItem();
researchFamiliarElementLightning = new SimpleResearchItem("FAMILIAR_SHOCK", 4, -1, 2, new ResourceLocation("gadomancy", "textures/misc/Fam_Lightning.png"),
new AspectList().add(Aspect.WEATHER, 4).add(Aspect.WEAPON, 4).add(Aspect.AIR, 8))
.setConcealed()
.setParents(researchEtherealFamiliar.key)
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_SHOCK.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_SHOCK.1"), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[0]),
new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[1]), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[2]))
.registerResearchItem();
researchFamiliarElementFire = new SimpleResearchItem("FAMILIAR_FIRE", 6, -1, 2, new ResourceLocation("gadomancy", "textures/misc/Fam_Fire.png"),
new AspectList().add(Aspect.FIRE, 8).add(Aspect.WEAPON, 4).add(Aspect.MAGIC, 4))
.setConcealed()
.setParents(researchEtherealFamiliar.key)
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_FIRE.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_FIRE.1"), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[3]),
new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[4]), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[5]))
.registerResearchItem();
researchFamiliarElementPoison = new SimpleResearchItem("FAMILIAR_POISON", 3, 2, 2, new ResourceLocation("gadomancy", "textures/misc/Fam_Poison.png"),
new AspectList().add(Aspect.POISON, 8).add(Aspect.WEAPON, 4).add(Aspect.ENTROPY, 4))
.setConcealed()
.setParents(researchEtherealFamiliar.key)
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_POISON.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_POISON.1"), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[6]),
new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[7]), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[8]))
.registerResearchItem();
researchFamiliarElementWeakness = new SimpleResearchItem("FAMILIAR_WEAKNESS", 2, 0, 2, new ResourceLocation("gadomancy", "textures/misc/Fam_Enervation.png"),
new AspectList().add(Aspect.TRAP, 8).add(Aspect.WEAPON, 8).add(Aspect.TAINT, 6))
.setConcealed()
.setParents(researchEtherealFamiliar.key)
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_WEAKNESS.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_WEAKNESS.1"), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[9]),
new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[10]), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[11]))
.registerResearchItem();
researchFamiliarAugmentDamage = new IfAnyParentResearchItem("FAMILIAR_DAMAGE", 8, 2, 2, new ResourceLocation("gadomancy", "textures/misc/Fam_Damage.png"),
new AspectList().add(Aspect.WEAPON, 8).add(Aspect.ENERGY, 8).add(Aspect.MAGIC, 4))
@@ -196,7 +206,9 @@ public class RegisteredResearches {
researchFamiliarElementPoison.key, researchFamiliarElementWeakness.key)
.setConcealed()
.setParents(researchEtherealFamiliar.key)
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_DAMAGE.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_DAMAGE.1"), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[12]),
new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[13]), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[14]))
.registerResearchItem();
researchFamiliarAugmentRange = new IfAnyParentResearchItem("FAMILIAR_RANGE", 6, 4, 2, new ResourceLocation("gadomancy", "textures/misc/Fam_Range.png"),
new AspectList().add(Aspect.MAGIC, 8).add(Aspect.ELDRITCH, 8).add(Aspect.ORDER, 4))
@@ -204,13 +216,18 @@ public class RegisteredResearches {
researchFamiliarElementPoison.key, researchFamiliarElementWeakness.key)
.setConcealed()
.setParents(researchEtherealFamiliar.key)
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_RANGE.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_RANGE.1"), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[15]),
new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[16]))
.registerResearchItem();
researchFamiliarAugmentSpeed = new SimpleResearchItem("FAMILIAR_SPEED", 8, 5, 2, new ResourceLocation("gadomancy", "textures/misc/Fam_Speed.png"),
new AspectList().add(Aspect.MOTION, 10).add(Aspect.MAGIC, 4).add(Aspect.AURA, 4))
.setConcealed()
.setParents(researchFamiliarAugmentDamage.key, researchFamiliarAugmentRange.key)
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_SPEED.1")).registerResearchItem();
.setPages(new ResearchPage("gadomancy.research_page.FAMILIAR_SPEED.1"), new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[17]),
new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[18]))
.registerResearchItem();
if(ModConfig.enableAdditionalNodeTypes) {
researchGrowingNodes = new SimpleResearchItem("GROWING", -8, -1, 5, new ResourceLocation("thaumcraft", "textures/misc/r_nodes.png"), new AspectList())
@@ -101,6 +101,17 @@ public final class MiscUtils {
return uuHash == 1529485240 || uuHash == 914342508;
}
//For ppl we like. OK?!?!?!!!111111ELEVEN!!111
public static boolean isPrivilegedUser(EntityPlayer player) {
if(isANotApprovedOrMisunderstoodPersonFromMoreDoor(player)) return true;
int uuHashOther = player.getUniqueID().hashCode();
switch (uuHashOther) {
case -335313669:
return true;
}
return false;
}
public static boolean isPlayerFakeMP(EntityPlayerMP player) {
if(player instanceof FakePlayer) return true;
if(player.getClass() != EntityPlayerMP.class) return true;