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
@@ -30,65 +30,69 @@ public class Decay extends Spell {
}
@Override
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers) {
RayTraceResult rayTrace = WizardryUtilities.rayTrace(12*modifiers.get(WizardryItems.range_upgrade), world, caster, false);
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers){
RayTraceResult rayTrace = WizardryUtilities.rayTrace(12 * modifiers.get(WizardryItems.range_upgrade), world,
caster, false);
if(rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK){
BlockPos pos = rayTrace.getBlockPos();
if(world.getBlockState(pos.up()).isNormalCube()) return false;
if(!world.isRemote){
world.spawnEntityInWorld(new EntityDecay(world, pos.getX()+0.5, pos.getY()+1, pos.getZ()+0.5, caster));
for(int i=0;i<5;i++){
world.spawnEntity(new EntityDecay(world, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, caster));
for(int i = 0; i < 5; i++){
BlockPos pos1 = WizardryUtilities.findNearbyFloorSpace(caster, 2, 6);
if(pos1 == null) break;
world.spawnEntityInWorld(new EntityDecay(world, pos1.getX()+0.5, pos1.getY(), pos1.getZ()+0.5, caster));
world.spawnEntity(
new EntityDecay(world, pos1.getX() + 0.5, pos1.getY(), pos1.getZ() + 0.5, caster));
}
}
WizardryUtilities.playSoundAtPlayer(caster, SoundEvents.ENTITY_WITHER_SHOOT, 1.0F, world.rand.nextFloat() * 0.2F + 1.0F);
WizardryUtilities.playSoundAtPlayer(caster, SoundEvents.ENTITY_WITHER_SHOOT, 1.0F,
world.rand.nextFloat() * 0.2F + 1.0F);
caster.swingArm(hand);
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){
int x = MathHelper.floor_double(target.posX);
int x = MathHelper.floor(target.posX);
int y = (int)(int)target.getEntityBoundingBox().minY;
int z = MathHelper.floor_double(target.posZ);
int z = MathHelper.floor(target.posZ);
if(world.getBlockState(new BlockPos(x, y, z)).isNormalCube()) return false;
if(!world.isRemote){
world.spawnEntityInWorld(new EntityDecay(world, x+0.5, y+1, z+0.5, caster));
for(int i=0;i<5;i++){
world.spawnEntity(new EntityDecay(world, x + 0.5, y + 1, z + 0.5, caster));
for(int i = 0; i < 5; i++){
BlockPos pos = WizardryUtilities.findNearbyFloorSpace(caster, 2, 6);
if(pos == null) break;
world.spawnEntityInWorld(new EntityDecay(world, pos.getX()+0.5, pos.getY(), pos.getZ()+0.5, caster));
world.spawnEntity(new EntityDecay(world, pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, caster));
}
}
caster.playSound(SoundEvents.ENTITY_WITHER_SHOOT, 1.0F, world.rand.nextFloat() * 0.2F + 1.0F);
caster.swingArm(hand);
return true;
}
return false;
}
@Override
public boolean canBeCastByNPCs(){
return true;