add snowball to despawn rate config

This commit is contained in:
jmp
2020-09-18 11:57:29 -07:00
committed by BillyGalbreath
parent 242deeef82
commit 09e0103ee1
2 changed files with 21 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ Purpur API maven dependency:
<dependency>
<groupId>net.pl3x.purpur</groupId>
<artifactId>purpur-api</artifactId>
<version>1.16.2-R0.1-SNAPSHOT</version>
<version>1.16.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```

View File

@@ -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);
+ }
+