PaperMC/CraftBukkit-Patches/0008-Configurable-damage-multiplier-for-PvP-blocking.patch

44 lines
No EOL
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Tue, 24 Jun 2014 07:39:37 -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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ 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);
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
// CraftBukkit end
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 PvP blocking damage multiplier
}
f = this.b(damagesource, f);
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true);
log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
}
+
+ public static float playerBlockingDamageMultiplier;
+ private void playerBlockingDamageMultiplier()
+ {
+ playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F );
+ }
}
--