From 0ea4034391585e2554b6b638df3aee20d57bcc9b Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 22 Jun 2014 15:38:17 -0500 Subject: [PATCH] Configurable damage multiplier for PvP blocking --- ...e-damage-multiplier-for-PvP-blocking.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CraftBukkit-Patches/0156-Configurable-damage-multiplier-for-PvP-blocking.patch diff --git a/CraftBukkit-Patches/0156-Configurable-damage-multiplier-for-PvP-blocking.patch b/CraftBukkit-Patches/0156-Configurable-damage-multiplier-for-PvP-blocking.patch new file mode 100644 index 0000000000..1f89bfe9c2 --- /dev/null +++ b/CraftBukkit-Patches/0156-Configurable-damage-multiplier-for-PvP-blocking.patch @@ -0,0 +1,46 @@ +From d8ac73e9000b772e48821b4c1aba04fec359e7d5 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Mon, 19 May 2014 21:13:31 -0500 +Subject: [PATCH] Configurable damage multiplier for PvP blocking + + +diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java +index c3a0dc3..f50dcf5 100644 +--- a/src/main/java/net/minecraft/server/EntityHuman.java ++++ b/src/main/java/net/minecraft/server/EntityHuman.java +@@ -20,6 +20,8 @@ import org.bukkit.event.player.PlayerDropItemEvent; + import org.bukkit.event.player.PlayerItemConsumeEvent; + // CraftBukkit end + ++import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++ + public abstract class EntityHuman extends EntityLiving implements ICommandListener { + + public PlayerInventory inventory = new PlayerInventory(this); +@@ -807,7 +809,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen + protected void d(DamageSource damagesource, float f) { + if (!this.isInvulnerable()) { + if (!damagesource.ignoresArmor() && this.isBlocking() && f > 0.0F) { +- f = (1.0F + f) * 0.5F; ++ f = (1.0F + f) * SpigotWorldConfig.playerBlockingDamageMultiplier; // PaperSpigot - Configurable damage multiplier for players blocking + } + + f = this.b(damagesource, f); +diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +index c340fb3..a2947d6 100644 +--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java ++++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +@@ -340,4 +340,10 @@ public class SpigotWorldConfig + { + witherSpawnSoundRadius = getInt( "wither-spawn-sound-radius", 0 ); + } ++ ++ public static float playerBlockingDamageMultiplier; ++ private void setPlayerBlockingDamageMultiplier() ++ { ++ playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F ); ++ } + } +-- +1.9.1 +