geforkt von Mirrors/Paper
f5265d6688
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 6ff65c82 SPIGOT-5908: CompassMeta for new lodestone compass data CraftBukkit Changes:3b9cf0f8
Improve code formatting008f039f
SPIGOT-5913: MOTD no longer supports new line characterb8b65eb7
SPIGOT-5908: CompassMeta for new lodestone compass data Spigot Changes: 4d9262cf Rebuild patches d27f7952 SPIGOT-5912: Outdated client message shows outdated server message
63 Zeilen
4.6 KiB
Diff
63 Zeilen
4.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach@zachbr.io>
|
|
Date: Mon, 6 May 2019 01:29:25 -0400
|
|
Subject: [PATCH] Per-Player View Distance API placeholders
|
|
|
|
I hope to look at this more in-depth soon. It appears doable.
|
|
However this should not block the update.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
index 3cb8ce58c4675564fb239338d6c40ea511a9a97c..96f898acdeae1917a4aaf99ec4a48bccf3904488 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
@@ -576,9 +576,10 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
|
if (this.deathAnimationTicks == 1 && !this.isSilent()) {
|
|
// CraftBukkit start - Use relative location for far away sounds
|
|
// this.world.b(1028, this.getChunkCoordinates(), 0);
|
|
- //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
|
|
+ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
|
|
for (EntityPlayer player : (List<EntityPlayer>) ((WorldServer)world).getPlayers()) {
|
|
- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
|
+ // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
|
+ // Paper end
|
|
double deltaX = this.locX() - player.locX();
|
|
double deltaZ = this.locZ() - player.locZ();
|
|
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
|
|
index 9331f96f68f121b41ce74904d624520291b7c72e..1074995e8c8a83f6cdb94019123fbffa309d5e08 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
|
@@ -208,9 +208,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
|
if (!this.isSilent()) {
|
|
// CraftBukkit start - Use relative location for far away sounds
|
|
// this.world.b(1023, new BlockPosition(this), 0);
|
|
- //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
|
|
+ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
|
|
for (EntityPlayer player : (List<EntityPlayer>)this.world.getPlayers()) {
|
|
- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
|
+ // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
|
double deltaX = this.locX() - player.locX();
|
|
double deltaZ = this.locZ() - player.locZ();
|
|
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
index bfb1beb4eaade3e198ea179f221de8f3e9c682af..5277fceedccc355698ee1895306a3666bf5c47cd 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -2004,6 +2004,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
super.remove();
|
|
}
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public int getViewDistance() {
|
|
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setViewDistance(int viewDistance) {
|
|
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
|
|
+ }
|
|
// Paper end
|
|
|
|
// Spigot start
|