Fixed Hunger message, plus potential glow bug fix.

This commit is contained in:
sigonasr2 2016-08-23 05:55:17 -05:00
parent 767c633093
commit 0c149c9b4a
4 changed files with 26 additions and 6 deletions

Binary file not shown.

View File

@ -716,9 +716,11 @@ public class CustomDamage {
//Convert from seconds to ticks. //Convert from seconds to ticks.
int tick_duration = (int)(duration*20); int tick_duration = (int)(duration*20);
//Apply iframes. //Apply iframes.
if (tick_duration>0) {
addIframe(tick_duration,(Player)target); addIframe(tick_duration,(Player)target);
} }
} }
}
private static boolean PassesIframeCheck(LivingEntity target, Entity damager) { private static boolean PassesIframeCheck(LivingEntity target, Entity damager) {
if ((target instanceof Player) && isInIframe((Player)target)) { if ((target instanceof Player) && isInIframe((Player)target)) {

View File

@ -185,8 +185,8 @@ public class Pronouns {
pronouns = new String[]{ pronouns = new String[]{
"starved.", "starved.",
"died of starvation.", "died of starvation.",
"starved to death. They should have ate that last piece "+Pronouns.ChoosePronoun(15), "starved to death. They should have ate that last piece "+Pronouns.ChooseRandomFood(0),
"thought they could live without eating that piece of "+Pronouns.ChoosePronoun(15), "thought they could live without eating that piece of "+Pronouns.ChooseRandomFood(0),
}; };
}break; }break;
case 15:{ case 15:{
@ -218,7 +218,26 @@ public class Pronouns {
}; };
} }
} }
return pronouns[(int)(Math.random()*pronouns.length)];
}
public static String ChooseRandomFood(int type) {
String[] pronouns = new String[]{
"beef",
"chicken",
"pork",
"rabbit",
"bread",
"beetroot",
"fish",
"cake",
"salmon",
"rotten flesh",
"potato",
"melon",
"pie",
};
return pronouns[(int)(Math.random()*pronouns.length)]; return pronouns[(int)(Math.random()*pronouns.length)];
} }
} }

View File

@ -644,12 +644,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
} }
if (Math.random()<=removechance/100) { if (Math.random()<=removechance/100) {
if (!type.equals(PotionEffectType.WEAKNESS) || level<9) { if (type!=null && (!type.equals(PotionEffectType.WEAKNESS) || level<9)) {
p.removePotionEffect(type); p.removePotionEffect(type);
p.sendMessage(ChatColor.DARK_GRAY+"You successfully resisted the application of "+ChatColor.WHITE+GenericFunctions.CapitalizeFirstLetters(type.getName().replace("_", " "))); p.sendMessage(ChatColor.DARK_GRAY+"You successfully resisted the application of "+ChatColor.WHITE+GenericFunctions.CapitalizeFirstLetters(type.getName().replace("_", " ")));
} }
} }
} }
pd.debuffcount=GenericFunctions.CountDebuffs(p); pd.debuffcount=GenericFunctions.CountDebuffs(p);