From 09e0103ee1cc43004b8501c902607da109d6d146 Mon Sep 17 00:00:00 2001 From: jmp Date: Fri, 18 Sep 2020 11:57:29 -0700 Subject: [PATCH] add snowball to despawn rate config --- README.md | 2 +- ...e-config-options-per-projectile-type.patch | 22 +++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e715da505..8cb1d8411 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Purpur API maven dependency: net.pl3x.purpur purpur-api - 1.16.2-R0.1-SNAPSHOT + 1.16.3-R0.1-SNAPSHOT provided ``` diff --git a/patches/server/0127-Despawn-rate-config-options-per-projectile-type.patch b/patches/server/0127-Despawn-rate-config-options-per-projectile-type.patch index 3dfc3cdc3..3f794954f 100644 --- a/patches/server/0127-Despawn-rate-config-options-per-projectile-type.patch +++ b/patches/server/0127-Despawn-rate-config-options-per-projectile-type.patch @@ -160,6 +160,22 @@ index 92efb29534..f884e4cf7a 100644 + protected int getPurpurDespawnRate() { + return this.world.purpurConfig.smallFireballDespawnRate; + } ++ // Purpur end + } +diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java +index e44249f59b..592846759f 100644 +--- a/src/main/java/net/minecraft/server/EntitySnowball.java ++++ b/src/main/java/net/minecraft/server/EntitySnowball.java +@@ -37,4 +37,11 @@ public class EntitySnowball extends EntityProjectileThrowable { + } + + } ++ ++ // Purpur start ++ @Override ++ protected int getPurpurDespawnRate() { ++ return this.world.purpurConfig.snowballDespawnRate; ++ } + // Purpur end } diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java @@ -237,10 +253,10 @@ index 9a17eb6066..ab0809992c 100644 private boolean h() { Entity entity = this.getShooter(); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 423593ae66..fa322b1742 100644 +index 423593ae66..bd58350796 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -145,6 +145,31 @@ public class PurpurWorldConfig { +@@ -145,6 +145,33 @@ public class PurpurWorldConfig { idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList); } @@ -254,6 +270,7 @@ index 423593ae66..fa322b1742 100644 + public int fishingHookDespawnRate = -1; + public int potionDespawnRate = -1; + public int shulkerBulletDespawnRate = -1; ++ public int snowballDespawnRate = -1; + public int expBottleDespawnRate = -1; + private void projectileDespawnRateSettings() { + witherSkullDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.wither_skull", witherSkullDespawnRate); @@ -266,6 +283,7 @@ index 423593ae66..fa322b1742 100644 + fishingHookDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.fishing_bobber", fishingHookDespawnRate); + potionDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.potion", potionDespawnRate); + shulkerBulletDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.shulker_bullet", shulkerBulletDespawnRate); ++ snowballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.snowball", snowballDespawnRate); + expBottleDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.experience_bottle", expBottleDespawnRate); + } +