Browse Source

2.1.23 - Read the changelog, configs need to be updated.

nossr50 6 years ago
parent
commit
363ea66335

+ 3 - 3
Changelog.txt

@@ -8,18 +8,18 @@ Key:
   - Removal
   - Removal
 
 
 Version 2.1.23
 Version 2.1.23
-    Fixed a 7 year old bug where damage in mcMMO from Skills was getting reduced by damage reduction TWICE
-    Fixed a bug with Double Drops for Mining
+    Fixed a bug with Double Drops for Mining (Update your configs instructions below)
+    Fixed a 7 year old bug where damage in mcMMO from Skills was potentially getting reduced by damage reduction TWICE
     Fixed a bug where killing entities with Rupture would not properly credit you as the killer
     Fixed a bug where killing entities with Rupture would not properly credit you as the killer
     Fixed a bug where Serrated Strikes was applying Rupture twice
     Fixed a bug where Serrated Strikes was applying Rupture twice
     Players will now be ejected from Minecarts if they cast their fishing rod (anti-afk)
     Players will now be ejected from Minecarts if they cast their fishing rod (anti-afk)
+    Many nerfs to Rupture, its now much more reasonable and not very useful against Protection IV opponents
     Rupture's strength is now related to your equipped Sword
     Rupture's strength is now related to your equipped Sword
     Rupture will no longer be applied if the target is blocking, this doesn't prevent existing bleed damage from occurring though.
     Rupture will no longer be applied if the target is blocking, this doesn't prevent existing bleed damage from occurring though.
     Wolf's Rupture has strength equivalent to a Stone Sword
     Wolf's Rupture has strength equivalent to a Stone Sword
     Only Diamond swords will have bonus rupture damage at Rank 4
     Only Diamond swords will have bonus rupture damage at Rank 4
     Rupture damage is cut in half for weapons below Diamond in quality, if the weapon is wooden, the damage is cut in half again.
     Rupture damage is cut in half for weapons below Diamond in quality, if the weapon is wooden, the damage is cut in half again.
     Swords below Diamond quality will have their tick duration drastically reduced
     Swords below Diamond quality will have their tick duration drastically reduced
-    Rupture is not lethal if the sword is Stone or Wooden
     Rupture damage is reduced by 25% on players if they are wearing Full Armor (can be any type)
     Rupture damage is reduced by 25% on players if they are wearing Full Armor (can be any type)
     Note: You'll need to add these entries to your config.yml manually, or wait for the upcoming config update where this will be fixed for you automatically.
     Note: You'll need to add these entries to your config.yml manually, or wait for the upcoming config update where this will be fixed for you automatically.
     NOTE: Here's what your Double_Drop entries in Config.yml for Mining should look like
     NOTE: Here's what your Double_Drop entries in Config.yml for Mining should look like

+ 1 - 1
pom.xml

@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.gmail.nossr50.mcMMO</groupId>
     <groupId>com.gmail.nossr50.mcMMO</groupId>
     <artifactId>mcMMO</artifactId>
     <artifactId>mcMMO</artifactId>
-    <version>2.1.23-SNAPSHOT</version>
+    <version>2.1.23</version>
     <name>mcMMO</name>
     <name>mcMMO</name>
     <url>https://github.com/mcMMO-Dev/mcMMO</url>
     <url>https://github.com/mcMMO-Dev/mcMMO</url>
     <scm>
     <scm>

+ 47 - 6
src/main/java/com/gmail/nossr50/listeners/EntityListener.java

@@ -187,6 +187,53 @@ public class EntityListener implements Listener {
         }
         }
     }
     }
 
 
