- NodeManipulator: Finish

- ExtendedNodes: Rebalancing
- Recipes and Thaumonomicon entries added.
This commit is contained in:
HellFirePvP committed 2015-10-31 00:28:46 +01:00
1 parent 4b55a440c3
commit 48144e4ac5
13 files changed
+190 -76

No files matched your search

@@ -138,7 +138,7 @@ public class BlockStoneMachine extends Block {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
if(world.getBlock(x, y - 1, z).equals(RegisteredBlocks.blockNodeManipulator) && world.getBlockMetadata(x, y - 1, z) == 5) {
if(world.getBlockMetadata(x, y, z) == 0 && world.getBlock(x, y - 1, z).equals(RegisteredBlocks.blockNodeManipulator) && world.getBlockMetadata(x, y - 1, z) == 5) {
world.getBlock(x, y - 1, z).onBlockActivated(world, x, y - 1, z, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_);
}
return super.onBlockActivated(world, x, y, z, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_);
@@ -7,6 +7,7 @@ import makeo.gadomancy.common.network.packets.PacketTCNodeBolt;
import makeo.gadomancy.common.node.ExtendedNodeType;
import makeo.gadomancy.common.node.GrowingNodeBehavior;
import makeo.gadomancy.common.utils.ExplosionHelper;
import makeo.gadomancy.common.utils.ResearchHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
@@ -31,6 +32,7 @@ import thaumcraft.common.lib.research.ResearchManager;
import thaumcraft.common.tiles.TileNode;
import java.util.List;
import java.util.Random;
/**
* This class is part of the Gadomancy Mod
@@ -54,26 +56,6 @@ public class TileExtendedNode extends TileNode implements INode {
this.behavior = new GrowingNodeBehavior(this);
}
public void addTypeSpecificAspects(ExtendedNodeType extendedNodeType) {
if(extendedNodeType == null) return;
switch (extendedNodeType) {
case GROWING:
List<Aspect> compounds = Aspect.getCompoundAspects();
int count = 1;
if(worldObj.rand.nextInt(3) == 0) count++;
while(count > 0) {
count--;
Aspect random = compounds.get(worldObj.rand.nextInt(compounds.size()));
int val = getAspectsBase().getAmount(random) + worldObj.rand.nextInt(40) + 20;
getAspectsBase().add(random, val);
getAspects().add(random, val);
}
break;
case STARVING:
break;
}
}
@Override
public void updateEntity() {
super.updateEntity();
@@ -118,15 +100,7 @@ public class TileExtendedNode extends TileNode implements INode {
if(livingEntity instanceof EntityPlayer && ((EntityPlayer) livingEntity).capabilities.isCreativeMode) continue;
if(!behavior.mayZapNow()) continue;
String research = Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION";
List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1).expand(6.0D, 6.0D, 6.0D));
for(Object pl : players) {
EntityPlayer player = (EntityPlayer) pl;
if(!ResearchManager.isResearchComplete(player.getCommandSenderName(), research) && ResearchManager.doesPlayerHaveRequisites(player.getCommandSenderName(), research)) {
thaumcraft.common.lib.network.PacketHandler.INSTANCE.sendTo(new PacketResearchComplete(research), (EntityPlayerMP)player);
Thaumcraft.proxy.getResearchManager().completeResearch(player, research);
}
}
ResearchHelper.distributeResearch(Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", worldObj, xCoord, yCoord, zCoord, 6);
livingEntity.attackEntityFrom(DamageSource.magic, behavior.getZapDamage());
PacketTCNodeBolt packet = new PacketTCNodeBolt(xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, (float) livingEntity.posX, (float) (livingEntity.posY + livingEntity.height), (float) livingEntity.posZ);
@@ -189,11 +163,14 @@ public class TileExtendedNode extends TileNode implements INode {
TileEntity t = worldObj.getTileEntity(xCoord + xx, yCoord + yy, zCoord + zz);
if(t != null && t instanceof TileNode && !(xx == 0 && yy == 0 && zz == 0)) {
TileNode node = (TileNode) t;
behavior.lockOnTo(node);
worldObj.markBlockForUpdate(xCoord + xx, yCoord + yy, zCoord + zz);
node.markDirty();
needUpdate = true;
int thisSize = getAspectsBase().visSize();
int othersSize = node.getAspectsBase().visSize();
if(thisSize >= othersSize) {
behavior.lockOnTo(node);
worldObj.markBlockForUpdate(xCoord + xx, yCoord + yy, zCoord + zz);
node.markDirty();
needUpdate = true;
}
}
} else {
needUpdate = behavior.updateBehavior(needUpdate);
@@ -39,8 +39,8 @@ import java.util.List;
*/
public class TileNodeManipulator extends TileWandPedestal implements IAspectContainer, IWandable {
private static final int POSSIBLE_WORK_START = 50;
private static final int WORK_ASPECT_CAP = 250;
private static final int POSSIBLE_WORK_START = 70;
private static final int WORK_ASPECT_CAP = 150;
private boolean multiblockStructurePresent = false;
private boolean isMultiblock = false;
@@ -10,7 +10,6 @@ package makeo.gadomancy.common.node;
*/
public enum ExtendedNodeType {
GROWING,
STARVING
GROWING
}
@@ -7,23 +7,17 @@ import makeo.gadomancy.common.network.PacketHandler;
import makeo.gadomancy.common.network.packets.PacketAnimationAbsorb;
import makeo.gadomancy.common.network.packets.PacketTCNodeBolt;
import makeo.gadomancy.common.registration.RegisteredBlocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import makeo.gadomancy.common.utils.ResearchHelper;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.entities.EntityAspectOrb;
import thaumcraft.common.lib.network.playerdata.PacketResearchComplete;
import thaumcraft.common.lib.research.ResearchManager;
import thaumcraft.common.tiles.TileNode;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
@@ -36,9 +30,9 @@ import java.util.Map;
*/
public class GrowingNodeBehavior {
public static final double SATURATION_DIFFICULTY = 10D;
public static final double SATURATION_CAP = 100D;
public static final int HAPPINESS_CAP = 1000;
public static final double SATURATION_DIFFICULTY = 15D;
public static final double SATURATION_CAP = 90D;
public static final int HAPPINESS_CAP = 500;
//The node the growing node attacks.
private TileNode fixedNode;
@@ -73,15 +67,7 @@ public class GrowingNodeBehavior {
addSaturation(aspect, increasedSaturation);
owningNode.getAspectsBase().add(aspect, value);
String research = Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH";
List players = owningNode.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(owningNode.xCoord, owningNode.yCoord, owningNode.zCoord, owningNode.xCoord + 1, owningNode.yCoord + 1, owningNode.zCoord + 1).expand(6.0D, 6.0D, 6.0D));
for(Object pl : players) {
EntityPlayer player = (EntityPlayer) pl;
if(!ResearchManager.isResearchComplete(player.getCommandSenderName(), research) && ResearchManager.doesPlayerHaveRequisites(player.getCommandSenderName(), research)) {
thaumcraft.common.lib.network.PacketHandler.INSTANCE.sendTo(new PacketResearchComplete(research), (EntityPlayerMP)player);
Thaumcraft.proxy.getResearchManager().completeResearch(player, research);
}
}
ResearchHelper.distributeResearch(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH", owningNode.getWorldObj(), owningNode.xCoord, owningNode.yCoord, owningNode.zCoord, 6);
computeOverallSaturation();
}
@@ -169,7 +155,6 @@ public class GrowingNodeBehavior {
}
public boolean updateBehavior(boolean needUpdate) {
//TODO fix empty nodes...
if(fixedNode != null && owningNode.ticksExisted % 3 == 0) {
if(owningNode.getWorldObj().getBlock(fixedNode.xCoord, fixedNode.yCoord, fixedNode.zCoord) != RegisteredBlocks.blockNode ||
owningNode.getWorldObj().getTileEntity(fixedNode.xCoord, fixedNode.yCoord, fixedNode.zCoord) == null ||
@@ -183,10 +168,7 @@ public class GrowingNodeBehavior {
int x = fixedNode.xCoord;
int y = fixedNode.yCoord;
int z = fixedNode.zCoord;
owningNode.getWorldObj().setBlockToAir(x, y, z);
owningNode.getWorldObj().removeTileEntity(x, y, z);
owningNode.getWorldObj().markBlockForUpdate(x, y, z);
this.fixedNode = null;
removeFixedNode(x, y, z);
return needUpdate;
}
Aspect a = baseAspects.getAspects()[owningNode.getWorldObj().rand.nextInt(baseAspects.getAspects().length)];
@@ -201,6 +183,8 @@ public class GrowingNodeBehavior {
int oz = owningNode.zCoord;
currentAspects.reduce(a, 1);
ResearchHelper.distributeResearch(Gadomancy.MODID.toUpperCase() + ".GROWING_ATTACK", owningNode.getWorldObj(), owningNode.xCoord, owningNode.yCoord, owningNode.zCoord, 16);
EntityAspectOrb aspectOrb = new EntityAspectOrb(world, fx + 0.5D, fy + 0.5D, fz + 0.5D, a, 1);
Vec3 dir = Vec3.createVectorHelper(fx + 0.5D, fy + 0.5D, fz + 0.5D).subtract(Vec3.createVectorHelper(ox + 0.5D, oy + 0.5D, oz + 0.5D)).normalize();
dir.addVector(randOffset(), randOffset(), randOffset()).normalize();
@@ -217,16 +201,35 @@ public class GrowingNodeBehavior {
world.markBlockForUpdate(fx, fy, fz);
fixedNode.markDirty();
needUpdate = true;
} else {
baseAspects.remove(a);
currentAspects.remove(a);
int x = fixedNode.xCoord;
int y = fixedNode.yCoord;
int z = fixedNode.zCoord;
removeFixedNode(x, y, z);
return needUpdate;
}
} else {
baseAspects.remove(a);
currentAspects.remove(a);
int x = fixedNode.xCoord;
int y = fixedNode.yCoord;
int z = fixedNode.zCoord;
removeFixedNode(x, y, z);
return needUpdate;
}
}
return needUpdate;
}
private void removeFixedNode(int x, int y, int z) {
owningNode.getWorldObj().setBlockToAir(x, y, z);
owningNode.getWorldObj().removeTileEntity(x, y, z);
owningNode.getWorldObj().markBlockForUpdate(x, y, z);
this.fixedNode = null;
}
private float randOffset() {
return owningNode.getWorldObj().rand.nextFloat() / 3;
}
@@ -265,9 +268,7 @@ public class GrowingNodeBehavior {
return (Math.log(i) / 6) + 1;
}
private void handleOverfeed() {
//TODO let node collapse if overfed & still feeding...
}
private void handleOverfeed() {}
public void readFromNBT(NBTTagCompound nbtTagCompound) {
this.isSaturated = nbtTagCompound.getBoolean("overallSaturated");
@@ -75,6 +75,12 @@ public class NodeManipulatorResultHandler {
//Modifier pair
possibleResults.add(RegisteredManipulations.resultIncreaseModifier);
possibleResults.add(RegisteredManipulations.resultDecreaseModifier);
//Switch node Type
possibleResults.add(RegisteredManipulations.resultSwitchType);
//Almighty Growing
possibleResults.add(RegisteredManipulations.resultApplyGrowing);
}
}
@@ -1,11 +1,15 @@
package makeo.gadomancy.common.registration;
import makeo.gadomancy.common.Gadomancy;
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
import makeo.gadomancy.common.node.ExtendedNodeType;
import makeo.gadomancy.common.node.NodeManipulatorResult;
import makeo.gadomancy.common.node.NodeManipulatorResultHandler;
import makeo.gadomancy.common.utils.ResearchHelper;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.nodes.NodeModifier;
import thaumcraft.api.nodes.NodeType;
/**
* This class is part of the Gadomancy Mod
@@ -39,7 +43,7 @@ public class RegisteredManipulations {
}
};
public static NodeManipulatorResult resultCombineAspects = new NodeManipulatorResult(4) {
public static NodeManipulatorResult resultCombineAspects = new NodeManipulatorResult(5) {
@Override
public boolean affect(TileExtendedNode node) {
AspectList base = node.getAspectsBase();
@@ -87,7 +91,7 @@ public class RegisteredManipulations {
}
};
public static NodeManipulatorResult resultIncreaseModifier = new NodeManipulatorResult(1) {
public static NodeManipulatorResult resultIncreaseModifier = new NodeManipulatorResult(4) {
@Override
public boolean canAffect(TileExtendedNode node) {
@@ -114,7 +118,7 @@ public class RegisteredManipulations {
}
};
public static NodeManipulatorResult resultDecreaseModifier = new NodeManipulatorResult(1) {
public static NodeManipulatorResult resultDecreaseModifier = new NodeManipulatorResult(5) {
@Override
public boolean canAffect(TileExtendedNode node) {
@@ -141,4 +145,41 @@ public class RegisteredManipulations {
}
};
public static NodeManipulatorResult resultSwitchType = new NodeManipulatorResult(2) {
@Override
public boolean affect(TileExtendedNode node) {
NodeType newType = node.getNodeType();
int random = node.getWorldObj().rand.nextInt(40);
if(random > 38) {
newType = NodeType.HUNGRY; //1 of 40
} else if(random > 37) {
newType = NodeType.TAINTED; //1 of 40
} else if(random > 34) {
newType = NodeType.UNSTABLE; //3 of 40
} else if(random > 29) {
newType = NodeType.DARK; //5 of 40
} else if(random > 24) {
newType = NodeType.PURE; //5 of 40
} else if(random > 14) {
newType = NodeType.NORMAL; //10 of 40
}
//15 of 40 chance nothing happens
boolean changed = !newType.equals(node.getNodeType());
if(changed) node.setNodeType(newType);
return changed;
}
};
public static NodeManipulatorResult resultApplyGrowing = new NodeManipulatorResult(1) {
@Override
public boolean affect(TileExtendedNode node) {
boolean isGrowingAlready = node.getExtendedNodeType() != null && node.getExtendedNodeType().equals(ExtendedNodeType.GROWING);
if(!isGrowingAlready) {
node.setExtendedNodeType(ExtendedNodeType.GROWING);
ResearchHelper.distributeResearch(Gadomancy.MODID.toUpperCase() + ".GROWING", node.getWorldObj(), node.xCoord, node.yCoord, node.zCoord, 12);
}
return isGrowingAlready;
}
};
}
@@ -1,6 +1,8 @@
package makeo.gadomancy.common.registration;
import jdk.nashorn.internal.runtime.regexp.joni.Config;
import makeo.gadomancy.api.golems.AdditionalGolemType;
import makeo.gadomancy.common.Gadomancy;
import makeo.gadomancy.common.crafting.InfusionUpgradeRecipe;
import makeo.gadomancy.common.crafting.RecipeStickyJar;
import makeo.gadomancy.common.research.SimpleResearchItem;
@@ -33,10 +35,14 @@ public class RegisteredRecipes {
public static AspectList costsNodeManipulatorMultiblock = new AspectList().add(Aspect.FIRE, 100).add(Aspect.WATER, 100).add(Aspect.EARTH, 100).add(Aspect.AIR, 100).add(Aspect.ORDER, 100).add(Aspect.ENTROPY, 100);
public static List multiblockNodeManipulator;
public static InfusionRecipe recipeGolemSilverwood;
public static InfusionRecipe[] recipesGolemRunicShield;
public static InfusionRecipe recipeGolemCoreBreak;
public static InfusionRecipe recipeInfusionClaw;
public static InfusionRecipe recipeNodeManipulator;
public static InfusionRecipe recipeRandomizationFocus;
public static IArcaneRecipe recipeStickyJar;
public static IArcaneRecipe recipeArcaneDropper;
@@ -72,6 +78,24 @@ public class RegisteredRecipes {
new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5), new ItemStack[]{new ItemStack(ConfigItems.itemFocusPrimal), /*new ItemStack(Items.redstone),*/ new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), new ItemStack(ConfigItems.itemGolemCore, 1, 8), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 15), /*new ItemStack(Items.redstone),*/ new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6)});
recipeRemoteJar = ThaumcraftApi.addArcaneCraftingRecipe(SimpleResearchItem.getFullName("REMOTEJAR"), new ItemStack(RegisteredBlocks.blockRemoteJar), new AspectList().add(Aspect.WATER, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10), "GJG", "GMG", 'G', new ItemStack(ConfigBlocks.blockMagicalLog), 'J', new ItemStack(ConfigBlocks.blockJar), 'M', new ItemStack(ConfigBlocks.blockMirror, 1, 6));
recipeNodeManipulator = ThaumcraftApi.addInfusionCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR",
new ItemStack(RegisteredBlocks.blockNodeManipulator, 1, 5), 10,
new AspectList().add(Aspect.AURA, 42).add(Aspect.ELDRITCH, 22).add(Aspect.MAGIC, 38).add(Aspect.MECHANISM, 28).add(Aspect.DARKNESS, 14),
new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5),
new ItemStack[] {new ItemStack(ConfigBlocks.blockStoneDevice, 1, 9), new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 17), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 15), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 3), new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 17), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 15)});
recipeRandomizationFocus = ThaumcraftApi.addInfusionCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR",
new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 0), 7,
new AspectList().add(Aspect.ELDRITCH, 18).add(Aspect.MAGIC, 18).add(Aspect.MECHANISM, 20).add(Aspect.DARKNESS, 28).add(Aspect.ORDER, 30),
new ItemStack(ConfigBlocks.blockStoneDevice, 1, 8),
new ItemStack[] {new ItemStack(ConfigItems.itemResource, 1, 15), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigItems.itemResource, 1, 15), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 16)});
multiblockNodeManipulator = Arrays.asList(costsNodeManipulatorMultiblock, 3, 3, 3,
Arrays.asList(
null, null, null, null, new ItemStack(RegisteredBlocks.blockNode, 1, 5), null, null, null, null,
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), null, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), null, new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 0), null, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), null, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15), null, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15), null, new ItemStack(RegisteredBlocks.blockNodeManipulator, 1, 5), null, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15), null, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15)));
}
private static IArcaneRecipe[] stickyJarRecipes = null;
@@ -37,9 +37,13 @@ public class RegisteredResearches {
public static ResearchItem researchGolemCoreBreak;
public static ResearchItem researchInfusionClaw;
public static ResearchItem researchRemoteJar;
public static ResearchItem researchNodeManipulator;
//Growing nodes stuff
public static ResearchItem researchGrowingNodes;
public static ResearchItem researchGrowingNodeAgression;
public static ResearchItem researchGrowingNodeGrowth;
public static ResearchItem researchGrowingNodeAttackNodes;
public static ResearchItem researchGrowingNodeGrowthClue;
public static void init() {
@@ -74,13 +78,25 @@ public class RegisteredResearches {
ResearchItem researchFocusPrimal = PseudoResearchItem.create("FOCUSPRIMAL", -2, -3).registerResearchItem();
ResearchItem researchItemVoidMetal = PseudoResearchItem.create("VOIDMETAL", -3, 4).registerResearchItem();
ResearchItem researchNodeStabilizer = PseudoResearchItem.create("NODESTABILIZER", -3, 6).registerResearchItem();
ResearchItem researchWardingStone = PseudoResearchItem.create("PAVEWARD", -1, 6).registerResearchItem();
researchInfusionClaw = new SimpleResearchItem("INFUSIONCLAW", -1, -3, 5, new ItemStack(RegisteredBlocks.blockInfusionClaw),
new AspectList().add(Aspect.ELDRITCH, 8).add(Aspect.MECHANISM, 8).add(Aspect.MAGIC, 8).add(Aspect.ORDER, 8).add(Aspect.DARKNESS, 4))
.setParents(researchFocusPrimal.key).setConcealed()
.setPages(new ResearchPage("gadomancy.research_page.INFUSIONCLAW.1"), new ResearchPage(RegisteredRecipes.recipeInfusionClaw)).registerResearchItem();
researchNodeManipulator = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR", Gadomancy.MODID,
new AspectList().add(Aspect.ELDRITCH, 1).add(Aspect.AURA, 1).add(Aspect.DARKNESS, 1).add(Aspect.MAGIC, 1).add(Aspect.GREED, 1).add(Aspect.VOID, 1).add(Aspect.MECHANISM, 1).add(Aspect.EXCHANGE, 1),
-1, 4, 2, new ItemStack(RegisteredBlocks.blockNodeManipulator, 1, 5))
.setConcealed().setSpecial()
.setParents(researchItemVoidMetal.key, researchNodeStabilizer.key, researchWardingStone.key)
.setPages(new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.1"), new ResearchPage(RegisteredRecipes.recipeNodeManipulator), new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.3"), new ResearchPage(RegisteredRecipes.recipeRandomizationFocus), new ResearchPage(RegisteredRecipes.multiblockNodeManipulator), new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.6")).registerResearchItem();
researchGrowingNodes = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING", Gadomancy.MODID, new AspectList(), 2, 2, 5, new ResourceLocation("thaumcraft", "textures/misc/r_nodes.png"))
.setSpecial().setLost()
.setSpecial().setLost().setConcealed()
.setParents(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR")
.setPages(new ResearchPage("gadomancy.research_page.GROWING.1"), new ResearchPage("gadomancy.research_page.GROWING.2")).registerResearchItem();
researchGrowingNodeAgression = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", Gadomancy.MODID, new AspectList(), 5, 3, 6, new ItemStack(ConfigBlocks.blockAiry, 1, 5))
@@ -88,19 +104,25 @@ public class RegisteredResearches {
.setParents(Gadomancy.MODID.toUpperCase() + ".GROWING")
.setPages(new ResearchPage("gadomancy.research_page.GROWING_AGGRESSION.1")).registerResearchItem();
researchGrowingNodeGrowth = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH", Gadomancy.MODID, new AspectList(), 3, 5, 6, new ResourceLocation("thaumcraft", "textures/misc/r_nodes_2.png"))
researchGrowingNodeGrowth = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH", Gadomancy.MODID, new AspectList(), 3, 5, 6, new ResourceLocation("gadomancy", "textures/misc/r_node_star.png"))
.setLost()
.setParents(Gadomancy.MODID.toUpperCase() + ".GROWING")
.setPages(new ResearchPage("gadomancy.research_page.GROWING_GROWTH.1"), new ResearchPage("gadomancy.research_page.GROWING_GROWTH.2")).registerResearchItem();
researchGrowingNodeAttackNodes = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING_ATTACK", Gadomancy.MODID, new AspectList(), 4, 4, 6, new ResourceLocation("gadomancy", "textures/misc/r_node_dark.png"))
.setLost()
.setParents(Gadomancy.MODID.toUpperCase() + ".GROWING")
.setPages(new ResearchPage("gadomancy.research_page.GROWING_ATTACK.1")).registerResearchItem();
researchGrowingNodeGrowthClue = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTHCLUE", Gadomancy.MODID,
new AspectList().add(Aspect.AURA, 10).add(Aspect.MAGIC, 15).add(Aspect.ELDRITCH, 5).add(Aspect.VOID, 12).add(Aspect.ENERGY, 12).add(Aspect.ENTROPY, 8).add(Aspect.DEATH, 3)
.add(Aspect.GREED, 10).add(Aspect.HUNGER, 10).add(Aspect.MECHANISM, 12).add(Aspect.DARKNESS, 12),
6, 6, 2, new ItemStack(ConfigBlocks.blockAiry, 1, 0))
6, 6, 2, new ItemStack(ConfigBlocks.blockAiry, 1, 5))
.setSpecial().setRound().setConcealed()
.setParents(Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH")
.setParents(Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH", Gadomancy.MODID.toUpperCase() + ".GROWING_ATTACK")
.setPages(new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.1"), new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.2")).registerResearchItem();
ThaumcraftApi.addWarpToResearch(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR", 4);
ThaumcraftApi.addWarpToResearch(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTHCLUE", 3);
}
@@ -0,0 +1,34 @@
package makeo.gadomancy.common.utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.lib.network.playerdata.PacketResearchComplete;
import thaumcraft.common.lib.research.ResearchManager;
import java.util.List;
/**
* 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
*
* Created by HellFirePvP @ 30.10.2015 21:23
*/
public class ResearchHelper {
public static void distributeResearch(String research, World world, double x, double y, double z, double radius) {
List players = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(radius, radius, radius));
for(Object pl : players) {
EntityPlayer player = (EntityPlayer) pl;
if(!ResearchManager.isResearchComplete(player.getCommandSenderName(), research) && ResearchManager.doesPlayerHaveRequisites(player.getCommandSenderName(), research)) {
thaumcraft.common.lib.network.PacketHandler.INSTANCE.sendTo(new PacketResearchComplete(research), (EntityPlayerMP)player);
Thaumcraft.proxy.getResearchManager().completeResearch(player, research);
}
}
}
}