Files
Purpur/patches/server/0226-Toggle-for-Wither-s-spawn-sound.patch
Ben Kerllenevich 516b9ad8f3 drop some
2021-11-25 11:52:45 -05:00

40 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 12emin34 <macanovic.emin@gmail.com>
Date: Sat, 7 Aug 2021 21:27:56 +0200
Subject: [PATCH] Toggle for Wither's spawn sound
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index 2943342e6dddc3b89411b7a6548d56b69a201d25..5ca3d7dfadb213530739863571fa6cafb819d82d 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -414,7 +414,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
}
// CraftBukkit end
- if (!this.isSilent()) {
+ if (!this.isSilent() && level.purpurConfig.witherPlaySpawnSound) {
// CraftBukkit start - Use relative location for far away sounds
// this.world.globalLevelEvent(1023, new BlockPosition(this), 0);
//int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 65e2b415c7c6801f815cd55b5c27dafaab97d410..2ac4f9349cb4f8bcf91717b0b989612bd25704d7 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -2409,6 +2409,7 @@ public class PurpurWorldConfig {
public boolean witherTakeDamageFromWater = false;
public boolean witherCanRideVehicles = false;
public float witherExplosionRadius = 1.0F;
+ public boolean witherPlaySpawnSound = true;
private void witherSettings() {
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
@@ -2429,6 +2430,7 @@ public class PurpurWorldConfig {
witherTakeDamageFromWater = getBoolean("mobs.wither.takes-damage-from-water", witherTakeDamageFromWater);
witherCanRideVehicles = getBoolean("mobs.wither.can-ride-vehicles", witherCanRideVehicles);
witherExplosionRadius = (float) getDouble("mobs.wither.explosion-radius", witherExplosionRadius);
+ witherPlaySpawnSound = getBoolean("mobs.wither.play-spawn-sound", witherPlaySpawnSound);
}
public boolean witherSkeletonRidable = false;