2015-05-25 14:05:40 +02:00
|
|
|
From 6e7a673650d54e56f37efc2a6a6ea74b54b21e2f Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02:00
|
|
|
From: drXor <mcyoungsota@gmail.com>
|
|
|
|
Date: Sat, 29 Mar 2014 13:44:25 -0400
|
|
|
|
Subject: [PATCH] Configurable dragon death and wither spawn sounds
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
2015-05-09 22:23:26 +02:00
|
|
|
index d4ec5fb..fcddd26 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
2015-02-28 12:36:22 +01:00
|
|
|
@@ -578,6 +578,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
2014-07-21 22:46:54 +02:00
|
|
|
double deltaX = this.locX - player.locX;
|
|
|
|
double deltaZ = this.locZ - player.locZ;
|
|
|
|
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
|
|
|
+ if ( world.spigotConfig.dragonDeathSoundRadius > 0 && distanceSquared > world.spigotConfig.dragonDeathSoundRadius * world.spigotConfig.dragonDeathSoundRadius ) continue; // Spigot
|
|
|
|
if (distanceSquared > viewDistance * viewDistance) {
|
|
|
|
double deltaLength = Math.sqrt(distanceSquared);
|
|
|
|
double relativeX = player.locX + (deltaX / deltaLength) * viewDistance;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
|
2015-05-09 22:23:26 +02:00
|
|
|
index 9884a82..fb19bad 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
2015-02-28 12:36:22 +01:00
|
|
|
@@ -191,6 +191,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
2014-07-21 22:46:54 +02:00
|
|
|
double deltaX = this.locX - player.locX;
|
|
|
|
double deltaZ = this.locZ - player.locZ;
|
|
|
|
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
|
|
|
+ if ( world.spigotConfig.witherSpawnSoundRadius > 0 && distanceSquared > world.spigotConfig.witherSpawnSoundRadius * world.spigotConfig.witherSpawnSoundRadius ) continue; // Spigot
|
|
|
|
if (distanceSquared > viewDistance * viewDistance) {
|
|
|
|
double deltaLength = Math.sqrt(distanceSquared);
|
|
|
|
double relativeX = player.locX + (deltaX / deltaLength) * viewDistance;
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2015-02-26 11:40:16 +01:00
|
|
|
index 76ded26..c06084d 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
@@ -280,4 +280,16 @@ public class SpigotWorldConfig
|
|
|
|
maxCollisionsPerEntity = getInt( "max-entity-collisions", 8 );
|
|
|
|
log( "Max Entity Collisions: " + maxCollisionsPerEntity );
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public int dragonDeathSoundRadius;
|
|
|
|
+ private void keepDragonDeathPerWorld()
|
|
|
|
+ {
|
|
|
|
+ dragonDeathSoundRadius = getInt( "dragon-death-sound-radius", 0 );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public int witherSpawnSoundRadius;
|
|
|
|
+ private void witherSpawnSoundRadius()
|
|
|
|
+ {
|
|
|
|
+ witherSpawnSoundRadius = getInt( "wither-spawn-sound-radius", 0 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2015-05-09 22:23:26 +02:00
|
|
|
2.1.4
|
2014-07-21 22:46:54 +02:00
|
|
|
|