mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-23 11:06:14 +01:00
Merge branch 'bleeding' of github.com:garbagemule/MobArena into bleeding
This commit is contained in:
commit
11714ad2ab
@ -1,7 +1,7 @@
|
||||
name: MobArena
|
||||
author: garbagemule
|
||||
main: com.garbagemule.MobArena.MobArena
|
||||
version: 0.96.6.1
|
||||
version: 0.96.6.3
|
||||
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
|
||||
commands:
|
||||
ma:
|
||||
|
@ -1041,7 +1041,8 @@ public class ArenaImpl implements Arena
|
||||
PlayerData mp = playerData.remove(p);
|
||||
|
||||
// Health must be handled in a certain way because of Heroes
|
||||
setHealth(p, mp.health());
|
||||
// Math.min to guard for ItemLoreStats weirdness
|
||||
setHealth(p, Math.min(p.getMaxHealth(), mp.health()));
|
||||
|
||||
// Put out fire.
|
||||
Delays.douse(plugin, p, 3);
|
||||
|
@ -776,20 +776,38 @@ public class ArenaListener
|
||||
|
||||
public void onPotionSplash(PotionSplashEvent event) {
|
||||
ThrownPotion potion = event.getPotion();
|
||||
if (!region.contains(potion.getLocation()) || pvpEnabled) {
|
||||
if (!region.contains(potion.getLocation())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If a potion has harmful effects, remove all players.
|
||||
for (PotionEffect effect : potion.getEffects()) {
|
||||
PotionEffectType type = effect.getType();
|
||||
if (type.equals(PotionEffectType.HARM) || type.equals(PotionEffectType.POISON)) {
|
||||
for (LivingEntity le : event.getAffectedEntities()) {
|
||||
if (le instanceof Player) {
|
||||
event.setIntensity(le, 0.0);
|
||||
if (potion.getShooter() instanceof Player) {
|
||||
// Check for PvP stuff if the shooter is a player
|
||||
if (!pvpEnabled) {
|
||||
// If a potion has harmful effects, remove all players.
|
||||
for (PotionEffect effect : potion.getEffects()) {
|
||||
PotionEffectType type = effect.getType();
|
||||
if (type.equals(PotionEffectType.HARM) || type.equals(PotionEffectType.POISON)) {
|
||||
for (LivingEntity le : event.getAffectedEntities()) {
|
||||
if (le instanceof Player) {
|
||||
event.setIntensity(le, 0.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (!monsterInfight) {
|
||||
// Otherwise, check for monster infighting
|
||||
for (PotionEffect effect : potion.getEffects()) {
|
||||
PotionEffectType type = effect.getType();
|
||||
if (type.equals(PotionEffectType.HARM) || type.equals(PotionEffectType.POISON)) {
|
||||
for (LivingEntity le : event.getAffectedEntities()) {
|
||||
if (!(le instanceof Player)) {
|
||||
event.setIntensity(le, 0.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user