Skip to content

Commit

Permalink
Oopsie, lets fix these snowballs :3
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGalbreath committed Sep 20, 2020
1 parent 4895a88 commit 081f5a7
Showing 1 changed file with 29 additions and 10 deletions.
Expand Up @@ -191,6 +191,23 @@ index 92efb2953..f884e4cf7 100644
+ }
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java
index e44249f59..34a5f481e 100644
--- a/src/main/java/net/minecraft/server/EntitySnowball.java
+++ b/src/main/java/net/minecraft/server/EntitySnowball.java
@@ -14,6 +14,12 @@ public class EntitySnowball extends EntityProjectileThrowable {
super(EntityTypes.SNOWBALL, d0, d1, d2, world);
}

+ // Purpur start
+ protected int getPurpurDespawnRate() {
+ return world.purpurConfig.snowballDespawnRate;
+ }
+ // Purpur end
+
@Override
protected Item getDefaultItem() {
return Items.SNOWBALL;
diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java
index 2d3ca8c42..1d32518bd 100644
--- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java
Expand Down Expand Up @@ -267,36 +284,38 @@ index 9a17eb606..f0b898289 100644

public boolean checkIfLeftOwner() { return this.h(); } // Purpur - OBFHELPER
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 423593ae6..e077fcfe1 100644
index 423593ae6..ab7105851 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);
}

+ public int witherSkullDespawnRate = -1;
+ public int dragonFireballDespawnRate = -1;
+ public int largeFireballDespawnRate = -1;
+ public int smallFireballDespawnRate = -1;
+ public int eggDespawnRate = -1;
+ public int enderPearlDespawnRate = -1;
+ public int expBottleDespawnRate = -1;
+ public int fireworkDespawnRate = -1;
+ public int fishingHookDespawnRate = -1;
+ public int largeFireballDespawnRate = -1;
+ public int potionDespawnRate = -1;
+ public int shulkerBulletDespawnRate = -1;
+ public int expBottleDespawnRate = -1;
+ public int smallFireballDespawnRate = -1;
+ public int snowballDespawnRate = -1;
+ public int witherSkullDespawnRate = -1;
+ private void projectileDespawnRateSettings() {
+ witherSkullDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.wither_skull", witherSkullDespawnRate);
+ dragonFireballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.dragon_fireball", dragonFireballDespawnRate);
+ largeFireballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.fireball", largeFireballDespawnRate);
+ smallFireballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.small_fireball", smallFireballDespawnRate);
+ eggDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.egg", eggDespawnRate);
+ enderPearlDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.ender_pearl", enderPearlDespawnRate);
+ expBottleDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.experience_bottle", expBottleDespawnRate);
+ fireworkDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.firework_rocket", fireworkDespawnRate);
+ fishingHookDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.fishing_bobber", fishingHookDespawnRate);
+ largeFireballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.fireball", largeFireballDespawnRate);
+ potionDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.potion", potionDespawnRate);
+ shulkerBulletDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.shulker_bullet", shulkerBulletDespawnRate);
+ expBottleDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.experience_bottle", expBottleDespawnRate);
+ smallFireballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.small_fireball", smallFireballDespawnRate);
+ snowballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.snowball", snowballDespawnRate);
+ witherSkullDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.wither_skull", witherSkullDespawnRate);
+ }
+
public boolean useBetterMending = false;
Expand Down

0 comments on commit 081f5a7

Please sign in to comment.