mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 02:17:35 +01:00
cab333b217
Don't send requests of every player was found in the global api cache SpigotMC/Spigot@841270ff1e Correctly set the response code for the cached lookups and return the ... SpigotMC/Spigot@f170b7899c Don't try and re-set the global api cache on reload SpigotMC/Spigot@b410a00a66 Use a compile time sneaky throw hack. SpigotMC/Spigot@508462b96b Fix a missed rename in WorldGenGroundBush SpigotMC/Spigot@0614d8fae9
55 lines
3.0 KiB
Diff
55 lines
3.0 KiB
Diff
From a73a46b6f3f437d91ca26ebc9a42889226cc4ee4 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 78023c4..5d761aa 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
@@ -551,6 +551,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
|
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
|
|
index 75b3ca3..434616d 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
|
@@ -180,6 +180,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
|
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
|
|
index 9745982..3e6b1e6 100644
|
|
--- 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 );
|
|
+ }
|
|
}
|
|
--
|
|
1.9.1
|
|
|