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
@@ -24,10 +24,10 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class IceAge extends Spell {
private static final int baseDuration = 1200;
public IceAge() {
public IceAge(){
super(Tier.MASTER, 70, Element.ICE, "ice_age", SpellType.ATTACK, 250, EnumAction.BOW, false);
}
@@ -37,73 +37,90 @@ public class IceAge extends Spell {
}
@Override
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers) {
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(7*modifiers.get(WizardryItems.blast_upgrade), caster.posX, caster.posY, caster.posZ, world);
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers){
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(
7 * modifiers.get(WizardryItems.blast_upgrade), caster.posX, caster.posY, caster.posZ, world);
for(EntityLivingBase target : targets){
if(WizardryUtilities.isValidTarget(caster, target)){
if(!world.isRemote){
if(target instanceof EntityBlaze || target instanceof EntityMagmaCube){
// These have been removed for the time being because they cause the entity to sink into the floor when it breaks out.
//target.attackEntityFrom(WizardryUtilities.causePlayerMagicDamage(entityplayer), 8.0f * modifiers.get(SpellModifiers.DAMAGE));
// These have been removed for the time being because they cause the entity to sink into the
// floor when it breaks out.
// target.attackEntityFrom(WizardryUtilities.causePlayerMagicDamage(entityplayer), 8.0f *
// modifiers.get(SpellModifiers.DAMAGE));
}else{
//target.attackEntityFrom(WizardryUtilities.causePlayerMagicDamage(entityplayer), 4.0f * modifiers.get(SpellModifiers.DAMAGE));
// target.attackEntityFrom(WizardryUtilities.causePlayerMagicDamage(entityplayer), 4.0f *
// modifiers.get(SpellModifiers.DAMAGE));
}
if(target.isBurning()){
target.extinguish();
}
if(target instanceof EntityBlaze) caster.addStat(WizardryAchievements.freeze_blaze, 1);
if(target instanceof EntityLiving){
// Stops the entity looking red while frozen and the resulting z-fighting
target.hurtTime = 0;
BlockPos pos = new BlockPos(target);
// Short mobs such as spiders and pigs
if((target.height < 1.2 || target.isChild()) && WizardryUtilities.canBlockBeReplaced(world, pos)){
if((target.height < 1.2 || target.isChild())
&& WizardryUtilities.canBlockBeReplaced(world, pos)){
world.setBlockState(pos, WizardryBlocks.ice_statue.getDefaultState());
if(world.getTileEntity(pos) instanceof TileEntityStatue){
((TileEntityStatue)world.getTileEntity(pos)).setCreatureAndPart((EntityLiving) target, 1, 1);
((TileEntityStatue)world.getTileEntity(pos)).setLifetime((int)(baseDuration*modifiers.get(WizardryItems.duration_upgrade)));
((TileEntityStatue)world.getTileEntity(pos)).setCreatureAndPart((EntityLiving)target, 1,
1);
((TileEntityStatue)world.getTileEntity(pos)).setLifetime(
(int)(baseDuration * modifiers.get(WizardryItems.duration_upgrade)));
}
target.setDead();
target.playSound(WizardrySounds.SPELL_FREEZE, 1.0F, world.rand.nextFloat() * 0.4F + 0.8F);
}
// Normal sized mobs like zombies and skeletons
else if(target.height < 2.5 && WizardryUtilities.canBlockBeReplaced(world, pos) && WizardryUtilities.canBlockBeReplaced(world, pos.up())){
else if(target.height < 2.5 && WizardryUtilities.canBlockBeReplaced(world, pos)
&& WizardryUtilities.canBlockBeReplaced(world, pos.up())){
world.setBlockState(pos, WizardryBlocks.ice_statue.getDefaultState());
if(world.getTileEntity(pos) instanceof TileEntityStatue){
((TileEntityStatue)world.getTileEntity(pos)).setCreatureAndPart((EntityLiving) target, 1, 2);
((TileEntityStatue)world.getTileEntity(pos)).setLifetime((int)(baseDuration*modifiers.get(WizardryItems.duration_upgrade)));
((TileEntityStatue)world.getTileEntity(pos)).setCreatureAndPart((EntityLiving)target, 1,
2);
((TileEntityStatue)world.getTileEntity(pos)).setLifetime(
(int)(baseDuration * modifiers.get(WizardryItems.duration_upgrade)));
}
world.setBlockState(pos.up(), WizardryBlocks.ice_statue.getDefaultState());
if(world.getTileEntity(pos.up()) instanceof TileEntityStatue){
((TileEntityStatue)world.getTileEntity(pos.up())).setCreatureAndPart((EntityLiving) target, 2, 2);
((TileEntityStatue)world.getTileEntity(pos.up()))
.setCreatureAndPart((EntityLiving)target, 2, 2);
}
target.setDead();
target.playSound(WizardrySounds.SPELL_FREEZE, 1.0F, world.rand.nextFloat() * 0.4F + 0.8F);
}
// Tall mobs like endermen
else if(WizardryUtilities.canBlockBeReplaced(world, pos) && WizardryUtilities.canBlockBeReplaced(world, pos.up()) && WizardryUtilities.canBlockBeReplaced(world, pos.up(2))){
else if(WizardryUtilities.canBlockBeReplaced(world, pos)
&& WizardryUtilities.canBlockBeReplaced(world, pos.up())
&& WizardryUtilities.canBlockBeReplaced(world, pos.up(2))){
world.setBlockState(pos, WizardryBlocks.ice_statue.getDefaultState());
if(world.getTileEntity(pos) instanceof TileEntityStatue){
((TileEntityStatue)world.getTileEntity(pos)).setCreatureAndPart((EntityLiving) target, 1, 3);
((TileEntityStatue)world.getTileEntity(pos)).setLifetime((int)(baseDuration*modifiers.get(WizardryItems.duration_upgrade)));
((TileEntityStatue)world.getTileEntity(pos)).setCreatureAndPart((EntityLiving)target, 1,
3);
((TileEntityStatue)world.getTileEntity(pos)).setLifetime(
(int)(baseDuration * modifiers.get(WizardryItems.duration_upgrade)));
}
world.setBlockState(pos.up(), WizardryBlocks.ice_statue.getDefaultState());
if(world.getTileEntity(pos.up()) instanceof TileEntityStatue){
((TileEntityStatue)world.getTileEntity(pos.up())).setCreatureAndPart((EntityLiving) target, 2, 3);
((TileEntityStatue)world.getTileEntity(pos.up()))
.setCreatureAndPart((EntityLiving)target, 2, 3);
}
world.setBlockState(pos.up(2), WizardryBlocks.ice_statue.getDefaultState());
if(world.getTileEntity(pos.up(2)) instanceof TileEntityStatue){
((TileEntityStatue)world.getTileEntity(pos.up(2))).setCreatureAndPart((EntityLiving) target, 3, 3);
((TileEntityStatue)world.getTileEntity(pos.up(2)))
.setCreatureAndPart((EntityLiving)target, 3, 3);
}
target.setDead();
target.playSound(WizardrySounds.SPELL_FREEZE, 1.0F, world.rand.nextFloat() * 0.4F + 0.8F);
@@ -113,19 +130,19 @@ public class IceAge extends Spell {
}
}
if(!world.isRemote){
for(int i=-7; i<8; i++){
for(int j=-7; j<8; j++){
for(int i = -7; i < 8; i++){
for(int j = -7; j < 8; j++){
BlockPos pos = new BlockPos(caster).add(i, 0, j);
int y = WizardryUtilities.getNearestFloorLevelB(world, new BlockPos(pos), 7);
pos = new BlockPos(pos.getX(), y, pos.getZ());
double dist = caster.getDistance((int)caster.posX + i, y, (int)caster.posZ + j);
// Randomised with weighting so that the nearer the block the more likely it is to be snowed.
if(y != -1 && world.rand.nextInt((int)dist*2 + 1) < 7 && dist < 8){
if(y != -1 && world.rand.nextInt((int)dist * 2 + 1) < 7 && dist < 8){
if(world.getBlockState(pos.down()) == Blocks.WATER.getDefaultState()){
world.setBlockState(pos.down(), Blocks.ICE.getDefaultState());
}else if(world.getBlockState(pos.down()) == Blocks.LAVA.getDefaultState()){