clean up view distance api diff

This commit is contained in:
Jake Potrebic 2022-02-28 19:00:17 -08:00 committed by Jason Penilla
parent fd7432601d
commit 5071d50207
No known key found for this signature in database
GPG key ID: 0E75A301420E48F8
25 changed files with 131 additions and 115 deletions

View file

@ -18,20 +18,25 @@ index e3e9f082102d16a8e16df3b35772430c6d102243..ba0fc93333fbe3ef1d9677de42f00648
+ public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 5963fa56e7dcd61336a14fa1035c6c14143989ad..48812a4fe0c12689dd9d7829019cdf70e0bda65b 100644
index 5963fa56e7dcd61336a14fa1035c6c14143989ad..4c2aad1db5a4f82e5fa5c187cb58e8c675b4d697 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1831,6 +1831,31 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public int getSimulationDistance() {
@@ -1832,6 +1832,37 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return world.spigotConfig.simulationDistance;
}
+
// Spigot end
+ // Paper start - view distance api
+ @Override
+ public void setViewDistance(int viewDistance) {
+ throw new UnsupportedOperationException(); //TODO
+ }
+
+ @Override
+ public void setSimulationDistance(int simulationDistance) {
+ throw new UnsupportedOperationException(); //TODO
+ }
+
+ @Override
+ public int getNoTickViewDistance() {
+ throw new UnsupportedOperationException(); //TODO
+ }
@ -50,14 +55,15 @@ index 5963fa56e7dcd61336a14fa1035c6c14143989ad..48812a4fe0c12689dd9d7829019cdf70
+ public void setSendViewDistance(int viewDistance) {
+ throw new UnsupportedOperationException(); //TODO
+ }
// Spigot end
+ // Paper end - view distance api
// Spigot start
private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9357440824bf8b125d08c6c785e71c9b1ac95ae4..fe27669d525c84d9f8d828dfcde1c35e3ecb7a49 100644
index 9357440824bf8b125d08c6c785e71c9b1ac95ae4..ea80d73cf2f5703579dba6f331d9a29d310570f2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -389,6 +389,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -389,6 +389,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message);
}
}
@ -73,6 +79,16 @@ index 9357440824bf8b125d08c6c785e71c9b1ac95ae4..fe27669d525c84d9f8d828dfcde1c35e
+ }
+
+ @Override
+ public int getSimulationDistance() {
+ 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 setSimulationDistance(int simulationDistance) {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
+
+ @Override
+ public int getNoTickViewDistance() {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }