r270. Fixed a few bugs. Not ready for release. Unknown max health bug.

anvil_rework
sigonasr2 11 years ago
parent 1382c3d4dc
commit 84e20c4f3f
  1. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$1.class
  2. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$2.class
  3. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$3.class
  4. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$4.class
  5. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main.class
  6. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class
  7. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class
  8. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class
  9. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class
  10. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class
  11. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class
  12. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class
  13. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class
  14. 7
      BankEconomyMod/src/me/kaZep/Base/Main.java
  15. 48
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
  16. 36
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -1116,6 +1116,7 @@ public void runTick() {
enderdragon.setRemoveWhenFarAway(false);
//enderdragon.teleport(new Location(p.getWorld(),p.getLocation().getBlockX()+i,-250,p.getLocation().getBlockZ()+j));
//p.sendMessage(ChatColor.DARK_PURPLE+"You feel a dark presence nearby.");
Bukkit.getPlayer("sigonasr2").sendMessage("Trigger this.");
zombie.setRemoveWhenFarAway(false);
zombie.setMaxHealth(300);
zombie.setHealth(300);
@ -1505,7 +1506,7 @@ public void runTick() {
//l.setCustomNameVisible(true);
l.setMaxHealth(l.getMaxHealth()+20);
}
l.setHealth(l.getMaxHealth()*0.95d);
l.setHealth(l.getMaxHealth());
} else {
if (Math.random()<=0.10+((heightmodifier-l.getLocation().getY())*0.01d)) {
if (Math.random()<=0.25) {
@ -1521,8 +1522,8 @@ public void runTick() {
l.getEquipment().setHelmet(new ItemStack(Material.AIR));
Zombie g = (Zombie)l;
g.setBaby(true);
//l.setMaxHealth(l.getMaxHealth()+20);
l.setHealth(l.getMaxHealth()*0.65d);
l.setMaxHealth(l.getMaxHealth()*0.65d);
l.setHealth(l.getMaxHealth());
}
}
}

@ -1912,6 +1912,8 @@ public class PlayerListener
boolean despawn=true;
if (entity instanceof Monster) {
LivingEntity test = (LivingEntity)entity;
test.setMaxHealth(10);
test.setHealth(test.getMaxHealth());
boolean block=false;
if (test.getCustomName()!=null && (test.getCustomName().contains(ChatColor.DARK_PURPLE+"") || test.getCustomName().contains(ChatColor.DARK_AQUA+"Polymorphed Creature"))) {
for (int i=-2;i<3;i++) {
@ -2753,7 +2755,7 @@ public class PlayerListener
//Wear diamond armor almost always. Enchanted diamond pieces here and there.
if (entity.getType()==EntityType.SKELETON || entity.getType()==EntityType.ZOMBIE) {
LivingEntity l = (LivingEntity) entity;
l.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST,999999,1));
//l.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST,999999,1));
l.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,999999,1));
l.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,999999,0));
l.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE,999999,0));
@ -6343,14 +6345,22 @@ public ItemStack getGoodie() {
if (m.getType()!=EntityType.ENDER_DRAGON && m.getType()!=EntityType.WITHER) {
if (m.getCustomName()==null) {
if (m.getMaxHealth()>65) {
Bukkit.broadcastMessage("This mob had too much HP. HP: "+m.getMaxHealth());
m.setMaxHealth(65); //65 HP cap.
m.setHealth(m.getMaxHealth());
m.setHealth(65);
m.setCustomName("Super Mob");
m.setCustomNameVisible(true);
Bukkit.broadcastMessage("This mob had too much HP. Lowered to "+m.getHealth()+"/"+m.getMaxHealth());
}
} else {
if (!m.getCustomName().contains(ChatColor.DARK_PURPLE+"")) { //Make sure it's not a boss.
if (m.getMaxHealth()>65) {
Bukkit.broadcastMessage("This mob had too much HP. HP: "+m.getMaxHealth());
m.setMaxHealth(65); //65 HP cap.
m.setHealth(m.getMaxHealth());
m.setHealth(65);
m.setCustomName("Super Mob");
m.setCustomNameVisible(true);
Bukkit.broadcastMessage("This mob had too much HP. Lowered to "+m.getHealth()+"/"+m.getMaxHealth());
}
}
}
@ -6363,14 +6373,22 @@ public ItemStack getGoodie() {
if (m.getType()!=EntityType.ENDER_DRAGON && m.getType()!=EntityType.WITHER) {
if (m.getCustomName()==null) {
if (m.getMaxHealth()>65) {
Bukkit.broadcastMessage("This mob had too much HP. HP: "+m.getMaxHealth());
m.setMaxHealth(65); //65 HP cap.
m.setHealth(m.getMaxHealth());
//m.setHealth(65);
m.setCustomName("Super Mob");
m.setCustomNameVisible(true);
Bukkit.broadcastMessage("This mob had too much HP. Lowered to "+m.getHealth()+"/"+m.getMaxHealth());
}
} else {
if (!m.getCustomName().contains(ChatColor.DARK_PURPLE+"")) { //Make sure it's not a boss.
if (m.getMaxHealth()>65) {
Bukkit.broadcastMessage("This mob had too much HP. HP: "+m.getMaxHealth());
m.setMaxHealth(65); //65 HP cap.
m.setHealth(m.getMaxHealth());
m.setHealth(65);
m.setCustomName("Super Mob");
m.setCustomNameVisible(true);
Bukkit.broadcastMessage("This mob had too much HP. Lowered to "+m.getHealth()+"/"+m.getMaxHealth());
}
}
}
@ -6378,6 +6396,7 @@ public ItemStack getGoodie() {
}
final LivingEntity l = (LivingEntity)e.getEntity();
if (l.getCustomName()!=null && l.getCustomName().contains(ChatColor.DARK_PURPLE+"")) {
Bukkit.getPlayer("sigonasr2").sendMessage("Entered Boss Entity hit loop.");
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
public void run() {
@ -10631,25 +10650,6 @@ public void onEntityExpode(ExplosionPrimeEvent e) {
}
}
}
List<Entity> nearby = p.getNearbyEntities(30, 30, 30);
for (int i=0;i<nearby.size();i++) {
if (nearby.get(i).getType()==EntityType.ZOMBIE ||
nearby.get(i).getType()==EntityType.SPIDER ||
nearby.get(i).getType()==EntityType.SKELETON ||
nearby.get(i).getType()==EntityType.CREEPER ||
nearby.get(i).getType()==EntityType.PIG_ZOMBIE ||
nearby.get(i).getType()==EntityType.ENDERMAN ||
nearby.get(i).getType()==EntityType.GHAST ||
nearby.get(i).getType()==EntityType.MAGMA_CUBE) {
LivingEntity l = (LivingEntity)nearby.get(i);
if (l.getCustomName()!=null && l.getCustomName().contains(ChatColor.DARK_PURPLE+"")) {
} else {
nearby.get(i).remove();
}
//Delete it from existence.
}
}
if (!this.plugin.PlayerinJob(p, "Explorer") || (this.plugin.PlayerinJob(p, "Explorer") && this.plugin.getJobLv("Explorer", p)<20)) {
double balance = Main.economy.getBalance(p.getName());
double lose = this.plugin.getConfig().getDouble("losemoney.LoseAmount");

@ -24,6 +24,9 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
@ -1462,6 +1465,18 @@ public String convertToItemName(String val) {
teleportloc.setWorld(Bukkit.getWorld(deathWorld));
//p.sendMessage("Got 6.");
p.teleport(teleportloc);
List<Entity> nearby = p.getNearbyEntities(30, 30, 30);
for (int i=0;i<nearby.size();i++) {
if (nearby.get(i) instanceof Monster) {
LivingEntity l = (LivingEntity)nearby.get(i);
if (l.getCustomName()!=null && l.getCustomName().contains(ChatColor.DARK_PURPLE+"") && l.getCustomName().contains(ChatColor.DARK_AQUA+"")) {
} else {
nearby.get(i).remove();
}
//Delete it from existence.
}
}
//p.sendMessage("Got 7.");
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" decided to revive to their death location.");
} else {
@ -1503,6 +1518,12 @@ public String convertToItemName(String val) {
if (target == null) {
p.sendMessage(this.prefix + " " + this.offlinePlayer);
} else {
boolean is_in_vehicle = false;
Entity vehicle = null;
if (p.isInsideVehicle()) {
is_in_vehicle=true;
vehicle = p.getVehicle();
}
if (target.getName() == this.plugin.getAccountsConfig().getString(p.getName() + ".teleplayer")) {
//Determine distance of player to other player.
double otherx = target.getLocation().getX();
@ -1523,7 +1544,20 @@ public String convertToItemName(String val) {
}
p.sendMessage("Teleported to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost));
target.sendMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" teleported to your location.");
p.teleport(target);
if (is_in_vehicle) {
vehicle.eject();
p.eject();
final Player p2 = p;
final Player target2 = target;
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
public void run() {
p2.teleport(target2);
}
},5);
} else {
p.teleport(target);
}
} else {
p.sendMessage("You need $"+ChatColor.YELLOW+df.format(finalcost)+" in the bank to teleport to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+"!");
}

Loading…
Cancel
Save