Initial 1.11.2 update

This commit is contained in:
Electroblob
2018-02-07 21:15:50 +00:00
parent 67f6be0671
commit 3df5597dcc
368 changed files with 17234 additions and 15082 deletions
@@ -20,77 +20,90 @@ import net.minecraft.world.World;
public class Whirlwind extends Spell {
public Whirlwind() {
public Whirlwind(){
super(Tier.APPRENTICE, 10, Element.EARTH, "whirlwind", SpellType.DEFENCE, 15, EnumAction.NONE, false);
}
@Override
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers) {
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers){
RayTraceResult rayTrace = WizardryUtilities.standardEntityRayTrace(world, caster, 10*modifiers.get(WizardryItems.range_upgrade));
RayTraceResult rayTrace = WizardryUtilities.standardEntityRayTrace(world, caster,
10 * modifiers.get(WizardryItems.range_upgrade));
if(rayTrace != null && rayTrace.entityHit instanceof EntityLivingBase){
EntityLivingBase target = (EntityLivingBase) rayTrace.entityHit;
EntityLivingBase target = (EntityLivingBase)rayTrace.entityHit;
if(!world.isRemote){
target.motionX = caster.getLookVec().xCoord * 2;
target.motionY = caster.getLookVec().yCoord * 2 + 1;
target.motionZ = caster.getLookVec().zCoord * 2;
// Player motion is handled on that player's client so needs packets
if(target instanceof EntityPlayerMP){
((EntityPlayerMP)target).connection.sendPacket(new SPacketEntityVelocity(target));
}
}
if(world.isRemote){
for(int i=0; i<10; i++){
double x2 = (double)(caster.posX + world.rand.nextFloat() - 0.5F + caster.getLookVec().xCoord*caster.getDistanceToEntity(target)*0.5);
double y2 = (double)(WizardryUtilities.getPlayerEyesPos(caster) + world.rand.nextFloat() - 0.5F + caster.getLookVec().yCoord*caster.getDistanceToEntity(target)*0.5);
double z2 = (double)(caster.posZ + world.rand.nextFloat() - 0.5F + caster.getLookVec().zCoord*caster.getDistanceToEntity(target)*0.5);
world.spawnParticle(EnumParticleTypes.CLOUD, x2, y2, z2, caster.getLookVec().xCoord, caster.getLookVec().yCoord, caster.getLookVec().zCoord);
//Minecraft.getMinecraft().effectRenderer.addEffect(new EntitySparkleFX(world, x2, y2, z2, entityplayer.getLookVec().xCoord, entityplayer.getLookVec().yCoord, entityplayer.getLookVec().zCoord, null, 1.0f, 1.0f, 0.8f, 10));
for(int i = 0; i < 10; i++){
double x2 = (double)(caster.posX + world.rand.nextFloat() - 0.5F
+ caster.getLookVec().xCoord * caster.getDistanceToEntity(target) * 0.5);
double y2 = (double)(WizardryUtilities.getPlayerEyesPos(caster) + world.rand.nextFloat() - 0.5F
+ caster.getLookVec().yCoord * caster.getDistanceToEntity(target) * 0.5);
double z2 = (double)(caster.posZ + world.rand.nextFloat() - 0.5F
+ caster.getLookVec().zCoord * caster.getDistanceToEntity(target) * 0.5);
world.spawnParticle(EnumParticleTypes.CLOUD, x2, y2, z2, caster.getLookVec().xCoord,
caster.getLookVec().yCoord, caster.getLookVec().zCoord);
// Minecraft.getMinecraft().effectRenderer.addEffect(new EntitySparkleFX(world, x2, y2, z2,
// entityplayer.getLookVec().xCoord, entityplayer.getLookVec().yCoord,
// entityplayer.getLookVec().zCoord, null, 1.0f, 1.0f, 0.8f, 10));
}
}
caster.swingArm(hand);
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_ICE, 0.8F, world.rand.nextFloat() * 0.2F + 0.6F);
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_ICE, 0.8F,
world.rand.nextFloat() * 0.2F + 0.6F);
return true;
}
return false;
}
@Override
public boolean cast(World world, EntityLiving caster, EnumHand hand, int ticksInUse, EntityLivingBase target, SpellModifiers modifiers){
public boolean cast(World world, EntityLiving caster, EnumHand hand, int ticksInUse, EntityLivingBase target,
SpellModifiers modifiers){
if(target != null){
if(!world.isRemote){
target.motionX = caster.getLookVec().xCoord * 2;
target.motionY = caster.getLookVec().yCoord * 2 + 1;
target.motionZ = caster.getLookVec().zCoord * 2;
// Player motion is handled on that player's client so needs packets
if(target instanceof EntityPlayerMP){
((EntityPlayerMP)target).connection.sendPacket(new SPacketEntityVelocity(target));
}
}
if(world.isRemote){
for(int i=0; i<10; i++){
double x2 = (double)(caster.posX + world.rand.nextFloat() - 0.5F + caster.getLookVec().xCoord*caster.getDistanceToEntity(target)*0.5);
double y2 = (double)(caster.posY + caster.getEyeHeight() + world.rand.nextFloat() - 0.5F + caster.getLookVec().yCoord*caster.getDistanceToEntity(target)*0.5);
double z2 = (double)(caster.posZ + world.rand.nextFloat() - 0.5F + caster.getLookVec().zCoord*caster.getDistanceToEntity(target)*0.5);
world.spawnParticle(EnumParticleTypes.CLOUD, x2, y2, z2, caster.getLookVec().xCoord, caster.getLookVec().yCoord, caster.getLookVec().zCoord);
for(int i = 0; i < 10; i++){
double x2 = (double)(caster.posX + world.rand.nextFloat() - 0.5F
+ caster.getLookVec().xCoord * caster.getDistanceToEntity(target) * 0.5);
double y2 = (double)(caster.posY + caster.getEyeHeight() + world.rand.nextFloat() - 0.5F
+ caster.getLookVec().yCoord * caster.getDistanceToEntity(target) * 0.5);
double z2 = (double)(caster.posZ + world.rand.nextFloat() - 0.5F
+ caster.getLookVec().zCoord * caster.getDistanceToEntity(target) * 0.5);
world.spawnParticle(EnumParticleTypes.CLOUD, x2, y2, z2, caster.getLookVec().xCoord,
caster.getLookVec().yCoord, caster.getLookVec().zCoord);
}
}
caster.swingArm(hand);
caster.playSound(WizardrySounds.SPELL_ICE, 0.8F, world.rand.nextFloat() * 0.2F + 0.6F);
return true;
}
return false;
}
@Override
public boolean canBeCastByNPCs(){
return true;