diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 7037e12..19f83b3 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 0efbad3..e192181 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.7.3c +version: 3.7.3cr1 commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index d8d5402..c85cf85 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -2802,20 +2802,62 @@ public class GenericFunctions { entity.damage(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER,damager); //Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,entity,DamageCause.CUSTOM,dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER)); } else { - //Use old system if we cannot get a valid damager. - if (entity.getHealth()>dmg && entity instanceof Player) { - if (!AttemptRevive((Player)entity,dmg)) { - entity.setHealth(((Player)entity).getHealth()-dmg); - aPlugin.API.sendEntityHurtAnimation((Player)entity); + if (entity instanceof Player) { + double dodgechance = NewCombat.CalculateDodgeChance((Player)entity); + Player p = (Player)entity; + if (!p.hasPotionEffect(PotionEffectType.GLOWING)) { + if (Math.random()<=dodgechance) { + p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f); + for (int i=0;idmg && entity instanceof Player) { + if (!AttemptRevive((Player)entity,dmg)) { + entity.setHealth(((Player)entity).getHealth()-dmg); + aPlugin.API.sendEntityHurtAnimation((Player)entity); + } + } + + else { + //List drops = new ArrayList(); + //EntityDeathEvent ev = new EntityDeathEvent(entity,drops); + //Bukkit.getPluginManager().callEvent(ev); + //entity.setHealth(0); + if (entity instanceof Player && !AttemptRevive((Player)entity,Integer.MAX_VALUE)) { + entity.damage(Integer.MAX_VALUE); + } + } + } } } else { - //List drops = new ArrayList(); - //EntityDeathEvent ev = new EntityDeathEvent(entity,drops); - //Bukkit.getPluginManager().callEvent(ev); - //entity.setHealth(0); - if (entity instanceof Player && !AttemptRevive((Player)entity,Integer.MAX_VALUE)) { - entity.damage(Integer.MAX_VALUE); - } + if (entity.getHealth()>dmg && entity instanceof Player) { + if (!AttemptRevive((Player)entity,dmg)) { + entity.setHealth(((Player)entity).getHealth()-dmg); + aPlugin.API.sendEntityHurtAnimation((Player)entity); + } + } + + else { + //List drops = new ArrayList(); + //EntityDeathEvent ev = new EntityDeathEvent(entity,drops); + //Bukkit.getPluginManager().callEvent(ev); + //entity.setHealth(0); + if (entity instanceof Player && !AttemptRevive((Player)entity,Integer.MAX_VALUE)) { + entity.damage(Integer.MAX_VALUE); + } + } } } } @@ -2973,8 +3015,9 @@ public class GenericFunctions { p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,20,0)); } + @Deprecated public static void DealExplosionDamageToEntities(Location l, double basedmg, double range) { - List nearbyentities = new ArrayList(); + /*List nearbyentities = new ArrayList(); nearbyentities.addAll(l.getWorld().getNearbyEntities(l, range, range, range)); for (int i=0;i