Update API. Minor bugfixes.

This commit is contained in:
sigonasr2 2016-08-14 15:18:01 -05:00
parent 8e083867e8
commit 8005448cb8
3 changed files with 15 additions and 8 deletions

Binary file not shown.

View File

@ -123,6 +123,7 @@ public class EliteMonster {
TwosideKeeper.log("I aim at "+m.getTarget()+"!!", 2); TwosideKeeper.log("I aim at "+m.getTarget()+"!!", 2);
if (last_ignoretarget_time+IGNORE_TARGET_DURATION<TwosideKeeper.getServerTickTime()) { if (last_ignoretarget_time+IGNORE_TARGET_DURATION<TwosideKeeper.getServerTickTime()) {
my_only_target=null; my_only_target=null;
m.setTarget(ChooseRandomTarget());
} }
} }
} }
@ -312,7 +313,7 @@ public class EliteMonster {
Player p = ChooseRandomTarget(); Player p = ChooseRandomTarget();
//p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31)); //p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31));
p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,20*5,-1)); p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,20*5,-1));
p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7)); p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,20*1,7));
m.setTarget(p); m.setTarget(p);
p.setFlying(false); p.setFlying(false);
p.setVelocity(new Vector(0,-1,0)); p.setVelocity(new Vector(0,-1,0));
@ -389,7 +390,7 @@ public class EliteMonster {
public void run() { public void run() {
m.teleport(l.getLocation().add(Math.random(),Math.random(),Math.random())); m.teleport(l.getLocation().add(Math.random(),Math.random(),Math.random()));
l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,20*5,7)); l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,20*5,7));
l.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7)); l.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,20*1,7));
chasing=false; chasing=false;
} }
},20*2); },20*2);
@ -614,7 +615,7 @@ public class EliteMonster {
private Player ChooseRandomTarget() { private Player ChooseRandomTarget() {
if (targetlist.size()>0) { if (targetlist.size()>0) {
Player p = targetlist.get((int)(Math.random() * targetlist.size())); Player p = targetlist.get((int)(Math.random() * targetlist.size()));
p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7)); p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,20*1,7));
m.setTarget(p); m.setTarget(p);
return p; return p;
} else { } else {

View File

@ -140,8 +140,12 @@ public class GenericFunctions {
return new ItemStack(Material.AIR); return new ItemStack(Material.AIR);
} }
} }
public static ItemStack addHardenedItemBreaks(ItemStack item, int breaks) { public static ItemStack addHardenedItemBreaks(ItemStack item, int breaks) {
return addHardenedItemBreaks(item,breaks,false);
}
public static ItemStack addHardenedItemBreaks(ItemStack item, int breaks, boolean addname) {
if (isHardenedItem(item)) { if (isHardenedItem(item)) {
//We can just modify the amount of breaks. //We can just modify the amount of breaks.
return modifyBreaks(item, getHardenedItemBreaks(item)+breaks,false); return modifyBreaks(item, getHardenedItemBreaks(item)+breaks,false);
@ -164,10 +168,12 @@ public class GenericFunctions {
} }
lore.add(ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+breaks); lore.add(ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+breaks);
m.setLore(lore); m.setLore(lore);
if (m.hasDisplayName()) { if (addname) {
m.setDisplayName(ChatColor.BLUE+"Hardened "+m.getDisplayName()); if (m.hasDisplayName()) {
} else { m.setDisplayName(ChatColor.BLUE+"Hardened "+m.getDisplayName());
m.setDisplayName(ChatColor.BLUE+"Hardened "+UserFriendlyMaterialName(item)); } else {
m.setDisplayName(ChatColor.BLUE+"Hardened "+UserFriendlyMaterialName(item));
}
} }
item.setItemMeta(m); item.setItemMeta(m);
return item; return item;