Remove emerald drops from Skeleton King minions and decrease the range EventCreatures can go from their spawn

This commit is contained in:
AlexTheCoder 2016-07-12 05:20:22 -04:00
parent d3270b9289
commit 3acca23e7e
4 changed files with 8 additions and 9 deletions

View File

@ -280,7 +280,7 @@ public abstract class EventCreature<T extends LivingEntity> implements Listener
spawnEntity();
}
if (UtilMath.offset2d(_entity.getLocation(), _spawnLocation) > 44)
if (UtilMath.offset2d(_entity.getLocation(), _spawnLocation) > 34)
{
_entity.setVelocity(UtilAlg.getTrajectory(_entity.getLocation(), _spawnLocation).normalize().multiply(2));
}

View File

@ -89,8 +89,6 @@ public class UndeadArcherCreature extends EventCreature<Skeleton>
}
getEntity().getWorld().dropItem(getEntity().getLocation(), new org.bukkit.inventory.ItemStack(Material.ARROW, UtilMath.r(12) + 1));
getEntity().getWorld().dropItem(getEntity().getLocation(), new ItemStack(Material.EMERALD, UtilMath.r(5) + 1));
}
@EventHandler(priority = EventPriority.MONITOR)

View File

@ -17,8 +17,8 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
@ -71,8 +71,6 @@ public class UndeadWarriorCreature extends EventCreature<Zombie>
if (Math.random() > 0.97)
getEntity().getWorld().dropItem(getEntity().getLocation(), new ItemStack(Material.IRON_BOOTS));
getEntity().getWorld().dropItem(getEntity().getLocation(), new ItemStack(Material.EMERALD, UtilMath.r(5) + 1));
}
@EventHandler

View File

@ -77,8 +77,6 @@ public class WraithCreature extends EventCreature<Zombie>
if (Math.random() > 0.97)
getEntity().getWorld().dropItem(getEntity().getLocation(), new ItemStack(Material.DIAMOND_BOOTS));
getEntity().getWorld().dropItem(getEntity().getLocation(), new ItemStack(Material.EMERALD, UtilMath.r(10) + 1));
}
@EventHandler(priority = EventPriority.HIGH)
@ -136,9 +134,14 @@ public class WraithCreature extends EventCreature<Zombie>
if (dist <= 10 || dist > 25)
return;
Location teleport = zombie.getTarget().getLocation().add(Math.random() + 1, 0, Math.random() + 1);
if (UtilMath.offset(getSpawnLocation(), teleport) > 34)
{
return;
}
UtilParticle.PlayParticleToAll(ParticleType.SMOKE, zombie.getLocation(), 0, 0, 0, 0, 5, ViewDist.MAX);
zombie.getWorld().playSound(zombie.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 2f);
zombie.teleport(zombie.getTarget().getLocation().add(Math.random() + 1, 0, Math.random() + 1));
zombie.teleport(teleport);
UtilParticle.PlayParticleToAll(ParticleType.SMOKE, zombie.getLocation(), 0, 0, 0, 0, 5, ViewDist.MAX);
zombie.getWorld().playSound(zombie.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 2f);
}