Moved more spell stuff, created localized APISpellHelper, created RitualActivatedEvent
This commit is contained in:
parent
8c1396421a
commit
f39db196ca
30 changed files with 284 additions and 121 deletions
|
@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
|||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -364,56 +365,17 @@ public class SpellHelper
|
|||
|
||||
public static List<ItemStack> getItemsFromBlock(World world, Block block, int x, int y, int z, int meta, boolean silkTouch, int fortune)
|
||||
{
|
||||
boolean canSilk = block.canSilkHarvest(world, null, x, y, z, meta);
|
||||
|
||||
if (canSilk && silkTouch)
|
||||
{
|
||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
ItemStack item = new ItemStack(block, 1, meta);
|
||||
|
||||
items.add(item);
|
||||
|
||||
return items;
|
||||
} else
|
||||
{
|
||||
return block.getDrops(world, x, y, z, meta, fortune);
|
||||
}
|
||||
return APISpellHelper.getItemsFromBlock(world, block, x, y, z, meta, silkTouch, fortune);
|
||||
}
|
||||
|
||||
public static void spawnItemListInWorld(List<ItemStack> items, World world, float x, float y, float z)
|
||||
{
|
||||
for (ItemStack stack : items)
|
||||
{
|
||||
EntityItem itemEntity = new EntityItem(world, x, y, z, stack);
|
||||
itemEntity.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(itemEntity);
|
||||
}
|
||||
APISpellHelper.spawnItemListInWorld(items, world, x, y, z);
|
||||
}
|
||||
|
||||
public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range)
|
||||
{
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f;
|
||||
float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f;
|
||||
if (!world.isRemote && player instanceof EntityPlayer)
|
||||
d1 += 1.62D;
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f;
|
||||
Vec3 vec3 = Vec3.createVectorHelper(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);
|
||||
float f6 = MathHelper.sin(-f1 * 0.017453292F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = range;
|
||||
if (player instanceof EntityPlayerMP)
|
||||
{
|
||||
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
|
||||
}
|
||||
Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||
return world.func_147447_a(vec3, vec31, par3, !par3, par3);
|
||||
return APISpellHelper.raytraceFromEntity(world, player, par3, range);
|
||||
}
|
||||
|
||||
public static String getNumeralForInt(int num)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.DigAreaEffect;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.api.spell.IDigAreaEffect;
|
||||
import WayofTime.alchemicalWizardry.api.spell.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IDigAreaEffect
|
||||
{
|
||||
public abstract int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool);
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IItemManipulator
|
||||
{
|
||||
public List<ItemStack> handleItemsOnBlockBroken(ItemStack toolStack, List<ItemStack> itemList);
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ILeftClickEffect
|
||||
{
|
||||
public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder);
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IOnBanishTool
|
||||
{
|
||||
public abstract int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IOnBreakBlock
|
||||
{
|
||||
public abstract int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken);
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IOnSummonTool
|
||||
{
|
||||
public abstract int onSummonTool(ItemStack toolStack, World world, Entity entity);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IRightClickEffect
|
||||
{
|
||||
//public abstract int onRightClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder);
|
||||
|
||||
public abstract int onRightClickBlock(ItemStack stack, EntityLivingBase weilder, World world, MovingObjectPosition mop);
|
||||
|
||||
public abstract int onRightClickAir(ItemStack stack, EntityLivingBase weilder);
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface ISpecialDamageEffect
|
||||
{
|
||||
public float getDamageForEntity(Entity entity);
|
||||
|
||||
public String getKey();
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IToolUpdateEffect
|
||||
{
|
||||
public abstract int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand);
|
||||
}
|
|
@ -4,6 +4,8 @@ import net.minecraft.item.ItemStack;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.spell.IItemManipulator;
|
||||
|
||||
public abstract class ItemManipulator implements IItemManipulator
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.spell.ILeftClickEffect;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.spell.IOnBreakBlock;
|
||||
|
||||
public abstract class OnBreakBlockEffect implements IOnBreakBlock
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.spell.IRightClickEffect;
|
||||
|
||||
public abstract class RightClickEffect implements IRightClickEffect
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.spell.IOnSummonTool;
|
||||
|
||||
public abstract class SummonToolEffect implements IOnSummonTool
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue