That's one heck of a commit you've got there...
I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
@@ -1,38 +1,36 @@
|
||||
package electroblob.wizardry.spell;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.constants.SpellType;
|
||||
import electroblob.wizardry.constants.Tier;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.SpellModifiers;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class Telekinesis extends SpellRay {
|
||||
|
||||
public Telekinesis(){
|
||||
super("telekinesis", Tier.BASIC, Element.SORCERY, SpellType.UTILITY, 5, 5, false, 8, WizardrySounds.SPELL_CONJURATION);
|
||||
super("telekinesis", false, EnumAction.NONE);
|
||||
}
|
||||
|
||||
@Override public boolean doesSpellRequirePacket(){ return false; }
|
||||
@Override public boolean requiresPacket(){ return false; }
|
||||
|
||||
@Override
|
||||
protected boolean onEntityHit(World world, Entity target, EntityLivingBase caster, int ticksInUse, SpellModifiers modifiers){
|
||||
protected boolean onEntityHit(World world, Entity target, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){
|
||||
|
||||
if(target instanceof EntityItem){
|
||||
|
||||
target.motionX = (caster.posX - target.posX) / 6;
|
||||
target.motionY = (caster.posY + caster.getEyeHeight() - target.posY) / 6;
|
||||
target.motionZ = (caster.posZ - target.posZ) / 6;
|
||||
target.motionX = (origin.x - target.posX) / 6;
|
||||
target.motionY = (origin.y - target.posY) / 6;
|
||||
target.motionZ = (origin.z - target.posZ) / 6;
|
||||
return true;
|
||||
|
||||
}else if(target instanceof EntityPlayer && (Wizardry.settings.telekineticDisarmament || !(caster instanceof EntityPlayer))){
|
||||
@@ -46,8 +44,8 @@ public class Telekinesis extends SpellRay {
|
||||
if(!world.isRemote){
|
||||
EntityItem item = player.entityDropItem(player.getHeldItemMainhand(), 0);
|
||||
// Makes the item move towards the caster
|
||||
item.motionX = (caster.posX - player.posX) / 20;
|
||||
item.motionZ = (caster.posZ - player.posZ) / 20;
|
||||
item.motionX = (origin.x - player.posX) / 20;
|
||||
item.motionZ = (origin.z - player.posZ) / 20;
|
||||
}
|
||||
|
||||
player.setHeldItem(EnumHand.MAIN_HAND, ItemStack.EMPTY);
|
||||
@@ -60,7 +58,7 @@ public class Telekinesis extends SpellRay {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onBlockHit(World world, BlockPos pos, EnumFacing side, EntityLivingBase caster, int ticksInUse, SpellModifiers modifiers){
|
||||
protected boolean onBlockHit(World world, BlockPos pos, EnumFacing side, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){
|
||||
|
||||
if(caster instanceof EntityPlayer){
|
||||
|
||||
@@ -76,7 +74,7 @@ public class Telekinesis extends SpellRay {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onMiss(World world, EntityLivingBase caster, int ticksInUse, SpellModifiers modifiers){
|
||||
protected boolean onMiss(World world, EntityLivingBase caster, Vec3d origin, Vec3d direction, int ticksInUse, SpellModifiers modifiers){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user