+/*    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
+    public void onEntityDamageDebugLowest(EntityDamageEvent event)
+    {
+        if(event instanceof FakeEntityDamageByEntityEvent)
+            return;
+
+        if(event instanceof FakeEntityDamageEvent)
+            return;
+
+        Bukkit.broadcastMessage(ChatColor.GOLD+"DMG Before Events: "+ChatColor.RESET+event.getDamage());
+    }
+
+    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
+    public void onEntityDamageDebugMonitor(EntityDamageEvent event)
+    {
+        if(event instanceof FakeEntityDamageByEntityEvent)
+            return;
+
+        if(event instanceof FakeEntityDamageEvent)
+            return;
+
+        double rawDamage = event.getDamage();
+        double dmgAfterReduction = event.getFinalDamage();
+        Bukkit.broadcastMessage(ChatColor.GOLD+"DEBUG: " + event.getEntity().getName()+ChatColor.RESET+"RawDMG["+rawDamage+"], "+"FinalDMG=["+dmgAfterReduction+"]");
+        Bukkit.broadcastMessage("");
+    }*/
+
+    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
+    public void onEntityDamageLowest(EntityDamageByEntityEvent event)
+    {
+        Entity defender = event.getEntity();
+
+        if(defender.getMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY).size() > 0)
+        {
+            defender.removeMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, plugin);
+            LivingEntity defLive = (LivingEntity) defender;
+
+            if(defender instanceof Player)
+            {
+                defLive.setHealth(defLive.getHealth() - event.getFinalDamage());
+                event.setCancelled(true);
+            }
+
+            return;
+        }
+    }
+
     /**
     /**
      * Handle EntityDamageByEntity events that involve modifying the event.
      * Handle EntityDamageByEntity events that involve modifying the event.
      *
      *
@@ -199,12 +246,6 @@ public class EntityListener implements Listener {
         Entity defender = event.getEntity();
         Entity defender = event.getEntity();
         Entity attacker = event.getDamager();
         Entity attacker = event.getDamager();
 
 
-        if(defender.getMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY).size() > 0)
-        {
-            defender.removeMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, plugin);
-            return;
-        }
-
         /* WORLD BLACKLIST CHECK */
         /* WORLD BLACKLIST CHECK */
         if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
         if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
             return;
             return;

+ 32 - 24
src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java

@@ -21,6 +21,7 @@ import com.gmail.nossr50.util.*;
 import com.gmail.nossr50.util.player.NotificationManager;
 import com.gmail.nossr50.util.player.NotificationManager;
 import com.gmail.nossr50.util.player.UserManager;
 import com.gmail.nossr50.util.player.UserManager;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap;
+import org.bukkit.Bukkit;
 import org.bukkit.GameMode;
 import org.bukkit.GameMode;
 import org.bukkit.Material;
 import org.bukkit.Material;
 import org.bukkit.entity.*;
 import org.bukkit.entity.*;
@@ -390,7 +391,7 @@ public final class CombatUtils {
             return;
             return;
         }
         }
 
 
-        double incDmg = getFakeDamageFinalResult(attacker, target, DamageCause.CUSTOM, damage);
+        double incDmg = getFakeDamageFinalResult(attacker, target, DamageCause.ENTITY_ATTACK, damage);
 
 
         double newHealth = Math.max(0, target.getHealth() - incDmg);
         double newHealth = Math.max(0, target.getHealth() - incDmg);
 
 
@@ -407,30 +408,37 @@ public final class CombatUtils {
             return;
             return;
         }
         }
 
 
-        //IFrame storage
-//        int noDamageTicks = target.getNoDamageTicks();
-
-        double incDmg = getFakeDamageFinalResult(attacker, target, DamageCause.CUSTOM, damage);
-
-        double newHealth = Math.max(0, target.getHealth() - incDmg);
-
-        //Don't kill things with a stone or wooden weapon
-        if(toolTier < 3 && newHealth == 0)
-            return;
-
         target.setMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.metadataValue);
         target.setMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.metadataValue);
-
-        if(newHealth == 0 && !(target instanceof Player))
-        {
-            target.damage(99999, attacker);
-        }
-        else
-        {
-//            Vector beforeRuptureVec = new Vector(target.getVelocity().getX(), target.getVelocity().getY(), target.getVelocity().getZ()); ;
-            target.setHealth(newHealth);
-//            target.setNoDamageTicks(noDamageTicks); //Do not add additional IFrames
-//            target.setVelocity(beforeRuptureVec);
-        }
+        target.damage(damage, attacker);
+
+//        //IFrame storage
+////        int noDamageTicks = target.getNoDamageTicks();
+//
+////        String debug = "BLEED DMG RESULT: INC DMG:"+damage+", HP-Before:"+target.getHealth()+", HP-After:";
+//
+////        double incDmg = getFakeDamageFinalResult(attacker, target, DamageCause.ENTITY_ATTACK, damage);
+//
+////        double newHealth = Math.max(0, target.getHealth() - incDmg);
+//
+//        //Don't kill things with a stone or wooden weapon
+////        if(toolTier < 3 && newHealth == 0)
+////            return;
+//
+//        target.setMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.metadataValue);
+//
+//        if(newHealth == 0 && !(target instanceof Player))
+//        {
+//            target.damage(99999, attacker);
+//        }
+//        else
+//        {
+////            Vector beforeRuptureVec = new Vector(target.getVelocity().getX(), target.getVelocity().getY(), target.getVelocity().getZ()); ;
+//            target.damage(damage, attacker);
+////            debug+=target.getHealth();
+//            Bukkit.broadcastMessage(debug);
+////            target.setNoDamageTicks(noDamageTicks); //Do not add additional IFrames
+////            target.setVelocity(beforeRuptureVec);
+//        }
     }
     }
 
 
     /**
     /**