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
|
@ -134,6 +134,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundBoots");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,6 @@ public class InputRoutingFocus extends RoutingFocus
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_deactivated");
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InputRoutingFocus");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.routing;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusLogicModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -16,11 +18,29 @@ public class OutputRoutingFocus extends RoutingFocus
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_deactivated");
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocus");
|
||||
}
|
||||
|
||||
public boolean doesItemMatch(ItemStack keyStack, ItemStack checkedStack)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage)
|
||||
{
|
||||
switch(damage)
|
||||
{
|
||||
case 0:
|
||||
return this.itemIcon;
|
||||
}
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
public RoutingFocusLogic getLogic(int damage)
|
||||
{
|
||||
return keyStack != null ? checkedStack != null && keyStack.areItemStacksEqual(keyStack, checkedStack) : false;
|
||||
switch(damage)
|
||||
{
|
||||
case 0:
|
||||
return new RoutingFocusLogic();
|
||||
case 1:
|
||||
return new RoutingFocusLogicModItems();
|
||||
}
|
||||
return new RoutingFocusLogic();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusPosAndFacing;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
|
||||
public class RoutingFocus extends Item
|
||||
{
|
||||
|
@ -21,6 +23,11 @@ public class RoutingFocus extends Item
|
|||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
public RoutingFocusPosAndFacing getPosAndFacing(ItemStack itemStack)
|
||||
{
|
||||
return new RoutingFocusPosAndFacing(new Int3(this.xCoord(itemStack), this.yCoord(itemStack), this.zCoord(itemStack)), this.getSetDirection(itemStack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
|
@ -68,7 +75,7 @@ public class RoutingFocus extends Item
|
|||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("An Enderpearl imbued with blood");
|
||||
par3List.add(this.getFocusDescription());
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
|
@ -78,6 +85,11 @@ public class RoutingFocus extends Item
|
|||
par3List.add("Direction: " + this.getSetDirection(par1ItemStack));
|
||||
}
|
||||
}
|
||||
|
||||
public String getFocusDescription()
|
||||
{
|
||||
return "An Enderpearl imbued with blood";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
|
|
|
@ -197,7 +197,7 @@ public class ItemSigilOfTheAssassin extends EnergyItems implements ArmourUpgrade
|
|||
double d0 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * (double)f;
|
||||
double d1 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * (double)f + (double)(p_77621_1_.isRemote ? p_77621_2_.getEyeHeight() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences
|
||||
double d2 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * (double)f;
|
||||
Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2);
|
||||
Vec3 vec3 = SpellHelper.createVec3(d0, d1, d2);
|
||||
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI);
|
||||
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
|
||||
|
@ -215,15 +215,15 @@ public class ItemSigilOfTheAssassin extends EnergyItems implements ArmourUpgrade
|
|||
|
||||
// public MovingObjectPosition movingObjectPositiongdsa(WOrld worldObj, int posX, int posY, int posZ)
|
||||
// {
|
||||
// Vec3 var17 = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
// Vec3 var3 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
// Vec3 var17 = SpellHelper.createVec3(posX, posY, posZ);
|
||||
// Vec3 var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
// MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false);
|
||||
// var17 = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
// var3 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
// var17 = SpellHelper.createVec3(posX, posY, posZ);
|
||||
// var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
//
|
||||
// if (var4 != null)
|
||||
// {
|
||||
// var3 = Vec3.createVectorHelper(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord);
|
||||
// var3 = SpellHelper.createVec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord);
|
||||
// }
|
||||
//
|
||||
// Entity var5 = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue