PaperSpigot-Parent/Spigot-Server-Patches/0008-Configurable-damage-multiplier-for-PvP-blocking.patch

39 lines
1.8 KiB
Diff
Raw Normal View History

2014-08-06 01:45:22 +02:00
From f1e2e7c6fc2053e68ea7903d20fef3e6ab342e68 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
2014-08-06 01:45:22 +02:00
Date: Tue, 5 Aug 2014 16:21:03 -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
2014-08-06 01:45:22 +02:00
index f3e4328..c0355bc 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
2014-08-06 01:45:22 +02:00
@@ -824,7 +824,7 @@ 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;
2014-08-06 01:45:22 +02:00
+ f = (1.0F + f) * this.world.paperSpigotConfig.playerBlockingDamageMultiplier; // PaperSpigot - Configurable damage multiplier for blocking
}
2014-07-09 05:05:35 +02:00
f = this.applyArmorModifier(damagesource, f);
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2014-08-06 01:45:22 +02:00
index f6b0349..5cda463 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2014-08-06 01:45:22 +02:00
@@ -90,4 +90,11 @@ public class PaperSpigotWorldConfig
squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D );
2014-08-06 01:45:22 +02:00
log( "Squids will spawn between Y: " + squidMinSpawnHeight + " and Y: " + squidMaxSpawnHeight);
}
+
2014-08-06 01:45:22 +02:00
+ public float playerBlockingDamageMultiplier;
+ private void playerBlockingDamageMultiplier()
+ {
+ playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F );
2014-08-06 01:45:22 +02:00
+ log( "Player blocking damage multiplier set to " + playerBlockingDamageMultiplier);
+ }
}
--
1.9.1