Added Item Routing ritual.
Added performance improvements to magnetism ritual!
This commit is contained in:
parent
2f0a1c9909
commit
1b4879ad64
25 changed files with 429 additions and 149 deletions
|
@ -0,0 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusLogicModItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.routing.OutputRoutingFocus;
|
||||
|
||||
public class OutputRoutingFocusModItems extends OutputRoutingFocus
|
||||
{
|
||||
@Override
|
||||
public String getFocusDescription()
|
||||
{
|
||||
return "Only accepts items that are the same modID";
|
||||
}
|
||||
|
||||
public RoutingFocusLogic getLogic()
|
||||
{
|
||||
return new RoutingFocusLogicModItems();
|
||||
}
|
||||
}
|
|
@ -53,9 +53,14 @@ public class SpellHelper
|
|||
|
||||
public static boolean canEntityBeSeen(Entity entity, Entity entity2)
|
||||
{
|
||||
return entity.worldObj.rayTraceBlocks(Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ), Vec3.createVectorHelper(entity2.posX, entity2.posY, entity2.posZ), false) == null;
|
||||
return entity.worldObj.rayTraceBlocks(SpellHelper.createVec3(entity.posX, entity.posY, entity.posZ), SpellHelper.createVec3(entity2.posX, entity2.posY, entity2.posZ), false) == null;
|
||||
}
|
||||
|
||||
public static Vec3 createVec3(double x, double y, double z)
|
||||
{
|
||||
return APISpellHelper.createVec3(x, y, z);
|
||||
}
|
||||
|
||||
public static void smeltBlockInWorld(World world, int posX, int posY, int posZ)
|
||||
{
|
||||
FurnaceRecipes recipes = FurnaceRecipes.smelting();
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class DigAreaTunnel extends DigAreaEffect
|
||||
{
|
||||
|
@ -42,9 +43,9 @@ public class DigAreaTunnel extends DigAreaEffect
|
|||
|
||||
double initialLength = this.getRandomVectorLength();
|
||||
|
||||
Vec3 initialVector = Vec3.createVectorHelper(opposite.offsetX * initialLength, opposite.offsetY * initialLength, opposite.offsetZ * initialLength);
|
||||
Vec3 initialVector = SpellHelper.createVec3(opposite.offsetX * initialLength, opposite.offsetY * initialLength, opposite.offsetZ * initialLength);
|
||||
|
||||
Vec3 lastVec = Vec3.createVectorHelper(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord);
|
||||
Vec3 lastVec = SpellHelper.createVec3(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord);
|
||||
vectorLine.add(initialVector);
|
||||
|
||||
double currentLength = lastVec.lengthVector();
|
||||
|
@ -151,10 +152,10 @@ public class DigAreaTunnel extends DigAreaEffect
|
|||
{
|
||||
double vecLength = vector.lengthVector();
|
||||
AlchemicalWizardry.logger.info(vecLength);
|
||||
Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord);
|
||||
Vec3 normVec = SpellHelper.createVec3(vector.xCoord, vector.yCoord, vector.zCoord);
|
||||
normVec = normVec.normalize();
|
||||
|
||||
Vec3 prevVec = Vec3.createVectorHelper(0, 0, 0);
|
||||
Vec3 prevVec = SpellHelper.createVec3(0, 0, 0);
|
||||
double distanceTravelled = 0;
|
||||
|
||||
while (distanceTravelled < vecLength)
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class RightClickTunnel extends RightClickEffect
|
||||
{
|
||||
|
@ -42,9 +43,9 @@ public class RightClickTunnel extends RightClickEffect
|
|||
|
||||
double initialLength = this.getRandomVectorLength();
|
||||
|
||||
Vec3 initialVector = Vec3.createVectorHelper(opposite.offsetX * initialLength, opposite.offsetY * initialLength, opposite.offsetZ * initialLength);
|
||||
Vec3 initialVector = SpellHelper.createVec3(opposite.offsetX * initialLength, opposite.offsetY * initialLength, opposite.offsetZ * initialLength);
|
||||
|
||||
Vec3 lastVec = Vec3.createVectorHelper(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord);
|
||||
Vec3 lastVec = SpellHelper.createVec3(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord);
|
||||
vectorLine.add(initialVector);
|
||||
|
||||
double currentLength = lastVec.lengthVector();
|
||||
|
@ -157,10 +158,10 @@ public class RightClickTunnel extends RightClickEffect
|
|||
{
|
||||
double vecLength = vector.lengthVector();
|
||||
|
||||
Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord);
|
||||
Vec3 normVec = SpellHelper.createVec3(vector.xCoord, vector.yCoord, vector.zCoord);
|
||||
normVec = normVec.normalize();
|
||||
|
||||
Vec3 prevVec = Vec3.createVectorHelper(0, 0, 0);
|
||||
Vec3 prevVec = SpellHelper.createVec3(0, 0, 0);
|
||||
double distanceTravelled = 0;
|
||||
|
||||
while (distanceTravelled < vecLength)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue