geforkt von Mirrors/Paper
9df2066642
Upstream has released updates that appear 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: dfe1fb48 PR-906: Add missing MinecraftExperimental annotation to Bundles 825ab30d PR-905: Add missing MapCursor.Type and update documentation e03d10e6 PR-903: Make BARRIER Waterlogged 1961ead6 PR-898: Use Java Consumer instead of Bukkit Consumer CraftBukkit Changes: f71a799f0 Make BARRIER Waterlogged 172f76a45 Upgrade specialsource-maven-plugin f0702775c SPIGOT-7486: Alternate approach to null profile names 069495671 SPIGOT-7485: Allow air entity items since required for Vanilla logic 5dfd33dc2 SPIGOT-7484: Cancelling PlayerEditBookEvent does not update client's book contents 02d490788 PR-1250: Standardize and centralize Bukkit / Minecraft registry conversion 9024a09b9 PR-1251: Use Java Consumer instead of Bukkit Consumer 6d4b25bf1 Increase diff stability
160 Zeilen
5.3 KiB
Diff
160 Zeilen
5.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Byteflux <byte@byteflux.net>
|
|
Date: Mon, 29 Feb 2016 18:05:37 -0600
|
|
Subject: [PATCH] Add view distance API
|
|
|
|
Add per player no-tick, tick, and send view distances.
|
|
|
|
Also add send/no-tick view distance to World.
|
|
|
|
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
|
index 4c2d252a8298336b0ad23d15fc9290f05e5438c6..20a949a65a92e1d4c5162585339732377b8fba0c 100644
|
|
--- a/src/main/java/org/bukkit/World.java
|
|
+++ b/src/main/java/org/bukkit/World.java
|
|
@@ -2662,6 +2662,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|
int getSimulationDistance();
|
|
// Spigot end
|
|
|
|
+ // Paper start - view distance api
|
|
+ /**
|
|
+ * Sets the view distance for this world.
|
|
+ * @param viewDistance view distance in [2, 32]
|
|
+ */
|
|
+ void setViewDistance(int viewDistance);
|
|
+
|
|
+ /**
|
|
+ * Sets the simulation distance for this world.
|
|
+ * @param simulationDistance simulation distance in [2, 32]
|
|
+ */
|
|
+ void setSimulationDistance(int simulationDistance);
|
|
+
|
|
+ /**
|
|
+ * Returns the no-tick view distance for this world.
|
|
+ * <p>
|
|
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
|
|
+ * be set to tick.
|
|
+ * </p>
|
|
+ * @return The no-tick view distance for this world.
|
|
+ * @deprecated Use {@link #getViewDistance()}
|
|
+ */
|
|
+ @Deprecated
|
|
+ int getNoTickViewDistance();
|
|
+
|
|
+ /**
|
|
+ * Sets the no-tick view distance for this world.
|
|
+ * <p>
|
|
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
|
|
+ * be set to tick.
|
|
+ * </p>
|
|
+ * @param viewDistance view distance in [2, 32]
|
|
+ * @deprecated Use {@link #setViewDistance(int)}
|
|
+ */
|
|
+ @Deprecated
|
|
+ void setNoTickViewDistance(int viewDistance);
|
|
+
|
|
+ /**
|
|
+ * Gets the sending view distance for this world.
|
|
+ * <p>
|
|
+ * Sending view distance is the view distance where chunks will load in for players in this world.
|
|
+ * </p>
|
|
+ * @return The sending view distance for this world.
|
|
+ */
|
|
+ int getSendViewDistance();
|
|
+
|
|
+ /**
|
|
+ * Sets the sending view distance for this world.
|
|
+ * <p>
|
|
+ * Sending view distance is the view distance where chunks will load in for players in this world.
|
|
+ * </p>
|
|
+ * @param viewDistance view distance in [2, 32] or -1
|
|
+ */
|
|
+ void setSendViewDistance(int viewDistance);
|
|
+ // Paper end - view distance api
|
|
+
|
|
// Spigot start
|
|
public class Spigot {
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
|
index f21183cd5491b09e4543839252aed1ea10ddf849..f9b9e0269b3a9402c5be1c1c2007956415ff708a 100644
|
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
|
@@ -2212,6 +2212,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
* @param affects Whether the player can affect mob spawning
|
|
*/
|
|
public void setAffectsSpawning(boolean affects);
|
|
+
|
|
+ /**
|
|
+ * Gets the view distance for this player
|
|
+ *
|
|
+ * @return the player's view distance
|
|
+ * @see org.bukkit.World#getViewDistance()
|
|
+ */
|
|
+ public int getViewDistance();
|
|
+
|
|
+ /**
|
|
+ * Sets the view distance for this player
|
|
+ *
|
|
+ * @param viewDistance the player's view distance
|
|
+ * @see org.bukkit.World#setViewDistance(int)
|
|
+ */
|
|
+ public void setViewDistance(int viewDistance);
|
|
+
|
|
+ /**
|
|
+ * Gets the simulation distance for this player
|
|
+ *
|
|
+ * @return the player's simulation distance
|
|
+ */
|
|
+ public int getSimulationDistance();
|
|
+
|
|
+ /**
|
|
+ * Sets the simulation distance for this player
|
|
+ *
|
|
+ * @param simulationDistance the player's new simulation distance
|
|
+ */
|
|
+ public void setSimulationDistance(int simulationDistance);
|
|
+
|
|
+ /**
|
|
+ * Gets the no-ticking view distance for this player.
|
|
+ * <p>
|
|
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
|
|
+ * be set to tick.
|
|
+ * </p>
|
|
+ * @return The no-tick view distance for this player.
|
|
+ * @deprecated Use {@link #getViewDistance()}
|
|
+ */
|
|
+ @Deprecated
|
|
+ public int getNoTickViewDistance();
|
|
+
|
|
+ /**
|
|
+ * Sets the no-ticking view distance for this player.
|
|
+ * <p>
|
|
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
|
|
+ * be set to tick.
|
|
+ * </p>
|
|
+ * @param viewDistance view distance in [2, 32] or -1
|
|
+ * @deprecated Use {@link #setViewDistance(int)}
|
|
+ */
|
|
+ @Deprecated
|
|
+ public void setNoTickViewDistance(int viewDistance);
|
|
+
|
|
+ /**
|
|
+ * Gets the sending view distance for this player.
|
|
+ * <p>
|
|
+ * Sending view distance is the view distance where chunks will load in for players.
|
|
+ * </p>
|
|
+ * @return The sending view distance for this player.
|
|
+ */
|
|
+ public int getSendViewDistance();
|
|
+
|
|
+ /**
|
|
+ * Sets the sending view distance for this player.
|
|
+ * <p>
|
|
+ * Sending view distance is the view distance where chunks will load in for players.
|
|
+ * </p>
|
|
+ * @param viewDistance view distance in [2, 32] or -1
|
|
+ */
|
|
+ public void setSendViewDistance(int viewDistance);
|
|
// Paper end
|
|
|
|
/**
|