Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5e7c12af8 |
No files matched your search
+1
-1
@@ -5,7 +5,7 @@ plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||
id("io.papermc.paperweight.core") version "1.5.11-SNAPSHOT"
|
||||
id("io.papermc.paperweight.core") version "1.5.10"
|
||||
}
|
||||
|
||||
allprojects {
|
||||
|
||||
@@ -8,7 +8,7 @@ apply if there are changes made to it from upstream - thus notifying us
|
||||
that changes were made.
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 5dd700a956e915c00b25d91dea8d6f285ddab72b..97e78e27ee0eea2c8b24886eeb19164d552323fe 100644
|
||||
index 11038da2e071699d6561a331565db0c8d7850d0e..317acfec5894101294a55abff61819431e6a5e65 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -1,3 +1,5 @@
|
||||
@@ -17,7 +17,7 @@ index 5dd700a956e915c00b25d91dea8d6f285ddab72b..97e78e27ee0eea2c8b24886eeb19164d
|
||||
# Eclipse stuff
|
||||
/.classpath
|
||||
/.project
|
||||
@@ -32,3 +34,7 @@
|
||||
@@ -31,3 +33,7 @@
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
@@ -763,7 +763,7 @@ index 0000000000000000000000000000000000000000..6e94562d79206d88b74b53814f9423f1
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index ea881e5b8fcde8768bd884fde737d38f6ee07a5f..0272b699bd2351511856fe116162a965e928ebc0 100644
|
||||
index 1cd0bc6b58b1fe391f77b95182ed848f2e74a9a5..55b61b5971ac0848174bd4d59952408c437f0e60 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -390,7 +390,9 @@ public final class Bukkit {
|
||||
@@ -1161,7 +1161,7 @@ index ae7b51341fb66c41b8a7c4604fd273d876e311be..4034fcb9abc39b12f0de47c4b679f2ef
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 0f38cffd9d858eb3b959d30388e82a77af913ecb..be29b60651f0ab9cae4e0a3ff1df4e8b0422a947 100644
|
||||
index 3a0f7405a481327dd94cfb5fc693ce07c2223954..19d61b2425794b2ca4dbc76bda9e23abe97fc30d 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -62,13 +62,13 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -1508,7 +1508,7 @@ index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb
|
||||
return warning == null || warning.value();
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index cd000a064732ebaa8802f3d7b7ba9bd7ba101f14..30dc2f85b60877930cab68230d3259ce92c08618 100644
|
||||
index 5c9d74a5d8876507ee855dbecc2bfa8755f4062e..1403d28bf9124e3c4cd741dfda06400318e8a0a0 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -45,7 +45,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -2134,7 +2134,7 @@ index ead9a9aaad3c7469a9393f3c73aa9a5fdb5b7406..121cd27185269339babae1757a604fbb
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa8cf3ae37 100644
|
||||
index 3d84a75a6999129353a9ead48f9db25bc80f685b..e5a54a2f35d83f8c7a5f2b6512b86481aa7f9f51 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -51,7 +51,41 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -2325,7 +2325,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
/**
|
||||
* Adds this user to the {@link ProfileBanList}. If a previous ban exists, this will
|
||||
* update the entry.
|
||||
@@ -798,6 +897,106 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -737,6 +836,106 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull Map<EquipmentSlot, ItemStack> items);
|
||||
|
||||
@@ -2432,7 +2432,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
/**
|
||||
* Send a sign change. This fakes a sign change packet for a user at
|
||||
* a certain location. This will not actually change the world in any way.
|
||||
@@ -815,7 +1014,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -754,7 +953,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param lines the new text on the sign or null to clear it
|
||||
* @throws IllegalArgumentException if location is null
|
||||
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
||||
@@ -2444,7 +2444,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
@@ -837,7 +1040,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -776,7 +979,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if location is null
|
||||
* @throws IllegalArgumentException if dyeColor is null
|
||||
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
||||
@@ -2456,7 +2456,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
@@ -860,7 +1067,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -799,7 +1006,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if location is null
|
||||
* @throws IllegalArgumentException if dyeColor is null
|
||||
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
||||
@@ -2468,7 +2468,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
@@ -1376,6 +1587,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1315,6 +1526,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* pack correctly.
|
||||
* </ul>
|
||||
*
|
||||
@@ -2476,7 +2476,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
* @param url The URL from which the client will download the resource
|
||||
* pack. The string must contain only US-ASCII characters and should
|
||||
* be encoded as per RFC 1738.
|
||||
@@ -1388,6 +1600,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1327,6 +1539,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
|
||||
* long.
|
||||
*/
|
||||
@@ -2484,7 +2484,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public void setResourcePack(@NotNull String url, @Nullable byte[] hash);
|
||||
|
||||
/**
|
||||
@@ -1419,6 +1632,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1358,6 +1571,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* pack correctly.
|
||||
* </ul>
|
||||
*
|
||||
@@ -2492,7 +2492,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
* @param url The URL from which the client will download the resource
|
||||
* pack. The string must contain only US-ASCII characters and should
|
||||
* be encoded as per RFC 1738.
|
||||
@@ -1432,8 +1646,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1371,8 +1585,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
|
||||
* long.
|
||||
*/
|
||||
@@ -2550,7 +2550,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
/**
|
||||
* Request that the player's client download and switch resource packs.
|
||||
* <p>
|
||||
@@ -1463,6 +1726,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1447,6 +1710,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* pack correctly.
|
||||
* </ul>
|
||||
*
|
||||
@@ -2558,7 +2558,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
* @param url The URL from which the client will download the resource
|
||||
* pack. The string must contain only US-ASCII characters and should
|
||||
* be encoded as per RFC 1738.
|
||||
@@ -1523,8 +1787,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1462,8 +1726,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
|
||||
* long.
|
||||
*/
|
||||
@@ -2616,7 +2616,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
/**
|
||||
* Gets the Scoreboard displayed to this player
|
||||
*
|
||||
@@ -1659,7 +1972,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1598,7 +1911,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param title Title text
|
||||
* @param subtitle Subtitle text
|
||||
@@ -2625,7 +2625,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
*/
|
||||
@Deprecated
|
||||
public void sendTitle(@Nullable String title, @Nullable String subtitle);
|
||||
@@ -1678,7 +1991,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1617,7 +1930,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param fadeIn time in ticks for titles to fade in. Defaults to 10.
|
||||
* @param stay time in ticks for titles to stay. Defaults to 70.
|
||||
* @param fadeOut time in ticks for titles to fade out. Defaults to 20.
|
||||
@@ -2635,7 +2635,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut);
|
||||
|
||||
/**
|
||||
@@ -1905,6 +2220,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1844,6 +2159,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public int getClientViewDistance();
|
||||
|
||||
@@ -2650,7 +2650,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
/**
|
||||
* Gets the player's estimated ping in milliseconds.
|
||||
*
|
||||
@@ -1930,8 +2253,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1869,8 +2192,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* they wish.
|
||||
*
|
||||
* @return the player's locale
|
||||
@@ -2661,7 +2661,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public String getLocale();
|
||||
|
||||
/**
|
||||
@@ -1983,6 +2308,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1922,6 +2247,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public boolean isAllowingServerListings();
|
||||
|
||||
@@ -2676,7 +2676,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
// Spigot start
|
||||
public class Spigot extends Entity.Spigot {
|
||||
|
||||
@@ -2014,11 +2347,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1953,11 +2286,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@@ -2690,7 +2690,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
@Override
|
||||
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
@@ -2029,7 +2364,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1968,7 +2303,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param position the screen position
|
||||
* @param component the components to send
|
||||
@@ -2700,7 +2700,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -2039,7 +2376,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1978,7 +2315,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param position the screen position
|
||||
* @param components the components to send
|
||||
@@ -2710,7 +2710,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -2050,7 +2389,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1989,7 +2328,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param position the screen position
|
||||
* @param sender the sender of the message
|
||||
* @param component the components to send
|
||||
@@ -2720,7 +2720,7 @@ index fc37e0c604e44dd2df54b51cd2f10dd9004f1d98..3f9ed7dfb4633804fe86857dcc9f57aa
|
||||
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -2061,7 +2402,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2000,7 +2341,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param position the screen position
|
||||
* @param sender the sender of the message
|
||||
* @param components the components to send
|
||||
|
||||
@@ -2854,7 +2854,7 @@ index 0000000000000000000000000000000000000000..3e61a926620a67daec3af54b72a1b911
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 0272b699bd2351511856fe116162a965e928ebc0..7300bba67cfd4d312c59b0f81f597ea0f8a54fcd 100644
|
||||
index 55b61b5971ac0848174bd4d59952408c437f0e60..dd60025dd956dd360ded51e056163c31908b6d5e 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -834,7 +834,6 @@ public final class Bukkit {
|
||||
@@ -2866,7 +2866,7 @@ index 0272b699bd2351511856fe116162a965e928ebc0..7300bba67cfd4d312c59b0f81f597ea0
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index be29b60651f0ab9cae4e0a3ff1df4e8b0422a947..31227e818b624d641bb7562ac3de8a821815d33a 100644
|
||||
index 19d61b2425794b2ca4dbc76bda9e23abe97fc30d..4cb488d68abc80aae733eb6b17e9cfa015c5a229 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1904,6 +1904,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -3455,10 +3455,10 @@ index 516d7fc7812aac343782861d0d567f54aa578c2a..00000000000000000000000000000000
|
||||
- // Spigot end
|
||||
-}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 3f9ed7dfb4633804fe86857dcc9f57aa8cf3ae37..e237c2d34cdbd9968eab4628bb1c0155554586e7 100644
|
||||
index e5a54a2f35d83f8c7a5f2b6512b86481aa7f9f51..c54d478035f7782074c00f870d41da8283fec538 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2407,7 +2407,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2346,7 +2346,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Deprecated // Paper
|
||||
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Player affects spawning API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index e237c2d34cdbd9968eab4628bb1c0155554586e7..081dbaebc0b209839d48ccbda85ae1a9ed0be439 100644
|
||||
index c54d478035f7782074c00f870d41da8283fec538..f21183cd5491b09e4543839252aed1ea10ddf849 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2259,6 +2259,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2198,6 +2198,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Deprecated // Paper
|
||||
public String getLocale();
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ 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 30dc2f85b60877930cab68230d3259ce92c08618..2867faf0acbbbb2e99c5b503f0c6bc83f3bfe80f 100644
|
||||
index 1403d28bf9124e3c4cd741dfda06400318e8a0a0..3559115d09b57acf5c2853b811862e5131f2a625 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -2745,6 +2745,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2663,6 +2663,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
int getSimulationDistance();
|
||||
// Spigot end
|
||||
|
||||
@@ -75,10 +75,10 @@ index 30dc2f85b60877930cab68230d3259ce92c08618..2867faf0acbbbb2e99c5b503f0c6bc83
|
||||
public class Spigot {
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 081dbaebc0b209839d48ccbda85ae1a9ed0be439..fa7637dd594821ffd20a53c6c7f5b3d9fa107564 100644
|
||||
index f21183cd5491b09e4543839252aed1ea10ddf849..f9b9e0269b3a9402c5be1c1c2007956415ff708a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2273,6 +2273,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -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);
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses
|
||||
Change Javadoc to be accurate
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 4c5671cf75143e741d945834a2a8b56cb52f20dd..3118da2ad367b5bd547769214112ea5299c95866 100644
|
||||
index 2a287fc77ef5cc6404dccdab01740e2b8b11ef43..9d1f1b97a16524ba1d523dd9130f113f0cf3e779 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -411,6 +411,30 @@ public final class Bukkit {
|
||||
@@ -41,7 +41,7 @@ index 4c5671cf75143e741d945834a2a8b56cb52f20dd..3118da2ad367b5bd547769214112ea52
|
||||
* Gets the name of the update folder. The update folder is used to safely
|
||||
* update plugins at the right moment on a plugin load.
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 7ee7fdc8379078456492da00bb213a0738cc6f08..d94483d1481f233897faf378e6b34b6b97f02caf 100644
|
||||
index e0ca9516051bc566da2783f0574e791166d5922c..38e3bc502e66229a24833ab1eebba6816155fa19 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -346,6 +346,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -76,10 +76,10 @@ index 7ee7fdc8379078456492da00bb213a0738cc6f08..d94483d1481f233897faf378e6b34b6b
|
||||
* Gets the name of the update folder. The update folder is used to safely
|
||||
* update plugins at the right moment on a plugin load.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index fa7637dd594821ffd20a53c6c7f5b3d9fa107564..944153f0d72c6ff5b7250e3d4b4591829deb16c2 100644
|
||||
index f9b9e0269b3a9402c5be1c1c2007956415ff708a..284bb156c4430a9a8afce0a7dffa96722b8c29cc 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1102,6 +1102,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1041,6 +1041,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public void sendMap(@NotNull MapView map);
|
||||
|
||||
|
||||
@@ -432,10 +432,10 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 944153f0d72c6ff5b7250e3d4b4591829deb16c2..2025cad529cf317384f6968b7fb65a555b0668c2 100644
|
||||
index 284bb156c4430a9a8afce0a7dffa96722b8c29cc..d5746291dd0cfc32591482945040e992ad1efb8e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1136,6 +1136,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1075,6 +1075,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||
spigot().sendMessage(position, components);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 2025cad529cf317384f6968b7fb65a555b0668c2..f2311a9842a4d7c45fc88b9f8ca485005a3b3352 100644
|
||||
index d5746291dd0cfc32591482945040e992ad1efb8e..e12d28143a213abdc0552a15e82cacecc414ca26 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1716,7 +1716,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1655,7 +1655,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException Thrown if the URL is null.
|
||||
* @throws IllegalArgumentException Thrown if the URL is too long. The
|
||||
* length restriction is an implementation specific arbitrary value.
|
||||
@@ -18,7 +18,7 @@ index 2025cad529cf317384f6968b7fb65a555b0668c2..f2311a9842a4d7c45fc88b9f8ca48500
|
||||
public void setResourcePack(@NotNull String url);
|
||||
|
||||
/**
|
||||
@@ -2563,6 +2565,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2502,6 +2504,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
|
||||
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.displayName())));
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add String based Action Bar API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index f2311a9842a4d7c45fc88b9f8ca485005a3b3352..05795d5e86c7427bb962144b66e43f68a9fa3ff3 100644
|
||||
index e12d28143a213abdc0552a15e82cacecc414ca26..3954f40b23536fec495585a8b14e82d092d62e39 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1103,6 +1103,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1042,6 +1042,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
public void sendMap(@NotNull MapView map);
|
||||
|
||||
// Paper start
|
||||
@@ -48,7 +48,7 @@ index f2311a9842a4d7c45fc88b9f8ca485005a3b3352..05795d5e86c7427bb962144b66e43f68
|
||||
/**
|
||||
* Sends the component to the player
|
||||
*
|
||||
@@ -1130,9 +1163,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1069,9 +1102,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
/**
|
||||
* Sends an array of components as a single message to the specified screen position of this player
|
||||
*
|
||||
|
||||
@@ -49,7 +49,7 @@ index a04cde615f8c4bc593f8d9f8f6f1438008aaa707..548f6d28c28d74bed8b58ee828759093
|
||||
* @param target the target to remove from this list
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 0ec7937572a28964123322f0cd2c060d4d69e42e..a1c8cb4d89147311539a70901c74eae4020c022f 100644
|
||||
index 8f9a19b1795ccddb7be268b72038cc236267821a..365c2cd4f5a3a382d3b52b50377fbf56731a30ae 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1464,6 +1464,8 @@ public final class Bukkit {
|
||||
@@ -75,7 +75,7 @@ index 0cf808356a1a5c6fc4bcf97a694ed9beb80a776a..dc765dea47a9a1c1520fb16ddb24f814
|
||||
* @return temperature at given coordinate
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index 369b95b1598a43bc53fb3ea4f69ebea18dc34308..656c060aee5d9ce778638253603ed9475a2612a1 100644
|
||||
index 02de62c083ceaa466c80cb732e8304b8cc3f07f8..7c2b1eff41dd43fda84d84e76c05bbbf37c186b8 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -158,7 +158,7 @@ public interface RegionAccessor {
|
||||
@@ -114,7 +114,7 @@ index 369b95b1598a43bc53fb3ea4f69ebea18dc34308..656c060aee5d9ce778638253603ed947
|
||||
* @param statePredicate The predicate which should get used to test if a block should be set or not.
|
||||
* @return true if the tree was created successfully, otherwise false
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 581955462495d63d07f2f461f45b1353e5b89c5b..95d1e6c57c3331ce3badfb5269531dce490d4079 100644
|
||||
index 86910935fa823f1e23cf1d89604d042c1c87fbc6..36d07fda939a5e1b4acf77d9092bfc42bbd27d78 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -544,13 +544,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -142,10 +142,10 @@ index 581955462495d63d07f2f461f45b1353e5b89c5b..95d1e6c57c3331ce3badfb5269531dce
|
||||
* @return an array containing all previous players
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index f5a398aa5f7a7e6280167fd723f78f4d72e2b1dd..faedd3857023513340b6e9fc67b78c79e3989cbe 100644
|
||||
index dbb799aed5bbb80edd2428b63d3fce15cf2e2f05..609e4908ed21f69b9e813500e702bbe784bff00c 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -2659,7 +2659,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2577,7 +2577,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
/**
|
||||
* Find the closest nearby structure of a given {@link StructureType}.
|
||||
* Finding unexplored structures can, and will, block if the world is
|
||||
@@ -154,7 +154,7 @@ index f5a398aa5f7a7e6280167fd723f78f4d72e2b1dd..faedd3857023513340b6e9fc67b78c79
|
||||
* temporarily freezing while locating an unexplored structure.
|
||||
* <p>
|
||||
* The {@code radius} is not a rigid square radius. Each structure may alter
|
||||
@@ -2693,7 +2693,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2611,7 +2611,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
/**
|
||||
* Find the closest nearby structure of a given {@link StructureType}.
|
||||
* Finding unexplored structures can, and will, block if the world is
|
||||
@@ -163,7 +163,7 @@ index f5a398aa5f7a7e6280167fd723f78f4d72e2b1dd..faedd3857023513340b6e9fc67b78c79
|
||||
* temporarily freezing while locating an unexplored structure.
|
||||
* <p>
|
||||
* The {@code radius} is not a rigid square radius. Each structure may alter
|
||||
@@ -2726,7 +2726,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2644,7 +2644,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
/**
|
||||
* Find the closest nearby structure of a given {@link Structure}. Finding
|
||||
* unexplored structures can, and will, block if the world is looking in
|
||||
@@ -386,7 +386,7 @@ index ae9eaaa8e38e1d9dfc459926c7fc51ddb89de84a..b2ec535bb1b0ce0c114ddd7638b90218
|
||||
@Override
|
||||
public int getConversionTime();
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 05795d5e86c7427bb962144b66e43f68a9fa3ff3..74823885b0836db404737199b21c09c1ebcbad3c 100644
|
||||
index 3954f40b23536fec495585a8b14e82d092d62e39..264c6bdeb2f1f0d937e4356d761a3264a1c4d58a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -431,15 +431,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -409,7 +409,7 @@ index 05795d5e86c7427bb962144b66e43f68a9fa3ff3..74823885b0836db404737199b21c09c1
|
||||
* <p>
|
||||
* Note: This will overwrite the players current inventory, health,
|
||||
* motion, etc, with the state from the saved dat file.
|
||||
@@ -735,7 +735,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -674,7 +674,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
/**
|
||||
* Plays an effect to just this player.
|
||||
*
|
||||
@@ -418,7 +418,7 @@ index 05795d5e86c7427bb962144b66e43f68a9fa3ff3..74823885b0836db404737199b21c09c1
|
||||
* @param loc the location to play the effect at
|
||||
* @param effect the {@link Effect}
|
||||
* @param data a data bit needed for some effects
|
||||
@@ -1120,7 +1120,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1059,7 +1059,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* Use supplied alternative character to the section symbol to represent legacy color codes.
|
||||
*
|
||||
@@ -427,7 +427,7 @@ index 05795d5e86c7427bb962144b66e43f68a9fa3ff3..74823885b0836db404737199b21c09c1
|
||||
* @param message The message to send
|
||||
* @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
|
||||
*/
|
||||
@@ -1586,7 +1586,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1525,7 +1525,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
|
||||
/**
|
||||
* Allows this player to see a player that was previously hidden. If
|
||||
@@ -436,7 +436,7 @@ index 05795d5e86c7427bb962144b66e43f68a9fa3ff3..74823885b0836db404737199b21c09c1
|
||||
* remain hidden until the other plugin calls this method too.
|
||||
*
|
||||
* @param plugin Plugin that wants to show the player
|
||||
@@ -1615,7 +1615,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1554,7 +1554,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
|
||||
/**
|
||||
* Allows this player to see an entity that was previously hidden. If
|
||||
|
||||
@@ -10,10 +10,10 @@ of giving the player experience points.
|
||||
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 0da374b18e0f602e9836cfaefe07c5219a7d9bd1..e6b4347fc7e14971b8c975f19ff389fdafa16723 100644
|
||||
index f9239eae50b86f54f0cd8c604d2ba9468fc5f33b..9dca8fc727b727063d9ca50fdd8f6452173a5cd4 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1429,6 +1429,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1368,6 +1368,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public void resetPlayerWeather();
|
||||
|
||||
@@ -29,7 +29,7 @@ index 0da374b18e0f602e9836cfaefe07c5219a7d9bd1..e6b4347fc7e14971b8c975f19ff389fd
|
||||
/**
|
||||
* Gets the player's cooldown between picking up experience orbs.
|
||||
*
|
||||
@@ -1454,8 +1463,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1393,8 +1402,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* Gives the player the amount of experience specified.
|
||||
*
|
||||
* @param amount Exp amount to give
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API
|
||||
This can be useful for changing name or skins after a player has logged in.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 8f1f432c9d6c68ac142401626adaf1dc212181f2..8c430623204d419a93ccc67a0214942952f4a33c 100644
|
||||
index 87ce6947a1e974c18e84f56ba622bee9fff3570b..0dfb60e4635cc960b5cb481206b6c02adb36d7f9 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1306,8 +1306,10 @@ public final class Bukkit {
|
||||
@@ -56,7 +56,7 @@ index bec480aff819e09220b52175cab0cb6d68ae68c6..12349910297a75c00e64f6ccc7981aee
|
||||
/**
|
||||
* Checks if this player has had their profile banned.
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index aad8b2fbdbb03fbf32f99b3a533716eca9d42219..405b6a388c3593a83985f766e79b92951006563e 100644
|
||||
index bc68d8af8b38232392a12ef5f338e85ca80bccd0..ccc1142e496c33c70104646255bae98d43a6b6c2 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1119,8 +1119,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -93,10 +93,10 @@ index aad8b2fbdbb03fbf32f99b3a533716eca9d42219..405b6a388c3593a83985f766e79b9295
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index e6b4347fc7e14971b8c975f19ff389fdafa16723..43ba9fbec2060786fe1cb24025adc697a88b8678 100644
|
||||
index 9dca8fc727b727063d9ca50fdd8f6452173a5cd4..ccd80734cf5641455fd9d9b63238739987e225da 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2739,6 +2739,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2678,6 +2678,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}
|
||||
*/
|
||||
boolean hasResourcePack();
|
||||
|
||||
@@ -36,10 +36,10 @@ index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f
|
||||
/**
|
||||
* Make the entity drop the item in their hand.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 43ba9fbec2060786fe1cb24025adc697a88b8678..67d253239b86a120162e7fcc56a345b5ebb88ba9 100644
|
||||
index ccd80734cf5641455fd9d9b63238739987e225da..bca4794a67c369b0bb882e56f489ed952488b2c5 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2584,10 +2584,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2523,10 +2523,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
/**
|
||||
* Open a Sign for editing by the Player.
|
||||
*
|
||||
|
||||
@@ -74,10 +74,10 @@ index 12349910297a75c00e64f6ccc7981aeeeb43ecd3..8f2f3e0ac5266f571b62a754921422bb
|
||||
/**
|
||||
* Adds this user to the {@link ProfileBanList}. If a previous ban exists, this will
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 67d253239b86a120162e7fcc56a345b5ebb88ba9..e13d09c5d4c62d47f6f4e057a23caea3ed18496a 100644
|
||||
index bca4794a67c369b0bb882e56f489ed952488b2c5..a851ec4d350ce442eb01385d21ca75e695cf09d2 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1103,6 +1103,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1042,6 +1042,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
public void sendMap(@NotNull MapView map);
|
||||
|
||||
// Paper start
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's
|
||||
Provides more methods to get nearby entities, and filter by types and predicates
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f3262ee75 100644
|
||||
index 609e4908ed21f69b9e813500e702bbe784bff00c..7a6caf93606203198369030a295f1edbffde3c31 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -1,6 +1,9 @@
|
||||
@@ -19,19 +19,20 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -625,6 +628,238 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -625,6 +628,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@NotNull
|
||||
public Collection<Entity> getEntitiesByClasses(@NotNull Class<?>... classes);
|
||||
|
||||
+ // Paper start - additional getNearbyEntities API
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets nearby LivingEntities within the specified radius (bounding box)
|
||||
+ * @param loc Center location
|
||||
+ * @param radius Radius
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<LivingEntity> getNearbyLivingEntities(final @NotNull Location loc, final double radius) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, loc, radius, radius, radius);
|
||||
+ @NotNull
|
||||
+ public default Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double radius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -41,8 +42,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param yRadius Y Radius
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<LivingEntity> getNearbyLivingEntities(final @NotNull Location loc, final double xzRadius, final double yRadius) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, loc, xzRadius, yRadius, xzRadius);
|
||||
+ @NotNull
|
||||
+ public default Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double xzRadius, double yRadius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -53,8 +55,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param zRadius Z radius
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<LivingEntity> getNearbyLivingEntities(final @NotNull Location loc, final double xRadius, final double yRadius, final double zRadius) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, loc, xRadius, yRadius, zRadius);
|
||||
+ @NotNull
|
||||
+ public default Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double xRadius, double yRadius, double zRadius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -64,8 +67,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection
|
||||
+ */
|
||||
+ default @NotNull Collection<LivingEntity> getNearbyLivingEntities(final @NotNull Location loc, final double radius, final @Nullable Predicate<? super LivingEntity> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, loc, radius, radius, radius, predicate);
|
||||
+ @NotNull
|
||||
+ public default Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double radius, @Nullable Predicate<LivingEntity> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -76,8 +80,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection
|
||||
+ */
|
||||
+ default @NotNull Collection<LivingEntity> getNearbyLivingEntities(final @NotNull Location loc, final double xzRadius, final double yRadius, final @Nullable Predicate<? super LivingEntity> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, loc, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public default Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate<LivingEntity> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -89,8 +94,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<LivingEntity> getNearbyLivingEntities(final @NotNull Location loc, final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super LivingEntity> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, loc, xRadius, yRadius, zRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public default Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate<LivingEntity> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -99,8 +105,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param radius X/Y/Z Radius
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<Player> getNearbyPlayers(final @NotNull Location loc, final double radius) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, loc, radius, radius, radius);
|
||||
+ @NotNull
|
||||
+ public default Collection<Player> getNearbyPlayers(@NotNull Location loc, double radius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -110,8 +117,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param yRadius Y Radius
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<Player> getNearbyPlayers(final @NotNull Location loc, final double xzRadius, final double yRadius) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, loc, xzRadius, yRadius, xzRadius);
|
||||
+ @NotNull
|
||||
+ public default Collection<Player> getNearbyPlayers(@NotNull Location loc, double xzRadius, double yRadius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -122,8 +130,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param zRadius Z Radius
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<Player> getNearbyPlayers(final @NotNull Location loc, final double xRadius, final double yRadius, final double zRadius) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, loc, xRadius, yRadius, zRadius);
|
||||
+ @NotNull
|
||||
+ public default Collection<Player> getNearbyPlayers(@NotNull Location loc, double xRadius, double yRadius, double zRadius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -133,8 +142,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<Player> getNearbyPlayers(final @NotNull Location loc, final double radius, final @Nullable Predicate<? super Player> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, loc, radius, radius, radius, predicate);
|
||||
+ @NotNull
|
||||
+ public default Collection<Player> getNearbyPlayers(@NotNull Location loc, double radius, @Nullable Predicate<Player> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -145,8 +155,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<Player> getNearbyPlayers(final @NotNull Location loc, final double xzRadius, final double yRadius, final @Nullable Predicate<? super Player> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, loc, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public default Collection<Player> getNearbyPlayers(@NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate<Player> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -158,8 +169,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull Collection<Player> getNearbyPlayers(final @NotNull Location loc, final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super Player> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, loc, xRadius, yRadius, zRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public default Collection<Player> getNearbyPlayers(@NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate<Player> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -170,8 +182,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final @NotNull Location loc, final double radius) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, loc, radius, radius, radius, null);
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double radius) {
|
||||
+ return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -183,8 +196,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final @NotNull Location loc, final double xzRadius, final double yRadius) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, null);
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double xzRadius, double yRadius) {
|
||||
+ return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -197,8 +211,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final @NotNull Location loc, final double xRadius, final double yRadius, final double zRadius) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, loc, xRadius, yRadius, zRadius, null);
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double xRadius, double yRadius, double zRadius) {
|
||||
+ return getNearbyEntitiesByType(clazz, loc, xRadius, yRadius, zRadius, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -210,8 +225,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final @NotNull Location loc, final double radius, final @Nullable Predicate<? super T> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, loc, radius, radius, radius, predicate);
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double radius, @Nullable Predicate<T> predicate) {
|
||||
+ return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -224,8 +240,9 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final @NotNull Location loc, final double xzRadius, final double yRadius, final @Nullable Predicate<? super T> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate<T> predicate) {
|
||||
+ return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -239,12 +256,13 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends Entity> clazz, final @NotNull Location loc, final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super T> predicate) {
|
||||
+ if (clazz == null) {
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends Entity> clazz, @NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate<T> predicate) {
|
||||
+ if (clazz == null) {
|
||||
+ clazz = Entity.class;
|
||||
+ }
|
||||
+ final List<T> nearby = new ArrayList<>();
|
||||
+ for (final Entity bukkitEntity : this.getNearbyEntities(loc, xRadius, yRadius, zRadius)) {
|
||||
+ List<T> nearby = new ArrayList<>();
|
||||
+ for (Entity bukkitEntity : getNearbyEntities(loc, xRadius, yRadius, zRadius)) {
|
||||
+ //noinspection unchecked
|
||||
+ if (clazz.isAssignableFrom(bukkitEntity.getClass()) && (predicate == null || predicate.test((T) bukkitEntity))) {
|
||||
+ //noinspection unchecked
|
||||
@@ -253,7 +271,7 @@ index 609e4908ed21f69b9e813500e702bbe784bff00c..a5be4e073d3406e876e54824aca5449f
|
||||
+ }
|
||||
+ return nearby;
|
||||
+ }
|
||||
+ // Paper end - additional getNearbyEntities API
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Get a list of all players in this World
|
||||
|
||||
@@ -523,10 +523,10 @@ index e2adb9901cc92ede9d44ca9939c6a54d4762eb4b..81bd12c8addcee754c71e5e030c729c7
|
||||
* Options which can be applied to redstone dust particles - a particle
|
||||
* color and size.
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 58a15d8fd57d55848b37bfc8fffa101692efce87..93c46d40efd73293d84c7eaadf4e360cc3706e2a 100644
|
||||
index 7a6caf93606203198369030a295f1edbffde3c31..3e7385d21380abcd40649045e4666cf4bed32195 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -2841,7 +2841,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2777,7 +2777,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
*/
|
||||
|
||||
@@ -6,15 +6,15 @@ Subject: [PATCH] Location.toBlockLocation/toCenterLocation()
|
||||
Convert location objects to their block coordinates, or the center of the block
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 251d26e6870490abd3e915c5e7c06ce1075a24ab..24a872dfc8cf1f4a567b6ebd5a5e742593616ede 100644
|
||||
index e71beb48f2e35d97b9d5bf8dbf5ddbc0673565fe..5a219f132747eb62204e98de4cb850748a43c9b4 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -534,6 +534,32 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
@@ -534,6 +534,31 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
}
|
||||
|
||||
public boolean isChunkLoaded() { return this.getWorld().isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
|
||||
+
|
||||
+ // Paper start - expand Location API
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * @return A new location where X/Y/Z are on the Block location (integer value of X/Y/Z)
|
||||
+ */
|
||||
@@ -37,8 +37,7 @@ index 251d26e6870490abd3e915c5e7c06ce1075a24ab..24a872dfc8cf1f4a567b6ebd5a5e7425
|
||||
+ centerLoc.setZ(getBlockZ() + 0.5);
|
||||
+ return centerLoc;
|
||||
+ }
|
||||
+ // Paper end - expand Location API
|
||||
+
|
||||
+ // Paper end
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add "getNearbyXXX" methods to Location
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c15cf568c6 100644
|
||||
index 5a219f132747eb62204e98de4cb850748a43c9b4..6693e3d8dc2519facb12db981a6b6325faa095bf 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -12,6 +12,15 @@ import org.bukkit.util.Vector;
|
||||
@@ -24,23 +24,24 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
/**
|
||||
* Represents a 3-dimensional position in a world.
|
||||
* <br>
|
||||
@@ -560,6 +569,231 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
@@ -558,6 +567,248 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
centerLoc.setZ(getBlockZ() + 0.5);
|
||||
return centerLoc;
|
||||
}
|
||||
// Paper end - expand Location API
|
||||
|
||||
+ // Paper start - additional getNearbyEntities API
|
||||
+
|
||||
+ /**
|
||||
+ * Returns a list of entities within a bounding box centered around a Location.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * Some implementations may impose artificial restrictions on the size of the search bounding box.
|
||||
+ *
|
||||
+ * @param x 1/2 the size of the box along the x-axis
|
||||
+ * @param y 1/2 the size of the box along the y-axis
|
||||
+ * @param z 1/2 the size of the box along the z-axis
|
||||
+ * @param x 1/2 the size of the box along x axis
|
||||
+ * @param y 1/2 the size of the box along y axis
|
||||
+ * @param z 1/2 the size of the box along z axis
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<Entity> getNearbyEntities(final double x, final double y, final double z) {
|
||||
+ final World world = this.getWorld();
|
||||
+ @NotNull
|
||||
+ public Collection<Entity> getNearbyEntities(double x, double y, double z) {
|
||||
+ World world = this.getWorld();
|
||||
+ if (world == null) {
|
||||
+ throw new IllegalArgumentException("Location has no world");
|
||||
+ }
|
||||
@@ -52,8 +53,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param radius X Radius
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<LivingEntity> getNearbyLivingEntities(final double radius) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, radius, radius, radius);
|
||||
+ @NotNull
|
||||
+ public Collection<LivingEntity> getNearbyLivingEntities(double radius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -62,8 +64,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param yRadius Y Radius
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<LivingEntity> getNearbyLivingEntities(final double xzRadius, final double yRadius) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, xzRadius, yRadius, xzRadius);
|
||||
+ @NotNull
|
||||
+ public Collection<LivingEntity> getNearbyLivingEntities(double xzRadius, double yRadius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -73,8 +76,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param zRadius Z radius
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<LivingEntity> getNearbyLivingEntities(final double xRadius, final double yRadius, final double zRadius) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, xRadius, yRadius, zRadius);
|
||||
+ @NotNull
|
||||
+ public Collection<LivingEntity> getNearbyLivingEntities(double xRadius, double yRadius, double zRadius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -83,8 +87,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<LivingEntity> getNearbyLivingEntities(final double radius, final @Nullable Predicate<? super LivingEntity> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, radius, radius, radius, predicate);
|
||||
+ @NotNull
|
||||
+ public Collection<LivingEntity> getNearbyLivingEntities(double radius, @Nullable Predicate<LivingEntity> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -94,8 +99,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<LivingEntity> getNearbyLivingEntities(final double xzRadius, final double yRadius, final @Nullable Predicate<? super LivingEntity> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public Collection<LivingEntity> getNearbyLivingEntities(double xzRadius, double yRadius, @Nullable Predicate<LivingEntity> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -106,8 +112,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of living entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<LivingEntity> getNearbyLivingEntities(final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super LivingEntity> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(LivingEntity.class, xRadius, yRadius, zRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public Collection<LivingEntity> getNearbyLivingEntities(double xRadius, double yRadius, double zRadius, @Nullable Predicate<LivingEntity> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -115,8 +122,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param radius X/Y/Z Radius
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<Player> getNearbyPlayers(final double radius) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, radius, radius, radius);
|
||||
+ @NotNull
|
||||
+ public Collection<Player> getNearbyPlayers(double radius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -125,8 +133,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param yRadius Y Radius
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<Player> getNearbyPlayers(final double xzRadius, final double yRadius) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, xzRadius, yRadius, xzRadius);
|
||||
+ @NotNull
|
||||
+ public Collection<Player> getNearbyPlayers(double xzRadius, double yRadius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -136,8 +145,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param zRadius Z Radius
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<Player> getNearbyPlayers(final double xRadius, final double yRadius, final double zRadius) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, xRadius, yRadius, zRadius);
|
||||
+ @NotNull
|
||||
+ public Collection<Player> getNearbyPlayers(double xRadius, double yRadius, double zRadius) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -146,8 +156,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<Player> getNearbyPlayers(final double radius, final @Nullable Predicate<? super Player> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, radius, radius, radius, predicate);
|
||||
+ @NotNull
|
||||
+ public Collection<Player> getNearbyPlayers(double radius, @Nullable Predicate<Player> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -157,8 +168,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<Player> getNearbyPlayers(final double xzRadius, final double yRadius, final @Nullable Predicate<? super Player> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public Collection<Player> getNearbyPlayers(double xzRadius, double yRadius, @Nullable Predicate<Player> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -169,8 +181,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param predicate a predicate used to filter results
|
||||
+ * @return the collection of players near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull Collection<Player> getNearbyPlayers(final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super Player> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(Player.class, xRadius, yRadius, zRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public Collection<Player> getNearbyPlayers(double xRadius, double yRadius, double zRadius, @Nullable Predicate<Player> predicate) {
|
||||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -180,8 +193,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities of type clazz near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final double radius) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, radius, radius, radius, null);
|
||||
+ @NotNull
|
||||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double radius) {
|
||||
+ return getNearbyEntitiesByType(clazz, radius, radius, radius, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -192,8 +206,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final double xzRadius, final double yRadius) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, null);
|
||||
+ @NotNull
|
||||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double xzRadius, double yRadius) {
|
||||
+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -205,8 +220,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final double xRadius, final double yRadius, final double zRadius) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, xRadius, yRadius, zRadius, null);
|
||||
+ @NotNull
|
||||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double xRadius, double yRadius, double zRadius) {
|
||||
+ return getNearbyEntitiesByType(clazz, xRadius, yRadius, zRadius, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -217,8 +233,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final double radius, final @Nullable Predicate<? super T> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, radius, radius, radius, predicate);
|
||||
+ @NotNull
|
||||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double radius, @Nullable Predicate<T> predicate) {
|
||||
+ return getNearbyEntitiesByType(clazz, radius, radius, radius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -230,8 +247,9 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final double xzRadius, final double yRadius, final @Nullable Predicate<? super T> predicate) {
|
||||
+ return this.getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ @NotNull
|
||||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double xzRadius, double yRadius, @Nullable Predicate<T> predicate) {
|
||||
+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, predicate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -244,15 +262,14 @@ index 24a872dfc8cf1f4a567b6ebd5a5e742593616ede..3161eae2fa5f03b7d3a5e9945ab659c1
|
||||
+ * @param <T> the entity type
|
||||
+ * @return the collection of entities near location. This will always be a non-null collection.
|
||||
+ */
|
||||
+ public @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends Entity> clazz, final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super T> predicate) {
|
||||
+ final World world = this.getWorld();
|
||||
+ @NotNull
|
||||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends Entity> clazz, double xRadius, double yRadius, double zRadius, @Nullable Predicate<T> predicate) {
|
||||
+ World world = this.getWorld();
|
||||
+ if (world == null) {
|
||||
+ throw new IllegalArgumentException("Location has no world");
|
||||
+ }
|
||||
+ return world.getNearbyEntitiesByType(clazz, this, xRadius, yRadius, zRadius, predicate);
|
||||
+ }
|
||||
+ // Paper end - additional getNearbyEntities API
|
||||
+
|
||||
// Paper end
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Expand Explosions API
|
||||
Add Entity as a Source capability, and add more API choices, and on Location.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cefa07f59c1 100644
|
||||
index 6693e3d8dc2519facb12db981a6b6325faa095bf..b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -7,6 +7,7 @@ import java.util.HashMap;
|
||||
@@ -17,14 +17,14 @@ index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cef
|
||||
import org.bukkit.util.NumberConversions;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -569,6 +570,89 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
@@ -568,6 +569,89 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
return centerLoc;
|
||||
}
|
||||
// Paper end - expand Location API
|
||||
|
||||
+ // Paper start - Expand Explosions API
|
||||
+ /**
|
||||
+ * Creates explosion at this location with given power
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * Will break blocks and ignite blocks on fire.
|
||||
+ *
|
||||
+ * @param power The power of explosion, where 4F is TNT
|
||||
@@ -37,11 +37,11 @@ index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cef
|
||||
+ /**
|
||||
+ * Creates explosion at this location with given power and optionally
|
||||
+ * setting blocks on fire.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * Will break blocks.
|
||||
+ *
|
||||
+ * @param power The power of explosion, where 4F is TNT
|
||||
+ * @param setFire Whether to set blocks on fire
|
||||
+ * @param setFire Whether or not to set blocks on fire
|
||||
+ * @return false if explosion was canceled, otherwise true
|
||||
+ */
|
||||
+ public boolean createExplosion(float power, boolean setFire) {
|
||||
@@ -53,8 +53,8 @@ index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cef
|
||||
+ * setting blocks on fire.
|
||||
+ *
|
||||
+ * @param power The power of explosion, where 4F is TNT
|
||||
+ * @param setFire Whether to set blocks on fire
|
||||
+ * @param breakBlocks Whether to have blocks be destroyed
|
||||
+ * @param setFire Whether or not to set blocks on fire
|
||||
+ * @param breakBlocks Whether or not to have blocks be destroyed
|
||||
+ * @return false if explosion was canceled, otherwise true
|
||||
+ */
|
||||
+ public boolean createExplosion(float power, boolean setFire, boolean breakBlocks) {
|
||||
@@ -63,7 +63,7 @@ index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cef
|
||||
+
|
||||
+ /**
|
||||
+ * Creates explosion at this location with given power, with the specified entity as the source.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * Will break blocks and ignite blocks on fire.
|
||||
+ *
|
||||
+ * @param source The source entity of the explosion
|
||||
@@ -77,12 +77,12 @@ index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cef
|
||||
+ /**
|
||||
+ * Creates explosion at this location with given power and optionally
|
||||
+ * setting blocks on fire, with the specified entity as the source.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * Will break blocks.
|
||||
+ *
|
||||
+ * @param source The source entity of the explosion
|
||||
+ * @param power The power of explosion, where 4F is TNT
|
||||
+ * @param setFire Whether to set blocks on fire
|
||||
+ * @param setFire Whether or not to set blocks on fire
|
||||
+ * @return false if explosion was canceled, otherwise true
|
||||
+ */
|
||||
+ public boolean createExplosion(@Nullable Entity source, float power, boolean setFire) {
|
||||
@@ -95,8 +95,8 @@ index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cef
|
||||
+ *
|
||||
+ * @param source The source entity of the explosion
|
||||
+ * @param power The power of explosion, where 4F is TNT
|
||||
+ * @param setFire Whether to set blocks on fire
|
||||
+ * @param breakBlocks Whether to have blocks be destroyed
|
||||
+ * @param setFire Whether or not to set blocks on fire
|
||||
+ * @param breakBlocks Whether or not to have blocks be destroyed
|
||||
+ * @return false if explosion was canceled, otherwise true
|
||||
+ */
|
||||
+ public boolean createExplosion(@Nullable Entity source, float power, boolean setFire, boolean breakBlocks) {
|
||||
@@ -104,14 +104,14 @@ index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cef
|
||||
+ }
|
||||
+ // Paper end - Expand Explosions API
|
||||
+
|
||||
// Paper start - additional getNearbyEntities API
|
||||
/**
|
||||
* Returns a list of entities within a bounding box centered around a Location.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 93c46d40efd73293d84c7eaadf4e360cc3706e2a..cd946f2de8a09fdb6ff9b256ca7eba64e6ed9aab 100644
|
||||
index 3e7385d21380abcd40649045e4666cf4bed32195..266ed71b79d32f9b812be322563c247051ccd9d0 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -1380,6 +1380,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -1392,6 +1392,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*/
|
||||
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire);
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add World.getEntity(UUID) API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index c0e45f4c964ae262a894d92cff8f0750660cd41d..17b9e695a3f2eab94714b2124c657ee4d8b5ef51 100644
|
||||
index 266ed71b79d32f9b812be322563c247051ccd9d0..ffe6c8be86fc93d39e256a89e5016e3025afbe5c 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -894,6 +894,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -912,6 +912,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@NotNull
|
||||
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z);
|
||||
|
||||
|
||||
@@ -6,20 +6,18 @@ Subject: [PATCH] Expand Location Manipulation API
|
||||
Adds set(x, y, z), add(base, x, y, z), subtract(base, x, y, z);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 14aa275b0fb89d361ee5ec690684053e5e8b4e11..189c2159941712a6f22bb5aaf1e8ca80b4eb54f6 100644
|
||||
index b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde..aa6821aa33d3c579a139bd7c0378253c43b3754a 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -545,6 +545,59 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
@@ -546,6 +546,54 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
public boolean isChunkLoaded() { return this.getWorld().isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
|
||||
|
||||
+ // Paper start - expand location manipulation API
|
||||
// Paper start
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the position of this Location and returns itself
|
||||
+ * <p>
|
||||
+ * This mutates this object, clone first.
|
||||
+ *
|
||||
+ * This mutates this object, clone first.
|
||||
+ * @param x X coordinate
|
||||
+ * @param y Y coordinate
|
||||
+ * @param z Z coordinate
|
||||
@@ -35,9 +33,8 @@ index 14aa275b0fb89d361ee5ec690684053e5e8b4e11..189c2159941712a6f22bb5aaf1e8ca80
|
||||
+
|
||||
+ /**
|
||||
+ * Takes the x/y/z from base and adds the specified x/y/z to it and returns self
|
||||
+ * <p>
|
||||
+ * This mutates this object, clone first.
|
||||
+ *
|
||||
+ * This mutates this object, clone first.
|
||||
+ * @param base The base coordinate to modify
|
||||
+ * @param x X coordinate to add to base
|
||||
+ * @param y Y coordinate to add to base
|
||||
@@ -51,9 +48,8 @@ index 14aa275b0fb89d361ee5ec690684053e5e8b4e11..189c2159941712a6f22bb5aaf1e8ca80
|
||||
+
|
||||
+ /**
|
||||
+ * Takes the x/y/z from base and subtracts the specified x/y/z to it and returns self
|
||||
+ * <p>
|
||||
+ * This mutates this object, clone first.
|
||||
+ *
|
||||
+ * This mutates this object, clone first.
|
||||
+ * @param base The base coordinate to modify
|
||||
+ * @param x X coordinate to subtract from base
|
||||
+ * @param y Y coordinate to subtract from base
|
||||
@@ -64,8 +60,7 @@ index 14aa275b0fb89d361ee5ec690684053e5e8b4e11..189c2159941712a6f22bb5aaf1e8ca80
|
||||
+ public Location subtract(@NotNull Location base, double x, double y, double z) {
|
||||
+ return this.set(base.x - x, base.y - y, base.z - z);
|
||||
+ }
|
||||
+ // Paper end - expand location manipulation API
|
||||
+
|
||||
// Paper start - expand Location API
|
||||
/**
|
||||
* @return A new location where X/Y/Z are on the Block location (integer value of X/Y/Z)
|
||||
*/
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
|
||||
index 766d643f0fe79660942fdad25e39e488e9379419..eca55d8d3464f0e13a3b7984f74559ccda87edba 100644
|
||||
index 766d643f0fe79660942fdad25e39e488e9379419..4418c41f75e9a190dd77abdd6048b0a4fb2a57ed 100644
|
||||
--- a/src/main/java/org/bukkit/Chunk.java
|
||||
+++ b/src/main/java/org/bukkit/Chunk.java
|
||||
@@ -122,7 +122,30 @@ public interface Chunk extends PersistentDataHolder {
|
||||
@@ -35,7 +35,7 @@ index 766d643f0fe79660942fdad25e39e488e9379419..eca55d8d3464f0e13a3b7984f74559cc
|
||||
+ * @return The tile entities.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ Collection<BlockState> getTileEntities(java.util.function.@NotNull Predicate<? super Block> blockPredicate, boolean useSnapshot);
|
||||
+ Collection<BlockState> getTileEntities(java.util.function.@NotNull Predicate<Block> blockPredicate, boolean useSnapshot);
|
||||
+ // Paper end
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@ Y range: [0, 1023]
|
||||
X, Z range: [-67 108 864, 67 108 863]
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 189c2159941712a6f22bb5aaf1e8ca80b4eb54f6..09d1f9f909c971d6a785e9f98278f8c55cd44637 100644
|
||||
index aa6821aa33d3c579a139bd7c0378253c43b3754a..6e6e65c40813ccce618fa7a3df2c0030aa0a3bbe 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -15,7 +15,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -29,7 +29,7 @@ index 189c2159941712a6f22bb5aaf1e8ca80b4eb54f6..09d1f9f909c971d6a785e9f98278f8c5
|
||||
import java.util.function.Predicate;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@@ -610,6 +609,19 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
@@ -605,6 +604,19 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
blockLoc.setZ(getBlockZ());
|
||||
return blockLoc;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ index 189c2159941712a6f22bb5aaf1e8ca80b4eb54f6..09d1f9f909c971d6a785e9f98278f8c5
|
||||
* @return A new location where X/Y/Z are the center of the block
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index f21d3ab534a64a5445975968b63fc78d7dc2fa72..fef21d398d9c9349e10e59b62cbbe28e9538482d 100644
|
||||
index 315ecb5dc0f33edfef893ead1297c8165d292250..ad5afa7a05636cee82b517c673d281f0f4e38644 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -97,6 +97,41 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] isChunkGenerated API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 09d1f9f909c971d6a785e9f98278f8c55cd44637..7fea9af96c97d9f60af6fe30fed1ec05d05a1a25 100644
|
||||
index 6e6e65c40813ccce618fa7a3df2c0030aa0a3bbe..8508aa2c6fb7c9f41f3d185f5228c86dd3b8b627 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -3,6 +3,7 @@ package org.bukkit;
|
||||
@@ -16,11 +16,10 @@ index 09d1f9f909c971d6a785e9f98278f8c55cd44637..7fea9af96c97d9f60af6fe30fed1ec05
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -544,6 +545,19 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
@@ -545,6 +546,16 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
public boolean isChunkLoaded() { return this.getWorld().isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
|
||||
|
||||
+ // Paper start - isGenerated API
|
||||
// Paper start
|
||||
+ /**
|
||||
+ * Checks if a {@link Chunk} has been generated at this location.
|
||||
+ *
|
||||
@@ -31,13 +30,11 @@ index 09d1f9f909c971d6a785e9f98278f8c55cd44637..7fea9af96c97d9f60af6fe30fed1ec05
|
||||
+ Preconditions.checkNotNull(world, "Location has no world!");
|
||||
+ return world.isChunkGenerated(locToBlock(x) >> 4, locToBlock(z) >> 4);
|
||||
+ }
|
||||
+ // Paper end - isGenerated API
|
||||
+
|
||||
// Paper start - expand location manipulation API
|
||||
|
||||
/**
|
||||
* Sets the position of this Location and returns itself
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index fef21d398d9c9349e10e59b62cbbe28e9538482d..213ec372ab639179da65e67a1326c1e08bfbc943 100644
|
||||
index ad5afa7a05636cee82b517c673d281f0f4e38644..880ff5ee1237096ac2da115b665dc663c677e57b 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -246,6 +246,19 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
@@ -8,14 +8,14 @@ Adds API's to load or generate chunks asynchronously.
|
||||
Also adds utility methods to Entity to teleport asynchronously.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d0478a28ee5 100644
|
||||
index 880ff5ee1237096ac2da115b665dc663c677e57b..fc6b99e4f37179b15254bf0b398b1a800de1b73f 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -939,6 +939,472 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -955,6 +955,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
}
|
||||
return nearby;
|
||||
}
|
||||
// Paper end - additional getNearbyEntities API
|
||||
|
||||
+ // Paper start - async chunks API
|
||||
+
|
||||
+ /**
|
||||
+ * This is the Legacy API before Java 8 was supported. Java 8 Consumer is provided,
|
||||
+ * as well as future support
|
||||
@@ -139,8 +139,8 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param cb Callback to receive the chunk when it is loaded.
|
||||
+ * will be executed synchronously
|
||||
+ */
|
||||
+ default void getChunkAtAsync(final int x, final int z, final @NotNull Consumer<? super Chunk> cb) {
|
||||
+ this.getChunkAtAsync(x, z, true).thenAccept(cb).exceptionally((ex) -> {
|
||||
+ public default void getChunkAtAsync(int x, int z, @NotNull java.util.function.Consumer<Chunk> cb) {
|
||||
+ getChunkAtAsync(x, z, true).thenAccept(cb).exceptionally((ex) -> {
|
||||
+ Bukkit.getLogger().log(java.util.logging.Level.WARNING, "Exception in chunk load callback", ex);
|
||||
+ return null;
|
||||
+ });
|
||||
@@ -165,8 +165,8 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param cb Callback to receive the chunk when it is loaded.
|
||||
+ * will be executed synchronously
|
||||
+ */
|
||||
+ default void getChunkAtAsync(final int x, final int z, final boolean gen, final @NotNull Consumer<? super Chunk> cb) {
|
||||
+ this.getChunkAtAsync(x, z, gen).thenAccept(cb).exceptionally((ex) -> {
|
||||
+ public default void getChunkAtAsync(int x, int z, boolean gen, @NotNull java.util.function.Consumer<Chunk> cb) {
|
||||
+ getChunkAtAsync(x, z, gen).thenAccept(cb).exceptionally((ex) -> {
|
||||
+ Bukkit.getLogger().log(java.util.logging.Level.WARNING, "Exception in chunk load callback", ex);
|
||||
+ return null;
|
||||
+ });
|
||||
@@ -189,8 +189,8 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param cb Callback to receive the chunk when it is loaded.
|
||||
+ * will be executed synchronously
|
||||
+ */
|
||||
+ default void getChunkAtAsync(final @NotNull Location loc, final @NotNull Consumer<? super Chunk> cb) {
|
||||
+ this.getChunkAtAsync((int) Math.floor(loc.getX()) >> 4, (int) Math.floor(loc.getZ()) >> 4, true, cb);
|
||||
+ public default void getChunkAtAsync(@NotNull Location loc, @NotNull java.util.function.Consumer<Chunk> cb) {
|
||||
+ getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, true, cb);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -211,8 +211,8 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param cb Callback to receive the chunk when it is loaded.
|
||||
+ * will be executed synchronously
|
||||
+ */
|
||||
+ default void getChunkAtAsync(final @NotNull Location loc, final boolean gen, final @NotNull Consumer<? super Chunk> cb) {
|
||||
+ this.getChunkAtAsync((int) Math.floor(loc.getX()) >> 4, (int) Math.floor(loc.getZ()) >> 4, gen, cb);
|
||||
+ public default void getChunkAtAsync(@NotNull Location loc, boolean gen, @NotNull java.util.function.Consumer<Chunk> cb) {
|
||||
+ getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, gen, cb);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -232,8 +232,8 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param cb Callback to receive the chunk when it is loaded.
|
||||
+ * will be executed synchronously
|
||||
+ */
|
||||
+ default void getChunkAtAsync(final @NotNull Block block, final @NotNull Consumer<? super Chunk> cb) {
|
||||
+ this.getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true, cb);
|
||||
+ public default void getChunkAtAsync(@NotNull Block block, @NotNull java.util.function.Consumer<Chunk> cb) {
|
||||
+ getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true, cb);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -254,8 +254,8 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param cb Callback to receive the chunk when it is loaded.
|
||||
+ * will be executed synchronously
|
||||
+ */
|
||||
+ default void getChunkAtAsync(final @NotNull Block block, final boolean gen, final @NotNull Consumer<? super Chunk> cb) {
|
||||
+ this.getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen, cb);
|
||||
+ public default void getChunkAtAsync(@NotNull Block block, boolean gen, @NotNull java.util.function.Consumer<Chunk> cb) {
|
||||
+ getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen, cb);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -273,8 +273,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param loc Location to load the corresponding chunk from
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(final @NotNull Location loc) {
|
||||
+ return this.getChunkAtAsync((int) Math.floor(loc.getX()) >> 4, (int) Math.floor(loc.getZ()) >> 4, true);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(@NotNull Location loc) {
|
||||
+ return getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, true);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -293,8 +294,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param gen Should the chunk generate if it doesn't exist
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(final @NotNull Location loc, final boolean gen) {
|
||||
+ return this.getChunkAtAsync((int) Math.floor(loc.getX()) >> 4, (int) Math.floor(loc.getZ()) >> 4, gen);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(@NotNull Location loc, boolean gen) {
|
||||
+ return getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, gen);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -312,8 +314,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param block Block to load the corresponding chunk from
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(final @NotNull Block block) {
|
||||
+ return this.getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(@NotNull Block block) {
|
||||
+ return getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -332,8 +335,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param gen Should the chunk generate if it doesn't exist
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(final @NotNull Block block, final boolean gen) {
|
||||
+ return this.getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(@NotNull Block block, boolean gen) {
|
||||
+ return getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -353,8 +357,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param z Chunk Z-coordinate of the chunk - floor(world coordinate / 16)
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(final int x, final int z) {
|
||||
+ return this.getChunkAtAsync(x, z, true);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z) {
|
||||
+ return getChunkAtAsync(x, z, true);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -375,8 +380,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param gen Should we generate a chunk if it doesn't exist or not
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(final int x, final int z, final boolean gen) {
|
||||
+ return this.getChunkAtAsync(x, z, gen, false);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen) {
|
||||
+ return getChunkAtAsync(x, z, gen, false);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -394,8 +400,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param loc Location to load the corresponding chunk from
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(final @NotNull Location loc) {
|
||||
+ return this.getChunkAtAsync((int) Math.floor(loc.getX()) >> 4, (int) Math.floor(loc.getZ()) >> 4, true, true);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull Location loc) {
|
||||
+ return getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, true, true);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -414,8 +421,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param gen Should the chunk generate if it doesn't exist
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(final @NotNull Location loc, final boolean gen) {
|
||||
+ return this.getChunkAtAsync((int) Math.floor(loc.getX()) >> 4, (int) Math.floor(loc.getZ()) >> 4, gen, true);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull Location loc, boolean gen) {
|
||||
+ return getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, gen, true);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -433,8 +441,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param block Block to load the corresponding chunk from
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(final @NotNull Block block) {
|
||||
+ return this.getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true, true);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull Block block) {
|
||||
+ return getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true, true);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -453,8 +462,9 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param gen Should the chunk generate if it doesn't exist
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(final @NotNull Block block, final boolean gen) {
|
||||
+ return this.getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen, true);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull Block block, boolean gen) {
|
||||
+ return getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen, true);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -474,16 +484,16 @@ index 213ec372ab639179da65e67a1326c1e08bfbc943..e4a0d57535fa0fb51765ccdbf0e41d04
|
||||
+ * @param z Z Coord
|
||||
+ * @return Future that will resolve when the chunk is loaded
|
||||
+ */
|
||||
+ default @NotNull java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(final int x, final int z) {
|
||||
+ return this.getChunkAtAsync(x, z, true, true);
|
||||
+ @NotNull
|
||||
+ public default java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsyncUrgently(int x, int z) {
|
||||
+ return getChunkAtAsync(x, z, true, true);
|
||||
+ }
|
||||
+
|
||||
+ java.util.concurrent.@NotNull CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent);
|
||||
+ // Paper end - async chunks API
|
||||
+
|
||||
+ @NotNull
|
||||
+ java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent);
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
* Get a list of all players in this World
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 5fc085f785719933eef7ab1b3cf173579c64739b..711d95bfafac0d415895023bdaac4059395667ab 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index e13d09c5d4c62d47f6f4e057a23caea3ed18496a..d6af835abd8b31cf177ad2912215d80ff7629e64 100644
|
||||
index a851ec4d350ce442eb01385d21ca75e695cf09d2..9954fc11b2c2fe56c194d7d3ce878a343a9b2429 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2915,6 +2915,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2854,6 +2854,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param profile The new profile to use
|
||||
*/
|
||||
void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add sun related API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 99a31572fa393a2482548ec55a96cb8568d07199..561cfe701d76fa0c85cea4a76affa7e90de82da0 100644
|
||||
index fc6b99e4f37179b15254bf0b398b1a800de1b73f..df511007ca4b3b5df04abfa6b7f1c4de636407fc 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -1760,6 +1760,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -1782,6 +1782,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*/
|
||||
public void setFullTime(long time);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ index ac420f0059fc50d3e1294f85df7515c9e17ff78f..24daba85ce4129fb0babe67570059ca8
|
||||
public static Art getById(int id) {
|
||||
return BY_ID.get(id);
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 5bb11c5ebd02cf4e4c6c9b859cd7987abd2093d6..87d2348f39e2e43c782c1b7bf73ec38c52e67f95 100644
|
||||
index 40b4d6ee5ef1f6b88e0b85131be399526488cd9e..20e8bee8a686f8d37d770d8714c5c55af8491584 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -838,9 +838,8 @@ public final class Bukkit {
|
||||
@@ -196,11 +196,11 @@ index 879d637691683ca862045402f74b751a892bf3ff..611b7df0e31de932f15c2f13bd8ed286
|
||||
public static Effect getById(int id) {
|
||||
return BY_ID.get(id);
|
||||
diff --git a/src/main/java/org/bukkit/EntityEffect.java b/src/main/java/org/bukkit/EntityEffect.java
|
||||
index 9db85b2f6ffd56bbc4db1f75f8769f1c15d5950f..5341957b10cccd7bce5a7595699b1d90412a01d0 100644
|
||||
index 1747b912dd08d82757687aaa7614d32d746fd6a1..7b6d9c2bbe1052371fdd4121f88e5009882a3d41 100644
|
||||
--- a/src/main/java/org/bukkit/EntityEffect.java
|
||||
+++ b/src/main/java/org/bukkit/EntityEffect.java
|
||||
@@ -345,9 +345,9 @@ public enum EntityEffect {
|
||||
* Gets the data value of this EntityEffect, may not be unique.
|
||||
@@ -227,9 +227,9 @@ public enum EntityEffect {
|
||||
* Gets the data value of this EntityEffect
|
||||
*
|
||||
* @return The data value
|
||||
- * @deprecated Magic value
|
||||
@@ -254,7 +254,7 @@ index f9c9ae463aacd593e3aa9caf037ea1e23d56c780..f8ae143acbf586d5279b44f7311ca97f
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 0b202d378d50946f43434e70d9d511cac06749b0..cf42f6e57e96aa9cb4465e34a6e3f8709de4ca09 100644
|
||||
index 16df0568143a956309e6cab91a0818582fa4ed67..9e80988c71b77bbda1aca27a859537600a1439a6 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -46,7 +46,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
@@ -285,7 +285,7 @@ index 0b202d378d50946f43434e70d9d511cac06749b0..cf42f6e57e96aa9cb4465e34a6e3f870
|
||||
if (this.world == null) {
|
||||
return null;
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 48a42faffc5e117b6d18bc21265caa150117e3ef..2d7cd77002c32e88bfa677f86d645ee6b541062c 100644
|
||||
index d56d899ca7737b537ea55c13a384888a873f5da3..55fc700d60051bb17469e0768db3c266ba18f17c 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -4459,20 +4459,20 @@ public enum Material implements Keyed, Translatable {
|
||||
@@ -374,7 +374,7 @@ index f43209cf7b752c26718c303ca8c3e1c7d9912ad3..f0094e6fb05e526736629ad3181c8d2c
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/Note.java b/src/main/java/org/bukkit/Note.java
|
||||
index 48aecc9421c500137bbef1dfe3bec8de277c3ff9..aff858346776386f1288b648b221404f7f412399 100644
|
||||
index fc3da7ce6f7948aeab0962d9472e8f3a126834cf..bd713f9f7d125998d4bc01aaf11d1605ff64a970 100644
|
||||
--- a/src/main/java/org/bukkit/Note.java
|
||||
+++ b/src/main/java/org/bukkit/Note.java
|
||||
@@ -39,9 +39,9 @@ public class Note {
|
||||
@@ -425,7 +425,7 @@ index 48aecc9421c500137bbef1dfe3bec8de277c3ff9..aff858346776386f1288b648b221404f
|
||||
@Nullable
|
||||
public static Tone getById(byte id) {
|
||||
return BY_DATA.get(id);
|
||||
@@ -222,9 +222,9 @@ public class Note {
|
||||
@@ -214,9 +214,9 @@ public class Note {
|
||||
* Returns the internal id of this note.
|
||||
*
|
||||
* @return the internal id of this note.
|
||||
@@ -521,7 +521,7 @@ index 6277451c3c6c551078c237cd767b6d70c4f585ea..10f5cfb1885833a1d2c1027c03974da4
|
||||
CRACKED(0x0),
|
||||
GLYPHED(0x1),
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index e1f36d4f35cb53e28f4b64ddd730634b0fa9eb14..3cf66dde58cbe92cf9273c482af378058708b15b 100644
|
||||
index 7223bf91b369822afd355c600d834c30270197f4..ef71d6036d1df19c730b4d525862f11f3ee5ccb4 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -704,9 +704,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -600,7 +600,7 @@ index e455eb21abf121dc6ff10ff8a13dd06f67096a8f..bbc01e7c192ae6689c301670047ff114
|
||||
return origin;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 561cfe701d76fa0c85cea4a76affa7e90de82da0..8a200ffe1851b24110c92bb3a9f7ffc39b8c63f2 100644
|
||||
index df511007ca4b3b5df04abfa6b7f1c4de636407fc..3f50a3c5af674fdb4c5adc64901d305753a0b5e9 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -416,9 +416,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -614,7 +614,7 @@ index 561cfe701d76fa0c85cea4a76affa7e90de82da0..8a200ffe1851b24110c92bb3a9f7ffc3
|
||||
public boolean refreshChunk(int x, int z);
|
||||
|
||||
/**
|
||||
@@ -3762,6 +3761,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -3708,6 +3707,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
// Paper end - view distance api
|
||||
|
||||
// Spigot start
|
||||
@@ -625,7 +625,7 @@ index 561cfe701d76fa0c85cea4a76affa7e90de82da0..8a200ffe1851b24110c92bb3a9f7ffc3
|
||||
public class Spigot {
|
||||
|
||||
/**
|
||||
@@ -3770,8 +3773,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -3716,8 +3719,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @param loc The location to strike lightning
|
||||
* @param isSilent Whether this strike makes no sound
|
||||
* @return The lightning entity.
|
||||
@@ -638,7 +638,7 @@ index 561cfe701d76fa0c85cea4a76affa7e90de82da0..8a200ffe1851b24110c92bb3a9f7ffc3
|
||||
public LightningStrike strikeLightning(@NotNull Location loc, boolean isSilent) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -3782,14 +3789,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -3728,14 +3735,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @param loc The location to strike lightning
|
||||
* @param isSilent Whether this strike makes no sound
|
||||
* @return The lightning entity.
|
||||
@@ -661,7 +661,7 @@ index 561cfe701d76fa0c85cea4a76affa7e90de82da0..8a200ffe1851b24110c92bb3a9f7ffc3
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
|
||||
@@ -3920,9 +3935,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -3866,9 +3881,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* Gets the dimension ID of this environment
|
||||
*
|
||||
* @return dimension ID
|
||||
@@ -673,7 +673,7 @@ index 561cfe701d76fa0c85cea4a76affa7e90de82da0..8a200ffe1851b24110c92bb3a9f7ffc3
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -3932,9 +3947,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -3878,9 +3893,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*
|
||||
* @param id The ID of the environment
|
||||
* @return The environment
|
||||
@@ -895,10 +895,10 @@ index 95c79c5fa0c4e30201f887da6467ce5f81c8a255..7f9c4d4b430a3f0276461346ff2621ba
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index d6af835abd8b31cf177ad2912215d80ff7629e64..c463a52aef540e7b69c5ea32bce1239ed6c57a4f 100644
|
||||
index 9954fc11b2c2fe56c194d7d3ce878a343a9b2429..c3223873d1afe14cdc0a14f97b3aa98d013d6e90 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1497,11 +1497,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1436,11 +1436,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
|
||||
/**
|
||||
* Forces an update of the player's entire inventory.
|
||||
|
||||
@@ -51,12 +51,12 @@ index 0000000000000000000000000000000000000000..1c832d69bb3717dcfccf21e45f6f060a
|
||||
+ SOLID_OR_LIQUID_NO_LEAVES;
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index dc7e69380e421f64d65b6dcb80909fc770d157fa..5edee59f24ef5f8adf2aa1f2f3c0289cf4bc0ec3 100644
|
||||
index f7564581c18425c903e54f949728dd3742ca7bf2..1bfe465b9aaeea7d3c871140145b7de1b8f1d93d 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -649,6 +649,46 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
@@ -640,6 +640,46 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
return centerLoc;
|
||||
}
|
||||
// Paper end - expand Location API
|
||||
|
||||
+ // Paper start - Add heightmap api
|
||||
+ /**
|
||||
@@ -102,7 +102,7 @@ index dc7e69380e421f64d65b6dcb80909fc770d157fa..5edee59f24ef5f8adf2aa1f2f3c0289c
|
||||
/**
|
||||
* Creates explosion at this location with given power
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index fe5cc7b038516dd61d2d1af97073a60b76874db5..518158d70a8e7ba9a6aa54c22913d8a881adff1f 100644
|
||||
index e673e05c3d94c28d6809a0de7f7d070712b85741..5d3b645eb24f5c0e3309143fc0e53545c6de8083 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -151,6 +151,87 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
@@ -229,10 +229,10 @@ index 0000000000000000000000000000000000000000..cf67dc7d465223710adbf2b798109f52
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index c463a52aef540e7b69c5ea32bce1239ed6c57a4f..46e78e3e7102e3e91f10ac001dca555e13732247 100644
|
||||
index c3223873d1afe14cdc0a14f97b3aa98d013d6e90..925bdf4cc2191a89ca8f55ca55121fa5d3a556a2 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2932,6 +2932,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2871,6 +2871,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* Reset the cooldown counter to 0, effectively starting the cooldown period.
|
||||
*/
|
||||
void resetCooldown();
|
||||
|
||||
@@ -5,39 +5,49 @@ Subject: [PATCH] Spawn Reason API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index 656c060aee5d9ce778638253603ed9475a2612a1..b8575fbc7d30a3f4e6862193e3267ab06e91c32f 100644
|
||||
index 7c2b1eff41dd43fda84d84e76c05bbbf37c186b8..bc70f4f5b82ce5b92ab0b2612c8fb8126ed1a8c2 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -308,8 +308,31 @@ public interface RegionAccessor {
|
||||
* @throws IllegalArgumentException if either parameter is null or the
|
||||
@@ -11,6 +11,7 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -309,7 +310,34 @@ public interface RegionAccessor {
|
||||
* {@link Entity} requested cannot be spawned
|
||||
*/
|
||||
- @NotNull
|
||||
- <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<? super T> function) throws IllegalArgumentException;
|
||||
@NotNull
|
||||
- <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function) throws IllegalArgumentException;
|
||||
+ // Paper start
|
||||
+ default <T extends Entity> @NotNull T spawn(final @NotNull Location location, final @NotNull Class<T> clazz, final @Nullable Consumer<? super T> function) throws IllegalArgumentException {
|
||||
+ return this.spawn(location, clazz, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CUSTOM, function);
|
||||
+ public default <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function) throws IllegalArgumentException {
|
||||
+ return spawn(location, clazz, CreatureSpawnEvent.SpawnReason.CUSTOM, function);
|
||||
+ }
|
||||
+
|
||||
+ default @NotNull <T extends Entity> T spawn(final @NotNull Location location, final @NotNull Class<T> clazz, final org.bukkit.event.entity.CreatureSpawnEvent.@NotNull SpawnReason reason) throws IllegalArgumentException {
|
||||
+ return this.spawn(location, clazz, reason, null);
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @NotNull CreatureSpawnEvent.SpawnReason reason) throws IllegalArgumentException {
|
||||
+ return spawn(location, clazz, reason, null);
|
||||
+ }
|
||||
+
|
||||
+ default @NotNull <T extends Entity> T spawn(final @NotNull Location location, final @NotNull Class<T> clazz, final org.bukkit.event.entity.CreatureSpawnEvent.@NotNull SpawnReason reason, final @Nullable Consumer<? super T> function) throws IllegalArgumentException {
|
||||
+ return this.spawn(location, clazz, function, reason);
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @NotNull CreatureSpawnEvent.SpawnReason reason, @Nullable Consumer<T> function) throws IllegalArgumentException {
|
||||
+ return spawn(location, clazz, function, reason);
|
||||
+ }
|
||||
+
|
||||
+ default @NotNull Entity spawnEntity(final @NotNull Location loc, final @NotNull EntityType type, final org.bukkit.event.entity.CreatureSpawnEvent.@NotNull SpawnReason reason) {
|
||||
+ com.google.common.base.Preconditions.checkArgument(type.getEntityClass() != null, "%s is not a valid EntityType, must have an entity class", type);
|
||||
+ return this.spawn(loc, type.getEntityClass(), reason, null);
|
||||
+ @NotNull
|
||||
+ public default Entity spawnEntity(@NotNull Location loc, @NotNull org.bukkit.entity.EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason) {
|
||||
+ return spawn(loc, (Class<Entity>) type.getEntityClass(), reason, null);
|
||||
+ }
|
||||
+
|
||||
+ default @NotNull Entity spawnEntity(final @NotNull Location loc, final @NotNull EntityType type, final org.bukkit.event.entity.CreatureSpawnEvent.@NotNull SpawnReason reason, final @Nullable Consumer<? super Entity> function) {
|
||||
+ com.google.common.base.Preconditions.checkArgument(type.getEntityClass() != null, "%s is not a valid EntityType, must have an entity class", type);
|
||||
+ return this.spawn(loc, type.getEntityClass(), reason, function);
|
||||
+ @NotNull
|
||||
+ public default Entity spawnEntity(@NotNull Location loc, @NotNull org.bukkit.entity.EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason, @Nullable Consumer<Entity> function) {
|
||||
+ return spawn(loc, (Class<Entity>) type.getEntityClass(), reason, function);
|
||||
+ }
|
||||
+
|
||||
+ <T extends Entity> @NotNull T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<? super T> function, org.bukkit.event.entity.CreatureSpawnEvent.@NotNull SpawnReason reason) throws IllegalArgumentException;
|
||||
+ @NotNull
|
||||
+ public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function, @NotNull CreatureSpawnEvent.SpawnReason reason) throws IllegalArgumentException;
|
||||
+ // Paper end
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Brand support
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 46e78e3e7102e3e91f10ac001dca555e13732247..45065768d73075f065ca98064ca9813918e05747 100644
|
||||
index 925bdf4cc2191a89ca8f55ca55121fa5d3a556a2..b37f84a11e49f0f09371d2baf6ec3eb1c9262068 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3046,6 +3046,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2985,6 +2985,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
// Paper end
|
||||
}
|
||||
|
||||
|
||||
@@ -47,10 +47,10 @@ index 0000000000000000000000000000000000000000..df05153397b42930cd53d37b30824c7e
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index b8575fbc7d30a3f4e6862193e3267ab06e91c32f..3e5597bac0971f28009a50bfde0cd7f0f10bd876 100644
|
||||
index bc70f4f5b82ce5b92ab0b2612c8fb8126ed1a8c2..f587a529e4d7b097b3f204a34c636da0bbac6747 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -416,4 +416,12 @@ public interface RegionAccessor {
|
||||
@@ -421,4 +421,12 @@ public interface RegionAccessor {
|
||||
* {@link HeightMap}
|
||||
*/
|
||||
public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap);
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Player elytra boost API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 45065768d73075f065ca98064ca9813918e05747..0cb487cd32a5d47eeb56da2acbae6cc1e1409b62 100644
|
||||
index b37f84a11e49f0f09371d2baf6ec3eb1c9262068..7ccc62f77055a8fc7e4407f70b0ebab956e20570 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2938,6 +2938,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2877,6 +2877,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
@NotNull
|
||||
<T> T getClientOption(@NotNull com.destroystokyo.paper.ClientOption<T> option);
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 0cb487cd32a5d47eeb56da2acbae6cc1e1409b62..107edde2e9189f29dde2211cc9e17cbeed3696ae 100644
|
||||
index 7ccc62f77055a8fc7e4407f70b0ebab956e20570..717b12fceaa918f574d6f15b0f6b2939ce9bd1f9 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2958,6 +2958,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2897,6 +2897,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Expand world key API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index c9f4ec3ff1aaca2f75fe0a7f0c85d63f3dfd97f8..1e6307106391056af17add97080cd1f1908114e7 100644
|
||||
index 102f1ac7c2fde48be4c7e582019b8601dcf361e4..def2ea036536d0e15bc3b35bb69e99a9bcba1d60 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -832,6 +832,18 @@ public final class Bukkit {
|
||||
@@ -28,10 +28,10 @@ index c9f4ec3ff1aaca2f75fe0a7f0c85d63f3dfd97f8..1e6307106391056af17add97080cd1f1
|
||||
/**
|
||||
* Create a new virtual {@link WorldBorder}.
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index 3e5597bac0971f28009a50bfde0cd7f0f10bd876..60ed2b36e18032270c0689cb2405a63a8a962fad 100644
|
||||
index f587a529e4d7b097b3f204a34c636da0bbac6747..58b81f30f9e29ab481ae96c7eea40ad976a4b192 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* A RegionAccessor gives access to getting, modifying and spawning {@link Biome}, {@link BlockState} and {@link Entity},
|
||||
* as well as generating some basic structures.
|
||||
*/
|
||||
@@ -40,7 +40,7 @@ index 3e5597bac0971f28009a50bfde0cd7f0f10bd876..60ed2b36e18032270c0689cb2405a63a
|
||||
|
||||
/**
|
||||
* Gets the {@link Biome} at the given {@link Location}.
|
||||
@@ -423,5 +423,14 @@ public interface RegionAccessor {
|
||||
@@ -428,5 +428,14 @@ public interface RegionAccessor {
|
||||
*/
|
||||
@NotNull
|
||||
io.papermc.paper.world.MoonPhase getMoonPhase();
|
||||
@@ -56,7 +56,7 @@ index 3e5597bac0971f28009a50bfde0cd7f0f10bd876..60ed2b36e18032270c0689cb2405a63a
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 578a516d568dcc9fbdd67529bf986817adb480bc..91535f211ba7352c22c8cc30e340ed93b3ace21d 100644
|
||||
index 2864bf08aacedbbfdaa507838d42441b88953786..11be12a66bbc660221760d857daf78cdb18d77f0 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -696,6 +696,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] More World API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index dd498e3ba46bd001028f7f9f94e18de42e875ff6..8735a0a359450a6cbea44c1b01c85a4135ba1f86 100644
|
||||
index 75a3f5528182fed8086bbb7fb9529f7746d005e6..efca79f7fd5a4e3c75d7060efae44c564edeb036 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3769,6 +3769,122 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -3715,6 +3715,122 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
StructureSearchResult locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored);
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add more line of sight methods
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index 60ed2b36e18032270c0689cb2405a63a8a962fad..3a0e0af739227d99d854b0d5c9bf342fe9363de4 100644
|
||||
index 58b81f30f9e29ab481ae96c7eea40ad976a4b192..63503cf17847a85264c930a9fc23a5aab5955c3c 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -432,5 +432,13 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
@@ -437,5 +437,13 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
@NotNull
|
||||
@Override
|
||||
NamespacedKey getKey();
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Multi Block Change API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 6d8e4f23095716eeaea16206c3a4bb36f794f29f..0e42cd429a75d10f8628acad319ee3dd2cdf02c3 100644
|
||||
index 549adf75eeb0d014c5baf7c111f4ec1468339bd5..fe1c58a20de699d869a3f86295c8446991cce399 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -851,6 +851,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -790,6 +790,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public void sendBlockDamage(@NotNull Location loc, float progress);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Custom Potion Mixes
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/potion/PotionMix.java b/src/main/java/io/papermc/paper/potion/PotionMix.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3fc922ebf972418b84181cd02e68d8ef0efd739b
|
||||
index 0000000000000000000000000000000000000000..ae1f30e88fc5048627295187214aa7a288f4c184
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/potion/PotionMix.java
|
||||
@@ -0,0 +1,105 @@
|
||||
@@ -42,25 +42,13 @@ index 0000000000000000000000000000000000000000..3fc922ebf972418b84181cd02e68d8ef
|
||||
+ * @param input the input placed into the bottom 3 slots
|
||||
+ * @param ingredient the ingredient placed into the top slot
|
||||
+ */
|
||||
+ public PotionMix(final @NotNull NamespacedKey key, final @NotNull ItemStack result, final @NotNull RecipeChoice input, final @NotNull RecipeChoice ingredient) {
|
||||
+ public PotionMix(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, @NotNull RecipeChoice ingredient) {
|
||||
+ this.key = key;
|
||||
+ this.result = result;
|
||||
+ this.input = input;
|
||||
+ this.ingredient = ingredient;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Create a {@link RecipeChoice} based on a Predicate. These RecipeChoices are only
|
||||
+ * valid for {@link PotionMix}, not anywhere else RecipeChoices may be used.
|
||||
+ *
|
||||
+ * @param stackPredicate a predicate for an itemstack.
|
||||
+ * @return a new RecipeChoice
|
||||
+ */
|
||||
+ @Contract(value = "_ -> new", pure = true)
|
||||
+ public static @NotNull RecipeChoice createPredicateChoice(final @NotNull Predicate<? super ItemStack> stackPredicate) {
|
||||
+ return new PredicateRecipeChoice(stackPredicate);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull NamespacedKey getKey() {
|
||||
+ return this.key;
|
||||
@@ -93,6 +81,18 @@ index 0000000000000000000000000000000000000000..3fc922ebf972418b84181cd02e68d8ef
|
||||
+ return this.ingredient;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Create a {@link RecipeChoice} based on a Predicate. These RecipeChoices are only
|
||||
+ * valid for {@link PotionMix}, not anywhere else RecipeChoices may be used.
|
||||
+ *
|
||||
+ * @param stackPredicate a predicate for an itemstack.
|
||||
+ * @return a new RecipeChoice
|
||||
+ */
|
||||
+ @Contract(value = "_ -> new", pure = true)
|
||||
+ public static @NotNull RecipeChoice createPredicateChoice(@NotNull Predicate<ItemStack> stackPredicate) {
|
||||
+ return new PredicateRecipeChoice(stackPredicate);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String toString() {
|
||||
+ return "PotionMix{" +
|
||||
@@ -103,10 +103,10 @@ index 0000000000000000000000000000000000000000..3fc922ebf972418b84181cd02e68d8ef
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean equals(final Object o) {
|
||||
+ public boolean equals(Object o) {
|
||||
+ if (this == o) return true;
|
||||
+ if (o == null || this.getClass() != o.getClass()) return false;
|
||||
+ final PotionMix potionMix = (PotionMix) o;
|
||||
+ if (o == null || getClass() != o.getClass()) return false;
|
||||
+ PotionMix potionMix = (PotionMix) o;
|
||||
+ return this.key.equals(potionMix.key) && this.result.equals(potionMix.result) && this.input.equals(potionMix.input) && this.ingredient.equals(potionMix.ingredient);
|
||||
+ }
|
||||
+
|
||||
@@ -117,7 +117,7 @@ index 0000000000000000000000000000000000000000..3fc922ebf972418b84181cd02e68d8ef
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/potion/PredicateRecipeChoice.java b/src/main/java/io/papermc/paper/potion/PredicateRecipeChoice.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3ede1e8f7bf0436fdc5bf395c0f9eaf11c252453
|
||||
index 0000000000000000000000000000000000000000..1bf964605f681469fb364baaa18381c090260a94
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/potion/PredicateRecipeChoice.java
|
||||
@@ -0,0 +1,33 @@
|
||||
@@ -132,7 +132,7 @@ index 0000000000000000000000000000000000000000..3ede1e8f7bf0436fdc5bf395c0f9eaf1
|
||||
+
|
||||
+@ApiStatus.Internal
|
||||
+@DefaultQualifier(NonNull.class)
|
||||
+record PredicateRecipeChoice(Predicate<? super ItemStack> itemStackPredicate) implements RecipeChoice, Cloneable {
|
||||
+record PredicateRecipeChoice(Predicate<ItemStack> itemStackPredicate) implements RecipeChoice, Cloneable {
|
||||
+
|
||||
+ @Override
|
||||
+ @Deprecated
|
||||
@@ -144,7 +144,7 @@ index 0000000000000000000000000000000000000000..3ede1e8f7bf0436fdc5bf395c0f9eaf1
|
||||
+ public RecipeChoice clone() {
|
||||
+ try {
|
||||
+ return (PredicateRecipeChoice) super.clone();
|
||||
+ } catch (final CloneNotSupportedException ex) {
|
||||
+ } catch (CloneNotSupportedException ex) {
|
||||
+ throw new AssertionError(ex);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add getComputedBiome API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index 3a0e0af739227d99d854b0d5c9bf342fe9363de4..87489972dff661c7c9ec4d128e25e2f7666b598e 100644
|
||||
index 63503cf17847a85264c930a9fc23a5aab5955c3c..93e20ca14a2b7e5817fab788b6dfa73c6ced6acb 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -25,6 +25,7 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
@@ -26,6 +26,7 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
*
|
||||
* @param location the location of the biome
|
||||
* @return Biome at the given location
|
||||
@@ -16,7 +16,7 @@ index 3a0e0af739227d99d854b0d5c9bf342fe9363de4..87489972dff661c7c9ec4d128e25e2f7
|
||||
*/
|
||||
@NotNull
|
||||
Biome getBiome(@NotNull Location location);
|
||||
@@ -36,10 +37,33 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
@@ -37,10 +38,33 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
* @param y Y-coordinate of the block
|
||||
* @param z Z-coordinate of the block
|
||||
* @return Biome at the given coordinates
|
||||
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH] Expand FallingBlock API
|
||||
Co-authored-by: Lukas Planz <lukas.planz@web.de>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index b191d304832fe3475b76fdce131db51e5042ac01..298e63e0ca9d4cbac3172fd93a217af79fad91df 100644
|
||||
index 94e6fe6257b30112066b98ec4fdb1561dbcc93c4..bc6630345bb42eb365ba0057a4c52b1e10c6a05a 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -2220,8 +2220,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2242,8 +2242,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @return The spawned {@link FallingBlock} instance
|
||||
* @throws IllegalArgumentException if {@link Location} or {@link
|
||||
* MaterialData} are null or {@link Material} of the {@link MaterialData} is not a block
|
||||
@@ -24,7 +24,7 @@ index b191d304832fe3475b76fdce131db51e5042ac01..298e63e0ca9d4cbac3172fd93a217af7
|
||||
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
@@ -2234,8 +2236,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2256,8 +2258,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @return The spawned {@link FallingBlock} instance
|
||||
* @throws IllegalArgumentException if {@link Location} or {@link
|
||||
* BlockData} are null
|
||||
@@ -35,7 +35,7 @@ index b191d304832fe3475b76fdce131db51e5042ac01..298e63e0ca9d4cbac3172fd93a217af7
|
||||
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull BlockData data) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
@@ -2252,7 +2256,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2274,7 +2278,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @return The spawned {@link FallingBlock} instance
|
||||
* @throws IllegalArgumentException if {@link Location} or {@link
|
||||
* Material} are null or {@link Material} is not a block
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] More Teleport API
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/entity/LookAnchor.java b/src/main/java/io/papermc/paper/entity/LookAnchor.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..544eec787ea837f7d29df6519255840d6fe087d7
|
||||
index 0000000000000000000000000000000000000000..c8312691c27ae436029ec5011ddf073582b12cba
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/entity/LookAnchor.java
|
||||
@@ -0,0 +1,24 @@
|
||||
@@ -0,0 +1,25 @@
|
||||
+package io.papermc.paper.entity;
|
||||
+
|
||||
+import io.papermc.paper.math.Position;
|
||||
@@ -22,6 +22,7 @@ index 0000000000000000000000000000000000000000..544eec787ea837f7d29df6519255840d
|
||||
+ * @see org.bukkit.entity.Player#lookAt(Position, LookAnchor)
|
||||
+ * @see org.bukkit.entity.Player#lookAt(Entity, LookAnchor, LookAnchor)
|
||||
+ */
|
||||
+@org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+public enum LookAnchor {
|
||||
+ /**
|
||||
+ * Represents the entity's feet.
|
||||
@@ -36,14 +37,15 @@ index 0000000000000000000000000000000000000000..544eec787ea837f7d29df6519255840d
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/entity/TeleportFlag.java b/src/main/java/io/papermc/paper/entity/TeleportFlag.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c8b5b570d44da9524bfc59c7e11b2ae59d4b79b9
|
||||
index 0000000000000000000000000000000000000000..dbacefc919fd6ed6a0f5cdaa0f695a12eda9cc3f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/entity/TeleportFlag.java
|
||||
@@ -0,0 +1,79 @@
|
||||
@@ -0,0 +1,83 @@
|
||||
+package io.papermc.paper.entity;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+
|
||||
+/**
|
||||
+ * Represents a flag that can be set on teleportation that may
|
||||
@@ -52,6 +54,7 @@ index 0000000000000000000000000000000000000000..c8b5b570d44da9524bfc59c7e11b2ae5
|
||||
+ * @see EntityState
|
||||
+ * @see Relative
|
||||
+ */
|
||||
+@ApiStatus.Experimental
|
||||
+public sealed interface TeleportFlag permits TeleportFlag.EntityState, TeleportFlag.Relative {
|
||||
+
|
||||
+ /**
|
||||
@@ -65,6 +68,7 @@ index 0000000000000000000000000000000000000000..c8b5b570d44da9524bfc59c7e11b2ae5
|
||||
+ *
|
||||
+ * @see org.bukkit.entity.Player#teleport(Location, PlayerTeleportEvent.TeleportCause, TeleportFlag...)
|
||||
+ */
|
||||
+ @ApiStatus.Experimental
|
||||
+ enum Relative implements TeleportFlag {
|
||||
+ /**
|
||||
+ * Represents the player's X coordinate
|
||||
@@ -92,6 +96,7 @@ index 0000000000000000000000000000000000000000..c8b5b570d44da9524bfc59c7e11b2ae5
|
||||
+ * Represents flags that effect the entity's state on
|
||||
+ * teleportation.
|
||||
+ */
|
||||
+ @ApiStatus.Experimental
|
||||
+ enum EntityState implements TeleportFlag {
|
||||
+ /**
|
||||
+ * If all passengers should not be required to be removed prior to teleportation.
|
||||
@@ -120,10 +125,10 @@ index 0000000000000000000000000000000000000000..c8b5b570d44da9524bfc59c7e11b2ae5
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 77e29cada05da8946d718fe331e28e7553922033..a7e0454344b145242a19eb8020c9c67b18368bdd 100644
|
||||
index 77e29cada05da8946d718fe331e28e7553922033..5607404fa0132febdbdaad051a4e9426fe5f1eb6 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -123,10 +123,32 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -123,10 +123,34 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*
|
||||
* @param yaw the yaw
|
||||
* @param pitch the pitch
|
||||
@@ -139,6 +144,7 @@ index 77e29cada05da8946d718fe331e28e7553922033..a7e0454344b145242a19eb8020c9c67b
|
||||
+ * @param teleportFlags Flags to be used in this teleportation
|
||||
+ * @return <code>true</code> if the teleport was successful
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ default boolean teleport(@NotNull Location location, @NotNull io.papermc.paper.entity.TeleportFlag @NotNull... teleportFlags) {
|
||||
+ return this.teleport(location, TeleportCause.PLUGIN, teleportFlags);
|
||||
+ }
|
||||
@@ -151,6 +157,7 @@ index 77e29cada05da8946d718fe331e28e7553922033..a7e0454344b145242a19eb8020c9c67b
|
||||
+ * @param teleportFlags Flags to be used in this teleportation
|
||||
+ * @return <code>true</code> if the teleport was successful
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ boolean teleport(@NotNull Location location, @NotNull TeleportCause cause, @NotNull io.papermc.paper.entity.TeleportFlag @NotNull... teleportFlags);
|
||||
+ // Paper end - Teleport API
|
||||
+
|
||||
@@ -158,10 +165,10 @@ index 77e29cada05da8946d718fe331e28e7553922033..a7e0454344b145242a19eb8020c9c67b
|
||||
* Teleports this entity to the given location. If this entity is riding a
|
||||
* vehicle, it will be dismounted prior to teleportation.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 0e42cd429a75d10f8628acad319ee3dd2cdf02c3..9794b8f812375ad52b4caceef0bf659d8fbf9d65 100644
|
||||
index 8dc3c5c963e07e1d3819b78b73b39fc082048387..c0fceea5bc007b3f4c93a8fe8cccf4e3cfa88c4f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3118,6 +3118,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3057,6 +3057,49 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
String getClientBrandName();
|
||||
// Paper end
|
||||
|
||||
@@ -172,6 +179,7 @@ index 0e42cd429a75d10f8628acad319ee3dd2cdf02c3..9794b8f812375ad52b4caceef0bf659d
|
||||
+ * @param yaw the yaw
|
||||
+ * @param pitch the pitch
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ void setRotation(float yaw, float pitch);
|
||||
+
|
||||
+ /**
|
||||
@@ -182,6 +190,7 @@ index 0e42cd429a75d10f8628acad319ee3dd2cdf02c3..9794b8f812375ad52b4caceef0bf659d
|
||||
+ * @param z z coordinate
|
||||
+ * @param playerAnchor What part of the player should face the given position
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ void lookAt(double x, double y, double z, @NotNull io.papermc.paper.entity.LookAnchor playerAnchor);
|
||||
+
|
||||
+ /**
|
||||
@@ -190,6 +199,7 @@ index 0e42cd429a75d10f8628acad319ee3dd2cdf02c3..9794b8f812375ad52b4caceef0bf659d
|
||||
+ * @param position Position to look at in the player's current world
|
||||
+ * @param playerAnchor What part of the player should face the given position
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ default void lookAt(@NotNull io.papermc.paper.math.Position position, @NotNull io.papermc.paper.entity.LookAnchor playerAnchor) {
|
||||
+ this.lookAt(position.x(), position.y(), position.z(), playerAnchor);
|
||||
+ }
|
||||
@@ -201,6 +211,7 @@ index 0e42cd429a75d10f8628acad319ee3dd2cdf02c3..9794b8f812375ad52b4caceef0bf659d
|
||||
+ * @param playerAnchor What part of the player should face the entity
|
||||
+ * @param entityAnchor What part of the entity the player should face
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ void lookAt(@NotNull org.bukkit.entity.Entity entity, @NotNull io.papermc.paper.entity.LookAnchor playerAnchor, @NotNull io.papermc.paper.entity.LookAnchor entityAnchor);
|
||||
+ // Paper end - Teleport API
|
||||
+
|
||||
@@ -208,7 +219,7 @@ index 0e42cd429a75d10f8628acad319ee3dd2cdf02c3..9794b8f812375ad52b4caceef0bf659d
|
||||
@Override
|
||||
Spigot spigot();
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java b/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java
|
||||
index 2deae344c88920ab95eefd2f65df5c858e04750b..ccfb08af8c57ddac3062c2cec28d7ff428082709 100644
|
||||
index 2deae344c88920ab95eefd2f65df5c858e04750b..32f78f2e32280f5c9ee7394b77ed929845f127d2 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java
|
||||
@@ -13,8 +13,14 @@ public class PlayerTeleportEvent extends PlayerMoveEvent {
|
||||
@@ -231,7 +242,7 @@ index 2deae344c88920ab95eefd2f65df5c858e04750b..ccfb08af8c57ddac3062c2cec28d7ff4
|
||||
}
|
||||
|
||||
+ // Paper start - Teleport API
|
||||
+ @org.jetbrains.annotations.ApiStatus.Internal
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ public PlayerTeleportEvent(@NotNull final Player player, @NotNull final Location from, @Nullable final Location to, @NotNull final TeleportCause cause, @NotNull java.util.Set<io.papermc.paper.entity.TeleportFlag.@NotNull Relative> teleportFlagSet) {
|
||||
+ super(player, from, to);
|
||||
+ this.teleportFlagSet = teleportFlagSet;
|
||||
@@ -242,7 +253,7 @@ index 2deae344c88920ab95eefd2f65df5c858e04750b..ccfb08af8c57ddac3062c2cec28d7ff4
|
||||
/**
|
||||
* Gets the cause of this teleportation event
|
||||
*
|
||||
@@ -88,6 +103,30 @@ public class PlayerTeleportEvent extends PlayerMoveEvent {
|
||||
@@ -88,6 +103,31 @@ public class PlayerTeleportEvent extends PlayerMoveEvent {
|
||||
UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -264,6 +275,7 @@ index 2deae344c88920ab95eefd2f65df5c858e04750b..ccfb08af8c57ddac3062c2cec28d7ff4
|
||||
+ *
|
||||
+ * @return an immutable set of relative teleportation flags
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ @NotNull
|
||||
+ public java.util.Set<io.papermc.paper.entity.TeleportFlag.@NotNull Relative> getRelativeTeleportationFlags() {
|
||||
+ return this.teleportFlagSet;
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 9794b8f812375ad52b4caceef0bf659d8fbf9d65..f56bb863affa963615efefc35fe1f8d4b12d1253 100644
|
||||
index c0fceea5bc007b3f4c93a8fe8cccf4e3cfa88c4f..cc65c8d4a8e0586d36df630d92a3f904c1169669 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3002,6 +3002,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2941,6 +2941,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
void sendOpLevel(byte level);
|
||||
// Paper end - sendOpLevel API
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Collision API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index 87489972dff661c7c9ec4d128e25e2f7666b598e..14edb1b4caeda0c8aecf3528bd0005fafa6197ff 100644
|
||||
index 93e20ca14a2b7e5817fab788b6dfa73c6ced6acb..cbb51dde78f792db4ddac43f144d23ff4b12d25f 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -464,5 +464,15 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
@@ -469,5 +469,15 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
* @return whether a line of sight exists between {@code from} and {@code to}
|
||||
*/
|
||||
public boolean lineOfSightExists(@NotNull Location from, @NotNull Location to);
|
||||
@@ -25,10 +25,10 @@ index 87489972dff661c7c9ec4d128e25e2f7666b598e..14edb1b4caeda0c8aecf3528bd0005fa
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index a7e0454344b145242a19eb8020c9c67b18368bdd..368d8da056e41103ad10dde177cc244148c0130e 100644
|
||||
index 5607404fa0132febdbdaad051a4e9426fe5f1eb6..7f341ba602f0ecbc2953bb19589146b5ae5d0ea9 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -927,4 +927,26 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -929,4 +929,26 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
boolean isInPowderedSnow();
|
||||
// Paper end
|
||||
|
||||
@@ -5,15 +5,15 @@ Subject: [PATCH] Add a consumer parameter to ProjectileSource#launchProjectile
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/projectiles/ProjectileSource.java b/src/main/java/org/bukkit/projectiles/ProjectileSource.java
|
||||
index eabd8b926ec1c934cd7e77b7cc6adfae16771021..96ebd30d339060758e726e9e1e7428d1d0813c17 100644
|
||||
index eabd8b926ec1c934cd7e77b7cc6adfae16771021..5a2dcb1dbd0a875ff9cf5fd01445196a947f2fdc 100644
|
||||
--- a/src/main/java/org/bukkit/projectiles/ProjectileSource.java
|
||||
+++ b/src/main/java/org/bukkit/projectiles/ProjectileSource.java
|
||||
@@ -31,4 +31,23 @@ public interface ProjectileSource {
|
||||
@@ -31,4 +31,24 @@ public interface ProjectileSource {
|
||||
*/
|
||||
@NotNull
|
||||
public <T extends Projectile> T launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity);
|
||||
+
|
||||
+ // Paper start - add consumer to launchProjectile
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Launches a {@link Projectile} from the ProjectileSource with an
|
||||
+ * initial velocity, with the supplied function run before the
|
||||
@@ -29,6 +29,7 @@ index eabd8b926ec1c934cd7e77b7cc6adfae16771021..96ebd30d339060758e726e9e1e7428d1
|
||||
+ * @param function the function to be run before the entity is spawned
|
||||
+ * @return the launched projectile
|
||||
+ */
|
||||
+ <T extends Projectile> @NotNull T launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity, java.util.function.@Nullable Consumer<? super T> function);
|
||||
+ // Paper end - add consumer to launchProjectile
|
||||
+ @NotNull
|
||||
+ public <T extends Projectile> T launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity, @Nullable java.util.function.Consumer<T> function);
|
||||
+ // Paper end
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 83eaf1b4882c552cf72d222d45ed11fd8f8a57b2..e7eec77471b725f0d13b13c56e5244dfe4145f1e 100644
|
||||
index cc65c8d4a8e0586d36df630d92a3f904c1169669..ae1882f58dcc55c51757fa385effd329d348b896 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3182,6 +3182,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3125,6 +3125,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
void lookAt(@NotNull org.bukkit.entity.Entity entity, @NotNull io.papermc.paper.entity.LookAnchor playerAnchor, @NotNull io.papermc.paper.entity.LookAnchor entityAnchor);
|
||||
// Paper end - Teleport API
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Player Warden Warning API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index e7eec77471b725f0d13b13c56e5244dfe4145f1e..aaa99aca492b14c775180214345095ec02dbc5fc 100644
|
||||
index ae1882f58dcc55c51757fa385effd329d348b896..bd35d2da3ef437e7025ea86265ebcc693399ac83 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3198,6 +3198,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3141,6 +3141,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param silent whether sound should be silenced
|
||||
*/
|
||||
void showElderGuardian(boolean silent);
|
||||
|
||||
@@ -7,7 +7,7 @@ Add missing instrument enums
|
||||
fix some wrong javadocs
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Instrument.java b/src/main/java/org/bukkit/Instrument.java
|
||||
index 032d7b812ddc0a85e316882c8f7de0c5a0a4fd30..8df26e0d7bea77bb257cddbc2ab9e969fa160681 100644
|
||||
index de976be7132d05506fde7a839cac3954b0dd8da4..642feb8b4578e6dbd2bf78d859283d20f877051f 100644
|
||||
--- a/src/main/java/org/bukkit/Instrument.java
|
||||
+++ b/src/main/java/org/bukkit/Instrument.java
|
||||
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -17,66 +17,65 @@ index 032d7b812ddc0a85e316882c8f7de0c5a0a4fd30..8df26e0d7bea77bb257cddbc2ab9e969
|
||||
- * Piano is the standard instrument for a note block.
|
||||
+ * Piano (Harp) is the standard instrument for a note block.
|
||||
*/
|
||||
PIANO(0x0, Sound.BLOCK_NOTE_BLOCK_HARP),
|
||||
PIANO(0x0),
|
||||
/**
|
||||
@@ -21,7 +21,7 @@ public enum Instrument {
|
||||
*/
|
||||
SNARE_DRUM(0x2, Sound.BLOCK_NOTE_BLOCK_SNARE),
|
||||
SNARE_DRUM(0x2),
|
||||
/**
|
||||
- * Sticks are normally played when a note block is on top of a glass
|
||||
+ * Sticks (Hat) are normally played when a note block is on top of a glass
|
||||
* block.
|
||||
*/
|
||||
STICKS(0x3, Sound.BLOCK_NOTE_BLOCK_HAT),
|
||||
@@ -78,39 +78,37 @@ public enum Instrument {
|
||||
STICKS(0x3),
|
||||
@@ -78,38 +78,36 @@ public enum Instrument {
|
||||
/**
|
||||
* Zombie is normally played when a Zombie Head is on top of the note block.
|
||||
*/
|
||||
- ZOMBIE(Sound.BLOCK_NOTE_BLOCK_IMITATE_ZOMBIE),
|
||||
+ ZOMBIE(0x10, Sound.BLOCK_NOTE_BLOCK_IMITATE_ZOMBIE), // Paper
|
||||
- ZOMBIE,
|
||||
+ ZOMBIE(0x10), // Paper
|
||||
/**
|
||||
* Skeleton is normally played when a Skeleton Head is on top of the note block.
|
||||
*/
|
||||
- SKELETON(Sound.BLOCK_NOTE_BLOCK_IMITATE_SKELETON),
|
||||
+ SKELETON(0x11, Sound.BLOCK_NOTE_BLOCK_IMITATE_SKELETON), // Paper
|
||||
- SKELETON,
|
||||
+ SKELETON(0x11), // Paper
|
||||
/**
|
||||
* Creeper is normally played when a Creeper Head is on top of the note block.
|
||||
*/
|
||||
- CREEPER(Sound.BLOCK_NOTE_BLOCK_IMITATE_CREEPER),
|
||||
+ CREEPER(0x12, Sound.BLOCK_NOTE_BLOCK_IMITATE_CREEPER), // Paper
|
||||
- CREEPER,
|
||||
+ CREEPER(0x12), // Paper
|
||||
/**
|
||||
* Dragon is normally played when a Dragon Head is on top of the note block.
|
||||
*/
|
||||
- DRAGON(Sound.BLOCK_NOTE_BLOCK_IMITATE_ENDER_DRAGON),
|
||||
+ DRAGON(0x13, Sound.BLOCK_NOTE_BLOCK_IMITATE_ENDER_DRAGON), // Paper
|
||||
- DRAGON,
|
||||
+ DRAGON(0x13), // Paper
|
||||
/**
|
||||
* Wither Skeleton is normally played when a Wither Skeleton Head is on top of the note block.
|
||||
*/
|
||||
- WITHER_SKELETON(Sound.BLOCK_NOTE_BLOCK_IMITATE_WITHER_SKELETON),
|
||||
+ WITHER_SKELETON(0x14, Sound.BLOCK_NOTE_BLOCK_IMITATE_WITHER_SKELETON), // Paper
|
||||
- WITHER_SKELETON,
|
||||
+ WITHER_SKELETON(0x14), // Paper
|
||||
/**
|
||||
* Piglin is normally played when a Piglin Head is on top of the note block.
|
||||
*/
|
||||
- PIGLIN(Sound.BLOCK_NOTE_BLOCK_IMITATE_PIGLIN),
|
||||
+ PIGLIN(0x15, Sound.BLOCK_NOTE_BLOCK_IMITATE_PIGLIN), // Paper
|
||||
- PIGLIN,
|
||||
+ PIGLIN(0x15), // Paper
|
||||
/**
|
||||
* Custom Sound is normally played when a Player Head with the required data is on top of the note block.
|
||||
*/
|
||||
- CUSTOM_HEAD(null);
|
||||
+ CUSTOM_HEAD(0x16, null); // Paper
|
||||
- CUSTOM_HEAD;
|
||||
+ CUSTOM_HEAD(0x16); // Paper
|
||||
|
||||
private final byte type;
|
||||
private final Sound sound;
|
||||
private static final Map<Byte, Instrument> BY_DATA = Maps.newHashMap();
|
||||
|
||||
- private Instrument(final Sound sound) {
|
||||
- this(-1, sound);
|
||||
- private Instrument() {
|
||||
- this(-1);
|
||||
- }
|
||||
+ // Paper - remove ctor (the server still uses the byte magic value)
|
||||
|
||||
private Instrument(final int type, final Sound sound) {
|
||||
private Instrument(final int type) {
|
||||
this.type = (byte) type;
|
||||
@@ -130,9 +128,8 @@ public enum Instrument {
|
||||
@@ -117,9 +115,8 @@ public enum Instrument {
|
||||
|
||||
/**
|
||||
* @return The type ID of this instrument.
|
||||
@@ -87,7 +86,7 @@ index 032d7b812ddc0a85e316882c8f7de0c5a0a4fd30..8df26e0d7bea77bb257cddbc2ab9e969
|
||||
public byte getType() {
|
||||
return this.type;
|
||||
}
|
||||
@@ -142,9 +139,8 @@ public enum Instrument {
|
||||
@@ -129,9 +126,8 @@ public enum Instrument {
|
||||
*
|
||||
* @param type The type ID
|
||||
* @return The instrument
|
||||
@@ -98,6 +97,21 @@ index 032d7b812ddc0a85e316882c8f7de0c5a0a4fd30..8df26e0d7bea77bb257cddbc2ab9e969
|
||||
@Nullable
|
||||
public static Instrument getByType(final byte type) {
|
||||
return BY_DATA.get(type);
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 4d1d81ddc7638e958f9cd1b10fd26227efc1578d..fdb0b8b81e53c85c865c4a3a895719f5afbffd17 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -511,9 +511,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
public void playNote(@NotNull Location loc, byte instrument, byte note);
|
||||
|
||||
/**
|
||||
- * Play a note for a player at a location. This requires a note block
|
||||
- * at the particular location (as far as the client is concerned). This
|
||||
- * will not work without a note block. This will not work with cake.
|
||||
+ * Play a note for a player at a location.
|
||||
*
|
||||
* @param loc The location of a note block
|
||||
* @param instrument The instrument
|
||||
diff --git a/src/test/java/org/bukkit/InstrumentTest.java b/src/test/java/org/bukkit/InstrumentTest.java
|
||||
index 8c1d88885de7d56c1b7c78d2e6e059b0648c982a..b177a47a5bda05bfe3598ec5e6771b92a73f0edf 100644
|
||||
--- a/src/test/java/org/bukkit/InstrumentTest.java
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Sneaking API for Entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 368d8da056e41103ad10dde177cc244148c0130e..d601145b41f7e8d0441c0db7ac98a03361866739 100644
|
||||
index 7f341ba602f0ecbc2953bb19589146b5ae5d0ea9..9c7eba228dc1c244d49cb5139e1710804b887d6a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -777,6 +777,25 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -779,6 +779,25 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@NotNull
|
||||
Pose getPose();
|
||||
|
||||
@@ -35,7 +35,7 @@ index 368d8da056e41103ad10dde177cc244148c0130e..d601145b41f7e8d0441c0db7ac98a033
|
||||
* Get the category of spawn to which this entity belongs.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index e356a0927517d2e5a836e9e39514129f2ac5f54d..b6ddd0035c5e85fcae8e6c317503aabf93e78409 100644
|
||||
index fdb0b8b81e53c85c865c4a3a895719f5afbffd17..2e4b2ad1907a2d5f4462c5fd2d1482f2bb623d3b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -414,6 +414,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Flying Fall Damage API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 1a005fde018a7752209fbdcd92714d67ae5cc633..b9c8ca96b36050b2420c9f168bc15767f751ec23 100644
|
||||
index 03b4f90ba0cdab27b1ce47eef5489e8639f6d960..7df1dd673cd75cb4dc29bbe2c538d0131eeff03e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1765,6 +1765,23 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1702,6 +1702,23 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public void setAllowFlight(boolean flight);
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Win Screen API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index b9c8ca96b36050b2420c9f168bc15767f751ec23..5e1a706fb68658061ab5c29cba82d411716e5692 100644
|
||||
index 4db6e9802105eba76d6f59b74873bea9502d2c7e..07d018c4c57d5519554db9063f6e91d017801719 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1135,6 +1135,47 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1072,6 +1072,47 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public void sendMap(@NotNull MapView map);
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Entity Body Yaw API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index d601145b41f7e8d0441c0db7ac98a03361866739..07f111b944209dbd395620bae603c42752d1cf25 100644
|
||||
index 9c7eba228dc1c244d49cb5139e1710804b887d6a..db4231b6e77a7cf9fe430e5207c1fc9c1702c3f7 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -945,6 +945,43 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -947,6 +947,43 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
* @return true if in powdered snow.
|
||||
*/
|
||||
boolean isInPowderedSnow();
|
||||
|
||||
@@ -769,10 +769,10 @@ index af2bbeff54f0044f51bf0df17727b2f8bec33fe4..3d8a33563cb266fd784e264f6ce38502
|
||||
+ // Paper end - Folia region threading API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 07f111b944209dbd395620bae603c42752d1cf25..6602ce33224a337764f8e94422bad3912e3d545b 100644
|
||||
index db4231b6e77a7cf9fe430e5207c1fc9c1702c3f7..accf3f265ddd49ab866508d1a71289e185827d5e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1005,4 +1005,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -1007,4 +1007,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
boolean wouldCollideUsing(@NotNull BoundingBox boundingBox);
|
||||
// Paper End - Collision API
|
||||
|
||||
@@ -7,10 +7,10 @@ Was obtainable through different methods, but you had to use different
|
||||
methods depending on the implementation of Entity you were working with.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 6602ce33224a337764f8e94422bad3912e3d545b..c6502a549cf791c769ada483d498673eb969294f 100644
|
||||
index accf3f265ddd49ab866508d1a71289e185827d5e..2177eb74ab50b30b100aa8f35fc1d99b860ea7fd 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1016,4 +1016,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -1018,4 +1018,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
@NotNull io.papermc.paper.threadedregions.scheduler.EntityScheduler getScheduler();
|
||||
// Paper end - Folia schedulers
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Listing API for Player
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 7d44e8c3c52dcaa732525aa89cbe3d19e3e31b20..f376a6b77aeff0fbe8b0655bd2f1c43e19bbe3ce 100644
|
||||
index 0e188288e5ba94b1d17503258c5e1217d08e5549..229bad6cb9433027e06f4247baf7d8c962fdc40b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1901,6 +1901,32 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1838,6 +1838,32 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@ApiStatus.Experimental
|
||||
public boolean canSee(@NotNull Entity entity);
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expand Pose API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index c6502a549cf791c769ada483d498673eb969294f..9e3cb75536ae260dc898ab9dafbc1d98398782bc 100644
|
||||
index 2177eb74ab50b30b100aa8f35fc1d99b860ea7fd..d340ddcf6924cc834455de3acbbac91ab9c66e39 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -794,6 +794,42 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -796,6 +796,42 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
* @param sneak true if the entity should be sneaking
|
||||
*/
|
||||
void setSneaking(boolean sneak);
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API
|
||||
Implements API for getting and resetting a player's idle duration.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 7b74fe780a8f99068c542f2deb261503ffc3b9e5..47fcfa2a3358766dfda2efc9bbcf5b50e3f2f7c1 100644
|
||||
index 229bad6cb9433027e06f4247baf7d8c962fdc40b..9240ea09206461d61cc08d4252e8507555bf41cf 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3339,6 +3339,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3280,6 +3280,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
void increaseWardenWarningLevel();
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ Subject: [PATCH] Add predicate for blocks when raytracing
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 298e63e0ca9d4cbac3172fd93a217af79fad91df..f72f0f0f8eee95f95adc969d55ba7de82ee30e2a 100644
|
||||
index bc6630345bb42eb365ba0057a4c52b1e10c6a05a..5eb3521f5f91b0684b4beebf4f7ba2c795b41c42 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -1692,6 +1692,27 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -1714,6 +1714,28 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<? super Entity> filter);
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<Entity> filter);
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
@@ -30,13 +30,14 @@ index 298e63e0ca9d4cbac3172fd93a217af79fad91df..f72f0f0f8eee95f95adc969d55ba7de8
|
||||
+ * @return the closest ray trace hit result, or <code>null</code> if there
|
||||
+ * is no hit
|
||||
+ */
|
||||
+ @Nullable RayTraceResult rayTraceEntities(io.papermc.paper.math.@NotNull Position start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<? super Entity> filter);
|
||||
+ @Nullable
|
||||
+ public RayTraceResult rayTraceEntities(@NotNull io.papermc.paper.math.Position start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<Entity> filter);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Performs a ray trace that checks for block collisions using the blocks'
|
||||
* precise collision shapes.
|
||||
@@ -1755,6 +1776,34 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -1777,6 +1799,35 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks);
|
||||
|
||||
@@ -65,15 +66,16 @@ index 298e63e0ca9d4cbac3172fd93a217af79fad91df..f72f0f0f8eee95f95adc969d55ba7de8
|
||||
+ * with, or <code>null</code> to consider all blocks
|
||||
+ * @return the ray trace hit result, or <code>null</code> if there is no hit
|
||||
+ */
|
||||
+ @Nullable RayTraceResult rayTraceBlocks(io.papermc.paper.math.@NotNull Position start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, @Nullable Predicate<? super Block> canCollide);
|
||||
+ @Nullable
|
||||
+ public RayTraceResult rayTraceBlocks(@NotNull io.papermc.paper.math.Position start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, @Nullable Predicate<Block> canCollide);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Performs a ray trace that checks for both block and entity collisions.
|
||||
* <p>
|
||||
@@ -1788,6 +1837,42 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -1810,6 +1861,43 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<? super Entity> filter);
|
||||
public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<Entity> filter);
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
@@ -108,7 +110,8 @@ index 298e63e0ca9d4cbac3172fd93a217af79fad91df..f72f0f0f8eee95f95adc969d55ba7de8
|
||||
+ * @return the closest ray trace hit result with either a block or an
|
||||
+ * entity, or <code>null</code> if there is no hit
|
||||
+ */
|
||||
+ @Nullable RayTraceResult rayTrace(io.papermc.paper.math.@NotNull Position start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<? super Entity> filter, @Nullable Predicate<? super Block> canCollide);
|
||||
+ @Nullable
|
||||
+ public RayTraceResult rayTrace(@NotNull io.papermc.paper.math.Position start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<Entity> filter, @Nullable Predicate<Block> canCollide);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
Date: Tue, 28 Nov 2023 19:28:45 -0700
|
||||
Subject: [PATCH] MergedProperties POC
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index e827ee211e3c65dc68ac5867fd8476639df63645..7456c41ccf126790ec11652d244710e2b797f237 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -1,3 +1,5 @@
|
||||
+import io.papermc.paperweight.util.MergedProperties
|
||||
+
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
@@ -9,11 +11,13 @@ java {
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
-val annotationsVersion = "24.0.1"
|
||||
-val bungeeCordChatVersion = "1.20-R0.1"
|
||||
-val adventureVersion = "4.14.0"
|
||||
-val slf4jVersion = "1.8.0-beta4"
|
||||
-val log4jVersion = "2.17.1"
|
||||
+val versions = MergedProperties.fromAllProjects(project, "versions.properties")
|
||||
+val annotationsVersion by versions
|
||||
+val bungeeCordChatVersion by versions
|
||||
+val adventureVersion by versions
|
||||
+val slf4jVersion by versions
|
||||
+val log4jVersion by versions
|
||||
+val asmVersion by versions
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
attributes {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||
@@ -48,8 +52,8 @@ dependencies {
|
||||
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
|
||||
api("org.slf4j:slf4j-api:$slf4jVersion")
|
||||
|
||||
- implementation("org.ow2.asm:asm:9.4")
|
||||
- implementation("org.ow2.asm:asm-commons:9.4")
|
||||
+ implementation("org.ow2.asm:asm:$asmVersion")
|
||||
+ implementation("org.ow2.asm:asm-commons:$asmVersion")
|
||||
// Paper end
|
||||
|
||||
api("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
@@ -71,7 +75,7 @@ dependencies {
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
testImplementation("org.mockito:mockito-core:5.5.0")
|
||||
- testImplementation("org.ow2.asm:asm-tree:9.5")
|
||||
+ testImplementation("org.ow2.asm:asm-tree:$asmVersion")
|
||||
}
|
||||
|
||||
// Paper start
|
||||
diff --git a/versions.properties b/versions.properties
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4e284ef8c083571a6655c9beeaaa20bd554b8395
|
||||
--- /dev/null
|
||||
+++ b/versions.properties
|
||||
@@ -0,0 +1,6 @@
|
||||
+annotationsVersion = 24.0.1
|
||||
+bungeeCordChatVersion = 1.20-R0.1
|
||||
+adventureVersion = 4.14.0
|
||||
+slf4jVersion = 1.8.0-beta4
|
||||
+log4jVersion = 2.17.1
|
||||
+asmVersion = 9.6
|
||||
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
Date: Sat, 25 Nov 2023 16:01:27 -0800
|
||||
Subject: [PATCH] Version Catalog POC
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index e827ee211e3c65dc68ac5867fd8476639df63645..76153b68ef7a6cfbea5350229362d52122bf8c35 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -11,7 +11,7 @@ java {
|
||||
|
||||
val annotationsVersion = "24.0.1"
|
||||
val bungeeCordChatVersion = "1.20-R0.1"
|
||||
-val adventureVersion = "4.14.0"
|
||||
+val adventureVersion = libs.versions.adventure.get()
|
||||
val slf4jVersion = "1.8.0-beta4"
|
||||
val log4jVersion = "2.17.1"
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
@@ -32,7 +32,7 @@ dependencies {
|
||||
api("com.google.code.gson:gson:2.10.1")
|
||||
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") // Paper
|
||||
api("org.yaml:snakeyaml:2.2")
|
||||
- api("org.joml:joml:1.10.5")
|
||||
+ api(libs.joml)
|
||||
// Paper start
|
||||
api("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||
isTransitive = false // includes junit
|
||||
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..791bbc8d0d4b277a637c665b20a507e1d44f75f8
|
||||
--- /dev/null
|
||||
+++ b/gradle/libs.versions.toml
|
||||
@@ -0,0 +1,5 @@
|
||||
+[versions]
|
||||
+adventure = "4.14.0"
|
||||
+
|
||||
+[libraries]
|
||||
+joml = "org.joml:joml:1.10.5"
|
||||
@@ -8,7 +8,7 @@ apply if there are changes made to it from upstream - thus notifying us
|
||||
that changes were made.
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 37dab9e868dbfb019c271a547d975a48ad1cb571..3811c0d849a3eb028ed1a6b7a2d4747f7f570448 100644
|
||||
index 3df8c60ab5cd1454660980883f80668d535b742b..37c3a00659ce21623be07317f4f6a45bf990d799 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -1,3 +1,6 @@
|
||||
@@ -18,7 +18,7 @@ index 37dab9e868dbfb019c271a547d975a48ad1cb571..3811c0d849a3eb028ed1a6b7a2d4747f
|
||||
# Eclipse stuff
|
||||
/.classpath
|
||||
/.project
|
||||
@@ -39,3 +42,7 @@ dependency-reduced-pom.xml
|
||||
@@ -38,3 +41,7 @@ dependency-reduced-pom.xml
|
||||
|
||||
/src/main/resources/achievement
|
||||
/src/main/resources/lang
|
||||
|
||||
@@ -6987,7 +6987,7 @@ index dc1f88a562c61781ea9e86ff40041e9fecd308e0..4ff18d9995d5d26bde4dbe2ec31c77c2
|
||||
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 82c9886222d49bd03b642c0d9c07d82d1d27896b..44ae05684a2fe19d3e25617a4fa133c932fd4e51 100644
|
||||
index 0668f61ff7e52d1ea32af9f1fd1879d7280bb7cd..3c00b7519b37c5026e80e76a4b4ced2a3a0166f6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -176,6 +176,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
|
||||
@@ -7193,7 +7193,7 @@ index 337e0a7b3c14e1b1a28744920e0dc0a69e0c5a87..f5829ae484d93b547a5437b85a962134
|
||||
@Override
|
||||
public void tell(R runnable) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a741631a6ead201a79ffa4754fc9d6f3e188a04c..140c6befe7f5cba51904eaae0dc88e936f660a12 100644
|
||||
index 33a88623ef7011fd60b2e4dd008bf54635714d81..9a29dea3c02cbca89faaa1cd9b750f1a2694d100 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -323,6 +323,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -7860,10 +7860,10 @@ index 25156be63f91a1c41ef41154f675d04eb97459a8..47bab513feec217d875192afef61f3af
|
||||
return false;
|
||||
} else {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 30277808c2206b5519477be46ec8a866dd026012..cc9636326687f9d7cd091c97032ce3e43931625d 100644
|
||||
index 300e79c796dcfcacd4e4828cd239291de54e07f0..9e1c76fe26a07bc211182b819df611b7b8fd2a13 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -245,8 +245,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -243,8 +243,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public Chunk[] getLoadedChunks() {
|
||||
@@ -7874,7 +7874,7 @@ index 30277808c2206b5519477be46ec8a866dd026012..cc9636326687f9d7cd091c97032ce3e4
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -321,7 +321,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -319,7 +319,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public boolean refreshChunk(int x, int z) {
|
||||
@@ -7883,7 +7883,7 @@ index 30277808c2206b5519477be46ec8a866dd026012..cc9636326687f9d7cd091c97032ce3e4
|
||||
if (playerChunk == null) return false;
|
||||
|
||||
playerChunk.getTickingChunkFuture().thenAccept(either -> {
|
||||
@@ -2024,4 +2024,32 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1997,4 +1997,32 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return this.spigot;
|
||||
}
|
||||
// Spigot end
|
||||
@@ -7917,7 +7917,7 @@ index 30277808c2206b5519477be46ec8a866dd026012..cc9636326687f9d7cd091c97032ce3e4
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 903ff5a3dbeb4c3cfc1e45765880cc6c03819795..278c2adf102c1ec40328c3f4a966afc33586a7e4 100644
|
||||
index c2a1c122f2072759ee69833f3529a89cde3ba535..145542a29cc7df606328a106dd044db956b2c8ff 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1202,4 +1202,37 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -7980,7 +7980,7 @@ index c6881e1d74476c2633e2c2bd3636134c844c5942..8eb170bd71c7158dcd1b90f9c8d46a13
|
||||
if (original instanceof CraftItemStack) {
|
||||
CraftItemStack stack = (CraftItemStack) original;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index 905adf97c0d1f0d1c774a6835a5dffcfea884e58..2b80ddb42c8e5fd32b37f89e894353167c8a698e 100644
|
||||
index 591c71352ad2a041ba5dc3d05b7ebc65fcca5e3c..e359668d9f4fceae13bf6c36842db9f2b2817c9b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -44,6 +44,7 @@ import org.bukkit.scheduler.BukkitWorker;
|
||||
|
||||
@@ -2868,7 +2868,7 @@ index 23bdb77690ba15bcbbfb0c70af23336d08ac7752..8f144a357174bbe096ac9b38a5e67a61
|
||||
}
|
||||
collection = icons;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b7d5b46fa3af1420a402addb73d6ed95f2456375..269174b1baa6edf91406d563c7873165da2c0b81 100644
|
||||
index 3d2c168d29873c4418bc297740e7032d6020ff52..61f124c9c607d077cdaa6a1e9b14b323057af52d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -617,8 +617,10 @@ public final class CraftServer implements Server {
|
||||
@@ -3053,10 +3053,10 @@ index b7d5b46fa3af1420a402addb73d6ed95f2456375..269174b1baa6edf91406d563c7873165
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index cc9636326687f9d7cd091c97032ce3e43931625d..1678a5eca31033d31ea76bb8918b8d7323c884a7 100644
|
||||
index 9e1c76fe26a07bc211182b819df611b7b8fd2a13..264cdde172452d0d9df652b0e78b21b6a6561300 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -155,6 +155,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -153,6 +153,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
private final BlockMetadataStore blockMetadata = new BlockMetadataStore(this);
|
||||
private final Object2IntOpenHashMap<SpawnCategory> spawnCategoryLimit = new Object2IntOpenHashMap<>();
|
||||
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY);
|
||||
@@ -3064,7 +3064,7 @@ index cc9636326687f9d7cd091c97032ce3e43931625d..1678a5eca31033d31ea76bb8918b8d73
|
||||
|
||||
private static final Random rand = new Random();
|
||||
|
||||
@@ -1631,6 +1632,39 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1604,6 +1605,39 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
entityTracker.broadcastAndSend(packet);
|
||||
}
|
||||
}
|
||||
@@ -3104,7 +3104,7 @@ index cc9636326687f9d7cd091c97032ce3e43931625d..1678a5eca31033d31ea76bb8918b8d73
|
||||
|
||||
private static Map<String, GameRules.Key<?>> gamerules;
|
||||
public static synchronized Map<String, GameRules.Key<?>> getGameRulesNMS() {
|
||||
@@ -2051,5 +2085,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -2024,5 +2058,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -3644,7 +3644,7 @@ index 61759e8179d0f6342abf0c0294e5a024928db8d9..92e21126a9347f1ee2279ab09bb6abf2
|
||||
public boolean isOp() {
|
||||
return true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a9edc0a73 100644
|
||||
index 54888af764f206690ecc5b3331a13a570972eac3..12a027e243d5336d5e96b88229499bfd2f65758c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -296,14 +296,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -3763,7 +3763,7 @@ index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a
|
||||
@Override
|
||||
public void setCompassTarget(Location loc) {
|
||||
Preconditions.checkArgument(loc != null, "Location cannot be null");
|
||||
@@ -685,6 +727,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -683,6 +725,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.send(packet);
|
||||
}
|
||||
|
||||
@@ -3788,7 +3788,7 @@ index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a
|
||||
@Override
|
||||
public void sendSignChange(Location loc, String[] lines) {
|
||||
this.sendSignChange(loc, lines, DyeColor.BLACK);
|
||||
@@ -708,6 +768,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -706,6 +766,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
if (this.getHandle().connection == null) return;
|
||||
|
||||
Component[] components = CraftSign.sanitizeLines(lines);
|
||||
@@ -3800,7 +3800,7 @@ index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a
|
||||
SignBlockEntity sign = new SignBlockEntity(CraftLocation.toBlockPosition(loc), Blocks.OAK_SIGN.defaultBlockState());
|
||||
SignText text = sign.getFrontText();
|
||||
text = text.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData()));
|
||||
@@ -717,7 +782,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -715,7 +780,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
sign.setText(text, true);
|
||||
|
||||
@@ -3810,7 +3810,7 @@ index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1686,7 +1752,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1684,7 +1750,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public void setResourcePack(String url) {
|
||||
@@ -3819,7 +3819,7 @@ index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1701,7 +1767,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1699,7 +1765,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public void setResourcePack(String url, byte[] hash, boolean force) {
|
||||
@@ -3828,7 +3828,7 @@ index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1717,6 +1783,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1715,6 +1781,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3850,7 +3850,7 @@ index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a
|
||||
public void addChannel(String channel) {
|
||||
Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);
|
||||
channel = StandardMessenger.validateAndCorrectChannel(channel);
|
||||
@@ -2112,6 +2193,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2110,6 +2191,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return (this.getHandle().requestedViewDistance() == 0) ? Bukkit.getViewDistance() : this.getHandle().requestedViewDistance();
|
||||
}
|
||||
|
||||
@@ -3863,7 +3863,7 @@ index 2aee9019af40abfae16dcf82aa1fb381c0365110..405142188f1b4089fbec38e54266514a
|
||||
@Override
|
||||
public int getPing() {
|
||||
return this.getHandle().connection.latency();
|
||||
@@ -2162,6 +2249,252 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2160,6 +2247,252 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return this.getHandle().allowsListing();
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ index 0000000000000000000000000000000000000000..f0fce4113fb07c64adbec029d177c236
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/command/subcommands/DumpPluginsCommand.java b/src/main/java/io/papermc/paper/command/subcommands/DumpPluginsCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d4a092243e587e3a555fbc0f00c8f78c00b3d1c6
|
||||
index 0000000000000000000000000000000000000000..8ade7eb97aa899ddd4bb8274b8f588a4d7265868
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/command/subcommands/DumpPluginsCommand.java
|
||||
@@ -0,0 +1,203 @@
|
||||
@@ -272,7 +272,7 @@ index 0000000000000000000000000000000000000000..d4a092243e587e3a555fbc0f00c8f78c
|
||||
+import io.papermc.paper.plugin.entrypoint.classloader.group.SpigotPluginClassLoaderGroup;
|
||||
+import io.papermc.paper.plugin.entrypoint.classloader.group.StaticPluginClassLoaderGroup;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.GraphDependencyContext;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.SimpleMetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.provider.entrypoint.DependencyContext;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.ProviderConfiguration;
|
||||
@@ -397,7 +397,7 @@ index 0000000000000000000000000000000000000000..d4a092243e587e3a555fbc0f00c8f78c
|
||||
+ return false;
|
||||
+ }
|
||||
+ });
|
||||
+ modernPluginLoadingStrategy.loadProviders(pluginProviders, new SimpleMetaDependencyTree(GraphBuilder.directed().build()));
|
||||
+ modernPluginLoadingStrategy.loadProviders(pluginProviders, new MetaDependencyTree(GraphBuilder.directed().build()));
|
||||
+
|
||||
+ rootProviders.add(entry.getKey().getDebugName(), entrypoint);
|
||||
+ }
|
||||
@@ -1714,56 +1714,6 @@ index 0000000000000000000000000000000000000000..2412155ddfd559023f42ff534b8f06a5
|
||||
+ '}';
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/BootstrapMetaDependencyTree.java b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/BootstrapMetaDependencyTree.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..74bf07be300d4893402614c9e9d9ac97dc574ac7
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/BootstrapMetaDependencyTree.java
|
||||
@@ -0,0 +1,44 @@
|
||||
+package io.papermc.paper.plugin.entrypoint.dependency;
|
||||
+
|
||||
+import com.google.common.graph.GraphBuilder;
|
||||
+import com.google.common.graph.MutableGraph;
|
||||
+import io.papermc.paper.plugin.configuration.PluginMeta;
|
||||
+import io.papermc.paper.plugin.provider.configuration.PaperPluginMeta;
|
||||
+
|
||||
+public class BootstrapMetaDependencyTree extends MetaDependencyTree {
|
||||
+ public BootstrapMetaDependencyTree() {
|
||||
+ this(GraphBuilder.directed().build());
|
||||
+ }
|
||||
+
|
||||
+ public BootstrapMetaDependencyTree(MutableGraph<String> graph) {
|
||||
+ super(graph);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void registerDependencies(final String identifier, final PluginMeta meta) {
|
||||
+ if (!(meta instanceof PaperPluginMeta paperPluginMeta)) {
|
||||
+ throw new IllegalStateException("Only paper plugins can have a bootstrapper!");
|
||||
+ }
|
||||
+ // Build a validated provider's dependencies into the graph
|
||||
+ for (String dependency : paperPluginMeta.getBoostrapDependencies().keySet()) {
|
||||
+ this.graph.putEdge(identifier, dependency);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void unregisterDependencies(final String identifier, final PluginMeta meta) {
|
||||
+ if (!(meta instanceof PaperPluginMeta paperPluginMeta)) {
|
||||
+ throw new IllegalStateException("PluginMeta must be a PaperPluginMeta");
|
||||
+ }
|
||||
+
|
||||
+ // Build a validated provider's dependencies into the graph
|
||||
+ for (String dependency : paperPluginMeta.getBoostrapDependencies().keySet()) {
|
||||
+ this.graph.removeEdge(identifier, dependency);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String toString() {
|
||||
+ return "BootstrapDependencyTree{" + "graph=" + this.graph + '}';
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/DependencyContextHolder.java b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/DependencyContextHolder.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f43295fdeaa587cf30c35a1d545167071d58ce4b
|
||||
@@ -1841,10 +1791,10 @@ index 0000000000000000000000000000000000000000..a2fa8406bc3f0dcab6805633ae984d03
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/MetaDependencyTree.java b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/MetaDependencyTree.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..461ef285764aac88ced32be5e650b48e8fbc6bfd
|
||||
index 0000000000000000000000000000000000000000..e72bec3b0cbc41580f1b4beecae316d1c083d3e3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/MetaDependencyTree.java
|
||||
@@ -0,0 +1,110 @@
|
||||
@@ -0,0 +1,117 @@
|
||||
+package io.papermc.paper.plugin.entrypoint.dependency;
|
||||
+
|
||||
+import com.google.common.graph.GraphBuilder;
|
||||
@@ -1854,16 +1804,17 @@ index 0000000000000000000000000000000000000000..461ef285764aac88ced32be5e650b48e
|
||||
+import io.papermc.paper.plugin.provider.PluginProvider;
|
||||
+import io.papermc.paper.plugin.provider.entrypoint.DependencyContext;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Set;
|
||||
+
|
||||
+public abstract class MetaDependencyTree implements DependencyContext {
|
||||
+public class MetaDependencyTree implements DependencyContext {
|
||||
+
|
||||
+ protected final MutableGraph<String> graph;
|
||||
+ private final MutableGraph<String> graph;
|
||||
+
|
||||
+ // We need to upkeep a separate collection since when populating
|
||||
+ // a graph it adds nodes even if they are not present
|
||||
+ protected final Set<String> dependencies = new HashSet<>();
|
||||
+ private final Set<String> dependencies = new HashSet<>();
|
||||
+
|
||||
+ public MetaDependencyTree() {
|
||||
+ this(GraphBuilder.directed().build());
|
||||
@@ -1873,10 +1824,23 @@ index 0000000000000000000000000000000000000000..461ef285764aac88ced32be5e650b48e
|
||||
+ this.graph = graph;
|
||||
+ }
|
||||
+
|
||||
+ public void add(PluginProvider<?> provider) {
|
||||
+ add(provider.getMeta());
|
||||
+ }
|
||||
+
|
||||
+ public void remove(PluginProvider<?> provider) {
|
||||
+ remove(provider.getMeta());
|
||||
+ }
|
||||
+
|
||||
+ public void add(PluginMeta configuration) {
|
||||
+ String identifier = configuration.getName();
|
||||
+ // Build a validated provider's dependencies into the graph
|
||||
+ this.registerDependencies(identifier, configuration);
|
||||
+ for (String dependency : configuration.getPluginDependencies()) {
|
||||
+ this.graph.putEdge(identifier, dependency);
|
||||
+ }
|
||||
+ for (String dependency : configuration.getPluginSoftDependencies()) {
|
||||
+ this.graph.putEdge(identifier, dependency);
|
||||
+ }
|
||||
+
|
||||
+ this.graph.addNode(identifier); // Make sure dependencies at least have a node
|
||||
+
|
||||
@@ -1888,12 +1852,15 @@ index 0000000000000000000000000000000000000000..461ef285764aac88ced32be5e650b48e
|
||||
+ this.dependencies.add(identifier);
|
||||
+ }
|
||||
+
|
||||
+ protected abstract void registerDependencies(String identifier, PluginMeta meta);
|
||||
+
|
||||
+ public void remove(PluginMeta configuration) {
|
||||
+ String identifier = configuration.getName();
|
||||
+ // Remove a validated provider's dependencies into the graph
|
||||
+ this.unregisterDependencies(identifier, configuration);
|
||||
+ for (String dependency : configuration.getPluginDependencies()) {
|
||||
+ this.graph.removeEdge(identifier, dependency);
|
||||
+ }
|
||||
+ for (String dependency : configuration.getPluginSoftDependencies()) {
|
||||
+ this.graph.removeEdge(identifier, dependency);
|
||||
+ }
|
||||
+
|
||||
+ this.graph.removeNode(identifier); // Remove root node
|
||||
+
|
||||
@@ -1905,8 +1872,6 @@ index 0000000000000000000000000000000000000000..461ef285764aac88ced32be5e650b48e
|
||||
+ this.dependencies.remove(identifier);
|
||||
+ }
|
||||
+
|
||||
+ protected abstract void unregisterDependencies(String identifier, PluginMeta meta);
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isTransitiveDependency(@NotNull PluginMeta plugin, @NotNull PluginMeta depend) {
|
||||
+ String pluginIdentifier = plugin.getName();
|
||||
@@ -1931,13 +1896,14 @@ index 0000000000000000000000000000000000000000..461ef285764aac88ced32be5e650b48e
|
||||
+ return this.dependencies.contains(pluginIdentifier);
|
||||
+ }
|
||||
+
|
||||
+ // Used by the legacy loader -- this isn't recommended
|
||||
+ public void addDirectDependency(String dependency) {
|
||||
+ this.dependencies.add(dependency);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String toString() {
|
||||
+ return "SimpleDependencyTree{" +
|
||||
+ return "ProviderDependencyTree{" +
|
||||
+ "graph=" + this.graph +
|
||||
+ '}';
|
||||
+ }
|
||||
@@ -1945,61 +1911,6 @@ index 0000000000000000000000000000000000000000..461ef285764aac88ced32be5e650b48e
|
||||
+ public MutableGraph<String> getGraph() {
|
||||
+ return graph;
|
||||
+ }
|
||||
+
|
||||
+ public void add(PluginProvider<?> provider) {
|
||||
+ this.add(provider.getMeta());
|
||||
+ }
|
||||
+
|
||||
+ public void remove(PluginProvider<?> provider) {
|
||||
+ this.remove(provider.getMeta());
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/SimpleMetaDependencyTree.java b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/SimpleMetaDependencyTree.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..910caf78636769977dff55dd048c0150a36d218d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/SimpleMetaDependencyTree.java
|
||||
@@ -0,0 +1,40 @@
|
||||
+package io.papermc.paper.plugin.entrypoint.dependency;
|
||||
+
|
||||
+import com.google.common.graph.GraphBuilder;
|
||||
+import com.google.common.graph.Graphs;
|
||||
+import com.google.common.graph.MutableGraph;
|
||||
+import io.papermc.paper.plugin.configuration.PluginMeta;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Set;
|
||||
+
|
||||
+public class SimpleMetaDependencyTree extends MetaDependencyTree {
|
||||
+
|
||||
+ public SimpleMetaDependencyTree() {
|
||||
+ }
|
||||
+
|
||||
+ public SimpleMetaDependencyTree(final MutableGraph<String> graph) {
|
||||
+ super(graph);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void registerDependencies(final String identifier, final PluginMeta meta) {
|
||||
+ for (String dependency : meta.getPluginDependencies()) {
|
||||
+ this.graph.putEdge(identifier, dependency);
|
||||
+ }
|
||||
+ for (String dependency : meta.getPluginSoftDependencies()) {
|
||||
+ this.graph.putEdge(identifier, dependency);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void unregisterDependencies(final String identifier, final PluginMeta meta) {
|
||||
+ for (String dependency : meta.getPluginDependencies()) {
|
||||
+ this.graph.removeEdge(identifier, dependency);
|
||||
+ }
|
||||
+ for (String dependency : meta.getPluginSoftDependencies()) {
|
||||
+ this.graph.removeEdge(identifier, dependency);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/strategy/JohnsonSimpleCycles.java b/src/main/java/io/papermc/paper/plugin/entrypoint/strategy/JohnsonSimpleCycles.java
|
||||
new file mode 100644
|
||||
@@ -3244,7 +3155,7 @@ index 0000000000000000000000000000000000000000..aef19b44075a3b2e8696315baa89117d
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/MultiRuntimePluginProviderStorage.java b/src/main/java/io/papermc/paper/plugin/manager/MultiRuntimePluginProviderStorage.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d681222f355af5c4c26f35aaba484a393aee41c6
|
||||
index 0000000000000000000000000000000000000000..49bcce79139797649c775af65c7310c149611a56
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/MultiRuntimePluginProviderStorage.java
|
||||
@@ -0,0 +1,61 @@
|
||||
@@ -3305,7 +3216,7 @@ index 0000000000000000000000000000000000000000..d681222f355af5c4c26f35aaba484a39
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public MetaDependencyTree createDependencyTree() {
|
||||
+ public MetaDependencyTree getDependencyTree() {
|
||||
+ return this.dependencyTree;
|
||||
+ }
|
||||
+}
|
||||
@@ -3767,10 +3678,10 @@ index 0000000000000000000000000000000000000000..92a69677f21b2c1c035119d8e5a6af63
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..08b1aab5d37a56dc42542ce15ba1f7ccd1b08400
|
||||
index 0000000000000000000000000000000000000000..9c7552968b8c017c71a7a77557a66a03ed89f125
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
|
||||
@@ -0,0 +1,302 @@
|
||||
@@ -0,0 +1,301 @@
|
||||
+package io.papermc.paper.plugin.manager;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
@@ -3779,7 +3690,6 @@ index 0000000000000000000000000000000000000000..08b1aab5d37a56dc42542ce15ba1f7cc
|
||||
+import io.papermc.paper.plugin.configuration.PluginMeta;
|
||||
+import io.papermc.paper.plugin.entrypoint.Entrypoint;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.SimpleMetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.PluginGraphCycleException;
|
||||
+import io.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader;
|
||||
+import io.papermc.paper.plugin.provider.classloader.PaperClassLoaderStorage;
|
||||
@@ -3829,7 +3739,7 @@ index 0000000000000000000000000000000000000000..08b1aab5d37a56dc42542ce15ba1f7cc
|
||||
+ private final CommandMap commandMap;
|
||||
+ private final Server server;
|
||||
+
|
||||
+ private final MetaDependencyTree dependencyTree = new SimpleMetaDependencyTree(GraphBuilder.directed().build());
|
||||
+ private final MetaDependencyTree dependencyTree = new MetaDependencyTree(GraphBuilder.directed().build());
|
||||
+
|
||||
+ public PaperPluginInstanceManager(PluginManager pluginManager, CommandMap commandMap, Server server) {
|
||||
+ this.commandMap = commandMap;
|
||||
@@ -4375,7 +4285,7 @@ index 0000000000000000000000000000000000000000..5d50d1d312388e979c0e1cd53a6bf597
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/SingularRuntimePluginProviderStorage.java b/src/main/java/io/papermc/paper/plugin/manager/SingularRuntimePluginProviderStorage.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b0e723bcda9b1fc01e6aa5e53e57c09ea4f1a1c8
|
||||
index 0000000000000000000000000000000000000000..3872f5a9287fc348d57812847ab18eb2d3e4b362
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/SingularRuntimePluginProviderStorage.java
|
||||
@@ -0,0 +1,79 @@
|
||||
@@ -4454,7 +4364,7 @@ index 0000000000000000000000000000000000000000..b0e723bcda9b1fc01e6aa5e53e57c09e
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public MetaDependencyTree createDependencyTree() {
|
||||
+ public MetaDependencyTree getDependencyTree() {
|
||||
+ return this.dependencyTree;
|
||||
+ }
|
||||
+}
|
||||
@@ -6635,10 +6545,10 @@ index 0000000000000000000000000000000000000000..14ed05945ba5bfeb2b539d4786278b0e
|
||||
+
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/storage/BootstrapProviderStorage.java b/src/main/java/io/papermc/paper/plugin/storage/BootstrapProviderStorage.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2e96308696e131f3f013469a395e5ddda2c5d529
|
||||
index 0000000000000000000000000000000000000000..8ef13e4f00a61db0dab9ef63231d77adcfaba5ab
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/storage/BootstrapProviderStorage.java
|
||||
@@ -0,0 +1,65 @@
|
||||
@@ -0,0 +1,58 @@
|
||||
+package io.papermc.paper.plugin.storage;
|
||||
+
|
||||
+import com.mojang.logging.LogUtils;
|
||||
@@ -6646,9 +6556,7 @@ index 0000000000000000000000000000000000000000..2e96308696e131f3f013469a395e5ddd
|
||||
+import io.papermc.paper.plugin.bootstrap.BootstrapContext;
|
||||
+import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
|
||||
+import io.papermc.paper.plugin.bootstrap.PluginBootstrapContextImpl;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.BootstrapMetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.DependencyContextHolder;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.ProviderConfiguration;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy;
|
||||
+import io.papermc.paper.plugin.provider.PluginProvider;
|
||||
@@ -6695,11 +6603,6 @@ index 0000000000000000000000000000000000000000..2e96308696e131f3f013469a395e5ddd
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public MetaDependencyTree createDependencyTree() {
|
||||
+ return new BootstrapMetaDependencyTree();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String toString() {
|
||||
+ return "BOOTSTRAP:" + super.toString();
|
||||
+ }
|
||||
@@ -6729,13 +6632,12 @@ index 0000000000000000000000000000000000000000..8ef4806cadabe56264dd861f1a1854b2
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/storage/ProviderStorage.java b/src/main/java/io/papermc/paper/plugin/storage/ProviderStorage.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..39cd3acd3f76b3b0d065e0efb04a3eacea1c2e6b
|
||||
index 0000000000000000000000000000000000000000..374e7d3d69fc8603ecf54999f173123d3a9fbf6e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/storage/ProviderStorage.java
|
||||
@@ -0,0 +1,21 @@
|
||||
@@ -0,0 +1,18 @@
|
||||
+package io.papermc.paper.plugin.storage;
|
||||
+
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.provider.PluginProvider;
|
||||
+
|
||||
+/**
|
||||
@@ -6747,8 +6649,6 @@ index 0000000000000000000000000000000000000000..39cd3acd3f76b3b0d065e0efb04a3eac
|
||||
+
|
||||
+ void register(PluginProvider<T> provider);
|
||||
+
|
||||
+ MetaDependencyTree createDependencyTree();
|
||||
+
|
||||
+ void enter();
|
||||
+
|
||||
+ Iterable<PluginProvider<T>> getRegisteredProviders();
|
||||
@@ -6832,16 +6732,17 @@ index 0000000000000000000000000000000000000000..cb9b13522a976b82bcb71cef486f11f4
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/storage/SimpleProviderStorage.java b/src/main/java/io/papermc/paper/plugin/storage/SimpleProviderStorage.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..26422904751647a061397ce978bba752149003cd
|
||||
index 0000000000000000000000000000000000000000..861c245290696eef0fca846c3026b407593fdce1
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/storage/SimpleProviderStorage.java
|
||||
@@ -0,0 +1,93 @@
|
||||
+package io.papermc.paper.plugin.storage;
|
||||
+
|
||||
+import com.google.common.graph.GraphBuilder;
|
||||
+import com.google.common.graph.MutableGraph;
|
||||
+import com.mojang.logging.LogUtils;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.GraphDependencyContext;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.SimpleMetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.PluginGraphCycleException;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.ProviderLoadingStrategy;
|
||||
+import io.papermc.paper.plugin.provider.PluginProvider;
|
||||
@@ -6873,7 +6774,7 @@ index 0000000000000000000000000000000000000000..26422904751647a061397ce978bba752
|
||||
+ this.filterLoadingProviders(providerList);
|
||||
+
|
||||
+ try {
|
||||
+ for (ProviderLoadingStrategy.ProviderPair<T> providerPair : this.strategy.loadProviders(providerList, this.createDependencyTree())) {
|
||||
+ for (ProviderLoadingStrategy.ProviderPair<T> providerPair : this.strategy.loadProviders(providerList, this.getDependencyTree())) {
|
||||
+ this.processProvided(providerPair.provider(), providerPair.provided());
|
||||
+ }
|
||||
+ } catch (PluginGraphCycleException exception) {
|
||||
@@ -6881,9 +6782,8 @@ index 0000000000000000000000000000000000000000..26422904751647a061397ce978bba752
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public MetaDependencyTree createDependencyTree() {
|
||||
+ return new SimpleMetaDependencyTree(GraphBuilder.directed().build());
|
||||
+ public MetaDependencyTree getDependencyTree() {
|
||||
+ return new MetaDependencyTree(GraphBuilder.directed().build());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -7374,14 +7274,13 @@ index 0000000000000000000000000000000000000000..1d14f530ef888102e47eeeaf0d1a6076
|
||||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/plugin/PluginDependencyValidationTest.java b/src/test/java/io/papermc/paper/plugin/PluginDependencyValidationTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..83b1274ba56f03bec6cb69a35f33dc04f008cc1e
|
||||
index 0000000000000000000000000000000000000000..ad92ae93acd25af4d223a55a0bcbc2a5740390a9
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/plugin/PluginDependencyValidationTest.java
|
||||
@@ -0,0 +1,60 @@
|
||||
@@ -0,0 +1,59 @@
|
||||
+package io.papermc.paper.plugin;
|
||||
+
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.SimpleMetaDependencyTree;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import java.util.List;
|
||||
@@ -7412,7 +7311,7 @@ index 0000000000000000000000000000000000000000..83b1274ba56f03bec6cb69a35f33dc04
|
||||
+
|
||||
+ @Test
|
||||
+ public void testDependencyTree() {
|
||||
+ MetaDependencyTree tree = new SimpleMetaDependencyTree();
|
||||
+ MetaDependencyTree tree = new MetaDependencyTree();
|
||||
+ tree.add(MAIN);
|
||||
+ tree.add(HARD_DEPENDENCY_1);
|
||||
+ tree.add(SOFT_DEPENDENCY_1);
|
||||
@@ -7440,14 +7339,14 @@ index 0000000000000000000000000000000000000000..83b1274ba56f03bec6cb69a35f33dc04
|
||||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/plugin/PluginLoadOrderTest.java b/src/test/java/io/papermc/paper/plugin/PluginLoadOrderTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c2c3c2f24ea802628bc4a36ef180fc08f4e5d288
|
||||
index 0000000000000000000000000000000000000000..a66fd32cf8af310101161c1b820b3468657460f0
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/plugin/PluginLoadOrderTest.java
|
||||
@@ -0,0 +1,148 @@
|
||||
+package io.papermc.paper.plugin;
|
||||
+
|
||||
+import com.google.common.graph.GraphBuilder;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.SimpleMetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
|
||||
+import io.papermc.paper.plugin.provider.entrypoint.DependencyContext;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy;
|
||||
+import io.papermc.paper.plugin.entrypoint.strategy.ProviderConfiguration;
|
||||
@@ -7551,7 +7450,7 @@ index 0000000000000000000000000000000000000000..c2c3c2f24ea802628bc4a36ef180fc08
|
||||
+
|
||||
+ });
|
||||
+
|
||||
+ modernPluginLoadingStrategy.loadProviders(REGISTERED_PROVIDERS, new SimpleMetaDependencyTree(GraphBuilder.directed().build()));
|
||||
+ modernPluginLoadingStrategy.loadProviders(REGISTERED_PROVIDERS, new MetaDependencyTree(GraphBuilder.directed().build()));
|
||||
+ }
|
||||
+
|
||||
+ @Test
|
||||
|
||||
@@ -924,7 +924,7 @@ index 188ac9b2879d339a268f6c100c23f1dce90c195a..d10abd28c522612934aada8124e5bb67
|
||||
i = this.context.runTopCommand(customfunction1, source);
|
||||
} finally {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 672c9d304f448922c5a50c725ac1f0dd988b1853..4b94b1ca21dbc0d9f993c5c9b86965f03aef75b4 100644
|
||||
index bf37590324fc900b1ae0cb49a0f8eaf6af81e93f..71e1f83e871f27f3de3afdbbeb432a9135d51f8b 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -58,8 +58,9 @@ import org.apache.logging.log4j.Level;
|
||||
@@ -1156,7 +1156,7 @@ index 4ff18d9995d5d26bde4dbe2ec31c77c2d1515227..c2db2aad2498f0be2e904d5869a9b0bd
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 44ae05684a2fe19d3e25617a4fa133c932fd4e51..2a3f9168d38350eb3f6d97836fea70ae3023204d 100644
|
||||
index 3c00b7519b37c5026e80e76a4b4ced2a3a0166f6..e48172c1da6beb7ff5ba3486647b126325b826a7 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1,6 +1,8 @@
|
||||
@@ -1633,7 +1633,7 @@ index 0eb09ce5c850d85ffd7229d27cf06b3e0edda11b..cc1d7626a82881c4410d65c6a33dadae
|
||||
};
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index e43969ac2881f14082ecb2af30c7e9145e1269bc..e08c7af19ec142c2aa1b918ffd6cb9e1aa7f0c4d 100644
|
||||
index d7cc71f0f7c7977fcab76f32e60c58ec7b1e68d8..3cca5eeaa295d8877fa36258ec73c6c2a8918832 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -377,7 +377,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1847,10 +1847,10 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000
|
||||
- }
|
||||
-}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 405142188f1b4089fbec38e54266514a9edc0a73..9cec05442734dd9e08e749dc73358c045c6d3d24 100644
|
||||
index 12a027e243d5336d5e96b88229499bfd2f65758c..855ed720cf23b201809a76725db87d71abbac626 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2570,6 +2570,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2568,6 +2568,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR));
|
||||
}
|
||||
@@ -1866,7 +1866,7 @@ index 405142188f1b4089fbec38e54266514a9edc0a73..9cec05442734dd9e08e749dc73358c04
|
||||
|
||||
public Player.Spigot spigot()
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index 2b80ddb42c8e5fd32b37f89e894353167c8a698e..bd1057681d0c7470c497b873ff18abf03a0a6a66 100644
|
||||
index e359668d9f4fceae13bf6c36842db9f2b2817c9b..0806f97007f4729dab859855fdae91c088671864 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
@@ -16801,7 +16801,7 @@ index 7abd42e34ce14618f4987933cdd230879b6ac804..27ab6d2749b89cc5d3fd4e22603daee9
|
||||
|
||||
public boolean isDebugging() {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 4b94b1ca21dbc0d9f993c5c9b86965f03aef75b4..64958f6cb9162de791ac90e08b19368a7fc59064 100644
|
||||
index 71e1f83e871f27f3de3afdbbeb432a9135d51f8b..4d81f9789a018463fdec503d795b0ffc7ccb94d6 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -399,7 +399,34 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -19532,7 +19532,7 @@ index c2db2aad2498f0be2e904d5869a9b0bd3411618c..b2367f3836689f3aa27b1b4905219e07
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 2a3f9168d38350eb3f6d97836fea70ae3023204d..fb183bff8844b6f9db5611b9b55b641f4ec438ff 100644
|
||||
index e48172c1da6beb7ff5ba3486647b126325b826a7..faf0d1e2330b85262cb615cdda360822e246df27 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -194,7 +194,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -22652,7 +22652,7 @@ index b1aeb021e53a233bfb0439d38f1a889ed6fc301d..7687a81bfa420e8377308fea3d673814
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index e08c7af19ec142c2aa1b918ffd6cb9e1aa7f0c4d..2df4e56450535d2d3f6e83c06261fac7ee7a12dd 100644
|
||||
index 3cca5eeaa295d8877fa36258ec73c6c2a8918832..819e2238f62b0af747b7e44a72de69a1b79609bf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1162,7 +1162,7 @@ public final class CraftServer implements Server {
|
||||
@@ -22683,10 +22683,10 @@ index e08c7af19ec142c2aa1b918ffd6cb9e1aa7f0c4d..2df4e56450535d2d3f6e83c06261fac7
|
||||
|
||||
// Paper start - Adventure
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadfe6347ad1 100644
|
||||
index 264cdde172452d0d9df652b0e78b21b6a6561300..e8f3373985ba8d3af6fc93a5f0ba0f0a04f7fc6f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -325,10 +325,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -323,10 +323,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
|
||||
if (playerChunk == null) return false;
|
||||
|
||||
@@ -22704,7 +22704,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf
|
||||
|
||||
ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null);
|
||||
for (ServerPlayer player : playersInRange) {
|
||||
@@ -336,8 +340,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -334,8 +338,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
player.connection.send(refreshPacket);
|
||||
}
|
||||
@@ -22714,7 +22714,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -414,20 +417,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -412,20 +415,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@Override
|
||||
public Collection<Plugin> getPluginChunkTickets(int x, int z) {
|
||||
DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
|
||||
@@ -22736,7 +22736,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -435,7 +425,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -433,7 +423,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
Map<Plugin, ImmutableList.Builder<Chunk>> ret = new HashMap<>();
|
||||
DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
|
||||
|
||||
@@ -22745,7 +22745,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf
|
||||
long chunkKey = chunkTickets.getLongKey();
|
||||
SortedArraySet<Ticket<?>> tickets = chunkTickets.getValue();
|
||||
|
||||
@@ -2018,14 +2008,53 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1991,14 +1981,53 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
// Spigot start
|
||||
@Override
|
||||
public int getViewDistance() {
|
||||
@@ -22802,7 +22802,7 @@ index 1678a5eca31033d31ea76bb8918b8d7323c884a7..10652bb6eecc9f451181747ba314eadf
|
||||
// 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 9cec05442734dd9e08e749dc73358c045c6d3d24..5e495f89139689ca37982c7b0b79eaf50d444435 100644
|
||||
index 855ed720cf23b201809a76725db87d71abbac626..c77bfa14ed74dd522229ec2595fac6f94700024b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -197,6 +197,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@@ -21,7 +21,7 @@ index 984a13267cc1bb960507bc9231359bb4bb837205..668a7c3f36cdbe48e472cb810b27ae4a
|
||||
public static Predicate<Entity> withinDistance(double x, double y, double z, double max) {
|
||||
double d4 = max * max;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 6e4980b0e6505f8da90d1d63584ef69f899896ea..2aa3df6ef2da77fa51c11d64124ac55a3769f567 100644
|
||||
index dc9162e8fa4b5649a631d3869be7cd9776f5c7b7..873a96693110982600d3e7979489fb00f3cd7941 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -848,7 +848,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -60,7 +60,7 @@ index 96181e8925aef7f3d0a2010305caf1f6d9bcfcc9..6f452605e9dc9ebd9980eae9fdeea344
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 37824f2470c7ddb77216ffbf4da02cc10a95a171..0c9a91990376482bc16f74a8b183ebf049ee1949 100644
|
||||
index 9d760f3745efc1248b7817d580e5ceb451fc4096..61ecf5c51fbdf38ec5513453c2de037489fd8c7e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -326,7 +326,7 @@ public class Zombie extends Monster {
|
||||
@@ -73,7 +73,7 @@ index 37824f2470c7ddb77216ffbf4da02cc10a95a171..0c9a91990376482bc16f74a8b183ebf0
|
||||
entityzombie.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null, (CompoundTag) null);
|
||||
worldserver.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 37629bf1193e220bcf872c714c55e0708d9fd7e0..45a5baf2f6e868fd5b41be1204bee46fb2e631b5 100644
|
||||
index d359d4b6f9db4841148428544c4c9d6ca9f8bdda..06522d8d3b7e0d455a42b10ec5004cc82e0d888d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -184,6 +184,9 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -137,10 +137,10 @@ index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..36d793b492d9776ee36f8285b5bab09e
|
||||
for(Player player : this.players()) {
|
||||
if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 5e495f89139689ca37982c7b0b79eaf50d444435..ed70dc4b4dfd57af877c42ff579296ce5cebadbd 100644
|
||||
index fb623fed603d235693b86e3a9f3f685187d6fb4e..e1e2895e37a5477e1eee068cc23ec60593bfb5e7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2251,6 +2251,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2249,6 +2249,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return this.getHandle().language;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index ed70dc4b4dfd57af877c42ff579296ce5cebadbd..5f72f8ac8271d3a6619a708f52a42dc4b6dc5b80 100644
|
||||
index d2ef107e00995008f3433009d0b22621b4f92f12..b3278a5f44dbbca937c499a2f3ae852052911d7b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1922,12 +1922,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1920,12 +1920,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public void setFlying(boolean value) {
|
||||
|
||||
@@ -39,10 +39,10 @@ index 61ec0ed91457e4b04a72010199be520c9d4a9488..b5a8d2505fa41c68abb1400a4269f833
|
||||
// CraftBukkit end
|
||||
this.language = clientOptions.language();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 5f72f8ac8271d3a6619a708f52a42dc4b6dc5b80..d0448d310fde607a006acf37e86cd3eede93a2ba 100644
|
||||
index c06f9da7d33c8d86fdcdd1f293f28e66f63e4de1..850ea32a2ebc192a89c9feec5dbc83f3f7314bfc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2249,7 +2249,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2247,7 +2247,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public String getLocale() {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Use UserCache for player heads
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
index 51e94e6f97a7c75e2281ad751c8e2dbee2e28afd..062594cebbe8cc0a0c94ecf7c8da4ee349a27521 100644
|
||||
index 7c6d29da9cb555cf93ef1860d4254ddd0b0be516..028fbc9d7960fec6333301f249178833a24f980d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
@@ -211,7 +211,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -213,7 +213,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
if (name == null) {
|
||||
this.setProfile(null);
|
||||
} else {
|
||||
|
||||
@@ -16,10 +16,10 @@ The wanted destination was on top of the emerald block however the player ended
|
||||
This only is the case if the player is teleporting between worlds.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index ab8b584eb1c98d10caeb7d9581f826b4ae984c7c..c87cba2252f091b026c9169ebf1117cd82d7942b 100644
|
||||
index 30b1148e057e43db4dcc441dd07d8e527aae6f6f..cea98186e229617e973125fb5bcae965205d3d99 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1164,7 +1164,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1162,7 +1162,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
entity.connection.teleport(to);
|
||||
} else {
|
||||
// The respawn reason should never be used if the passed location is non null.
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 0a0a9f1be333911b6de7502a9541063ab9ea0164..a258a252e749e3b7ebb1a6304b7f143e93a67178 100644
|
||||
index b9062fe651de34d5b3f9d5f146ae0b4fe29cbfee..e8b12a8ae009023afa2818ecbf398a1440b9926e 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -156,7 +156,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -22,7 +22,7 @@ index 0a0a9f1be333911b6de7502a9541063ab9ea0164..a258a252e749e3b7ebb1a6304b7f143e
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index c87cba2252f091b026c9169ebf1117cd82d7942b..e542d86dbf44e91058ad026e1bf9105d92fa687c 100644
|
||||
index d1f1df4f437bf9c81503972257af9d0386a457f7..b11c4c6b6fd49fb14096b3b39f15dd7ee37b3d0d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -191,6 +191,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -36,7 +36,7 @@ index c87cba2252f091b026c9169ebf1117cd82d7942b..e542d86dbf44e91058ad026e1bf9105d
|
||||
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
super(server, entity);
|
||||
@@ -2372,6 +2376,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2370,6 +2374,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public boolean getAffectsSpawning() {
|
||||
return this.getHandle().affectsSpawning;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 9b9e02f27f4281d3d39130521b1cc4e6979f8ea5..2cf9d80494c6b70992d8ec74fe1697c6522bd952 100644
|
||||
index 3fe9b954bf2394986cf8b76f37e6e0780b3d5978..08d7c37c1d9dcee4f1578600ac2cd6b584bf2d71 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -794,7 +794,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -44,10 +44,10 @@ index 9b9e02f27f4281d3d39130521b1cc4e6979f8ea5..2cf9d80494c6b70992d8ec74fe1697c6
|
||||
|
||||
protected void internalSetAbsorptionAmount(float absorptionAmount) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index e542d86dbf44e91058ad026e1bf9105d92fa687c..7363c80d35d4ff61d771fb77125a4e520f745bba 100644
|
||||
index ec1cbd610250d11536f8fc42e769b749380dc95e..7f9dceaf41426a88d682774c30a959db368fd03b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2167,6 +2167,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2165,6 +2165,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
public void setRealHealth(double health) {
|
||||
|
||||
@@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size()
|
||||
which creates copy of the collections.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 17a15f7f1ad0ce7deed8d72c8a4175634992efc9..407607babfb200152bb0e5c6d56bb66c82217077 100644
|
||||
index 7b681914b7f9e7fb6d2ea607e0d63ca7024a7ec3..7cfcbc1e38f5e9145c827dfe26299277a3f14cee 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -116,7 +116,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -20,10 +20,10 @@ index 17a15f7f1ad0ce7deed8d72c8a4175634992efc9..407607babfb200152bb0e5c6d56bb66c
|
||||
private final List<TickingBlockEntity> pendingBlockEntityTickers = Lists.newArrayList();
|
||||
private boolean tickingBlockEntities;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 10652bb6eecc9f451181747ba314eadfe6347ad1..78ed93a3bb321bcb30d9ca456a9deb5deeb4397c 100644
|
||||
index dfd45e5a32e8ff8d7f803addefa8240c0f7424c0..9fc72dd4db44fa65c2d4e8d30cf8c19f0fb556a0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -157,6 +157,56 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -155,6 +155,56 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY);
|
||||
private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
|
||||
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 3836c1d2c2565333072fbbae1fc163125663ba3c..e4e36c273af4dc2253030823d51dd25a166c391e 100644
|
||||
index 6595ad35eeec3763cb3df277145c6dc7d5f1b1d6..9920a3d81c44972cba742d67764b5066362f79aa 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1542,7 +1542,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1540,7 +1540,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,10 +48,10 @@ index 6c40bb4e06322bcce31561f5cfb9dc53f266f062..ba063a4e52a841a4365efb1cf78415b0
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
index 062594cebbe8cc0a0c94ecf7c8da4ee349a27521..b2bab2d79c969bc81b160312a996fb9cd87d0f95 100644
|
||||
index 028fbc9d7960fec6333301f249178833a24f980d..b6550a8c52122747668f9f0e93c2c2cbd2e86d94 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
@@ -187,6 +187,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -189,6 +189,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
return this.hasOwner() ? this.profile.getName() : null;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ index 062594cebbe8cc0a0c94ecf7c8da4ee349a27521..b2bab2d79c969bc81b160312a996fb9c
|
||||
@Override
|
||||
public OfflinePlayer getOwningPlayer() {
|
||||
if (this.hasOwner()) {
|
||||
@@ -237,6 +250,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -239,6 +252,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,7 +79,7 @@ index 062594cebbe8cc0a0c94ecf7c8da4ee349a27521..b2bab2d79c969bc81b160312a996fb9c
|
||||
public PlayerProfile getOwnerProfile() {
|
||||
if (!this.hasOwner()) {
|
||||
return null;
|
||||
@@ -246,11 +260,12 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -248,11 +262,12 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +93,7 @@ index 062594cebbe8cc0a0c94ecf7c8da4ee349a27521..b2bab2d79c969bc81b160312a996fb9c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,7 +320,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -307,7 +322,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
Builder<String, Object> serialize(Builder<String, Object> builder) {
|
||||
super.serialize(builder);
|
||||
if (this.profile != null) {
|
||||
|
||||
@@ -55,7 +55,7 @@ index 477d3245facb5ae59c786d4f696f64226cb540a6..e8490a58dd4d9bc39a5bb2f9fc109526
|
||||
|
||||
public Server getServer() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index e4e36c273af4dc2253030823d51dd25a166c391e..8b443e6f0bc593004ac91d8b92eb3c54add73291 100644
|
||||
index 317f879a1be75ae77a0cc52dece1ef3530cde786..601153fac20f6f15aa09bbc8bc63995e43494611 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -271,11 +271,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -70,7 +70,7 @@ index e4e36c273af4dc2253030823d51dd25a166c391e..8b443e6f0bc593004ac91d8b92eb3c54
|
||||
@Override
|
||||
public InetSocketAddress getAddress() {
|
||||
if (this.getHandle().connection == null) return null;
|
||||
@@ -1692,8 +1687,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1690,8 +1685,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
private void untrackAndHideEntity(org.bukkit.entity.Entity entity) {
|
||||
// Remove this entity from the hidden player's EntityTrackerEntry
|
||||
@@ -87,7 +87,7 @@ index e4e36c273af4dc2253030823d51dd25a166c391e..8b443e6f0bc593004ac91d8b92eb3c54
|
||||
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
|
||||
if (entry != null) {
|
||||
entry.removePlayer(this.getHandle());
|
||||
@@ -1706,8 +1708,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1704,8 +1706,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID())));
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ index e4e36c273af4dc2253030823d51dd25a166c391e..8b443e6f0bc593004ac91d8b92eb3c54
|
||||
}
|
||||
|
||||
void resetAndHideEntity(org.bukkit.entity.Entity entity) {
|
||||
@@ -1772,12 +1772,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1770,12 +1770,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
private void trackAndShowEntity(org.bukkit.entity.Entity entity) {
|
||||
@@ -122,7 +122,7 @@ index e4e36c273af4dc2253030823d51dd25a166c391e..8b443e6f0bc593004ac91d8b92eb3c54
|
||||
}
|
||||
|
||||
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
|
||||
@@ -1787,6 +1800,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1785,6 +1798,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
|
||||
}
|
||||
@@ -162,7 +162,7 @@ index e4e36c273af4dc2253030823d51dd25a166c391e..8b443e6f0bc593004ac91d8b92eb3c54
|
||||
|
||||
void resetAndShowEntity(org.bukkit.entity.Entity entity) {
|
||||
// SPIGOT-7312: Can't show/hide self
|
||||
@@ -1798,6 +1844,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1796,6 +1842,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.trackAndShowEntity(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs.
|
||||
provide an optional flag to disable this check, at your own risk.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 8b443e6f0bc593004ac91d8b92eb3c54add73291..10c9ced5f306b71eeb77ecc9c4e95ef7de3460e8 100644
|
||||
index c65b82d69fa829f3fdfa0d6c65a2f861c2db9f11..676c29c13ae8ece20cb5acaf1a2cf71fc93424bd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -194,6 +194,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -20,7 +20,7 @@ index 8b443e6f0bc593004ac91d8b92eb3c54add73291..10c9ced5f306b71eeb77ecc9c4e95ef7
|
||||
// Paper end
|
||||
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
@@ -2096,7 +2097,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2094,7 +2095,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
// Paper end
|
||||
|
||||
public void addChannel(String channel) {
|
||||
|
||||
@@ -10,7 +10,7 @@ Adds an option to control the force mode of the particle.
|
||||
This adds a new Builder API which is much friendlier to use.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 39cabe9d047a44452de25be5937cdb2dd66c17ab..92c847fdd2a7e3e20c8607f287c3e1ad27b9e4f7 100644
|
||||
index 445b8839d2a7a5ec2debb853d606e499c2a1f20b..365fb14d498a0baecbdc001ce634cc8e81a15b75 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1719,12 +1719,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -34,10 +34,10 @@ index 39cabe9d047a44452de25be5937cdb2dd66c17ab..92c847fdd2a7e3e20c8607f287c3e1ad
|
||||
|
||||
if (this.sendParticles(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 78ed93a3bb321bcb30d9ca456a9deb5deeb4397c..d8066264008ade869414c505a2b55886bef74fbf 100644
|
||||
index 1f08be117261f8b567bb4d46f2f21a6515c39aef..6d9de4dbbc0d224ebad03d4279dd45a7d3303848 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1891,13 +1891,20 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1864,13 +1864,20 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Expand Explosions API
|
||||
Add Entity as a Source capability, and add more API choices, and on Location.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index d8066264008ade869414c505a2b55886bef74fbf..f02cb628d6e2ef303d0f4c574ae5d67a0c92da0d 100644
|
||||
index c8d960d1fc8b44f64e84abb38f12e3825d2c97bc..2e8e66b6f89334d37a93a8571131a9cf4eb35c6f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -719,6 +719,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -717,6 +717,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) {
|
||||
return !this.world.explode(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? net.minecraft.world.level.Level.ExplosionInteraction.MOB : net.minecraft.world.level.Level.ExplosionInteraction.NONE).wasCanceled;
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Implement World.getEntity(UUID) API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index f02cb628d6e2ef303d0f4c574ae5d67a0c92da0d..c6fc48c30475708378bfd4a5d36999093e5382f6 100644
|
||||
index 2e8e66b6f89334d37a93a8571131a9cf4eb35c6f..a0878c2a3164cb0dd6cd5b1b982c5c854b86c322 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1043,6 +1043,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1041,6 +1041,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
|
||||
to "confirm" things based on if it was player triggered close or not.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 92c847fdd2a7e3e20c8607f287c3e1ad27b9e4f7..2268babbdcd023c1ec7b3746319acf4306845fee 100644
|
||||
index 391c32093fc5e9084ab480fcdc22207dc4d5dabc..c6ded19cbe33699e4eab20cbc63d4732837dd143 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1451,7 +1451,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -173,10 +173,10 @@ index 602cf19007c622ab9bb12a7018643cf05688f33e..607dc510ac856a0bf3a54bf1004bdf98
|
||||
@Override
|
||||
public boolean isBlocking() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 10c9ced5f306b71eeb77ecc9c4e95ef7de3460e8..3ec5ce75a12f7463b73fb11692b545f13ed109dd 100644
|
||||
index e4ebfccc01edd29521470e7132ac789755b9ba49..845bc8225a5d0694ddd5a26286c1d37e2563f31f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1193,7 +1193,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1191,7 +1191,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
// Close any foreign inventory
|
||||
if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) {
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||
index df02963faaf8f514f4175d394e67d2df10c8a3ea..545b14f02ac72dda30891d681eba585d19fd5e1d 100644
|
||||
index df02963faaf8f514f4175d394e67d2df10c8a3ea..593cfd68dc0f3679c684b6a1d2036419d4f3bc0c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||
@@ -127,6 +127,13 @@ public class CraftChunk implements Chunk {
|
||||
@@ -35,7 +35,7 @@ index df02963faaf8f514f4175d394e67d2df10c8a3ea..545b14f02ac72dda30891d681eba585d
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Collection<BlockState> getTileEntities(Predicate<? super Block> blockPredicate, boolean useSnapshot) {
|
||||
+ public Collection<BlockState> getTileEntities(Predicate<Block> blockPredicate, boolean useSnapshot) {
|
||||
+ Preconditions.checkNotNull(blockPredicate, "blockPredicate");
|
||||
+ if (!this.isLoaded()) {
|
||||
+ this.getWorld().getChunkAt(this.x, this.z); // Transient load for this tick
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index c6fc48c30475708378bfd4a5d36999093e5382f6..e8229f2004b3a729417e99897b641e5bde0fa781 100644
|
||||
index a0878c2a3164cb0dd6cd5b1b982c5c854b86c322..2948cf1b2ca8e342d366077407231a89bbb36667 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -403,7 +403,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -401,7 +401,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@Override
|
||||
public boolean loadChunk(int x, int z, boolean generate) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 3ec5ce75a12f7463b73fb11692b545f13ed109dd..e910029ca34d980a889d33259bd8b68de002e3ad 100644
|
||||
index 6765b59b7b57233c0c963782d0b9b88ba49c3637..fc7bca0d0df079e29ea18f1e37194ddf9c0eefd1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2847,6 +2847,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2845,6 +2845,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
return this.adventure$pointers;
|
||||
}
|
||||
|
||||
@@ -392,10 +392,10 @@ index 1047d9a46314e264ab3f72122aedefd161c7851d..91b9ec5831f439426a853ba9ac7a3f22
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index e910029ca34d980a889d33259bd8b68de002e3ad..938f0cc12e7a6569a8d3585a9f58f6490fd387a0 100644
|
||||
index 6d34fef4f16bbac6bd66b702fb5c1511edaef3f1..cc5d3e5d1f25a8316b3b09d16183c0e9a79be2a0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2345,7 +2345,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2343,7 +2343,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@Override
|
||||
public void sendHealthUpdate() {
|
||||
FoodData foodData = this.getHandle().getFoodData();
|
||||
|
||||
@@ -7,10 +7,10 @@ Subject: [PATCH] Add sun related API
|
||||
public net.minecraft.world.entity.Mob isSunBurnTick()Z
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e8229f2004b3a729417e99897b641e5bde0fa781..c92b931e2a54122e7a7aeafc5f88faee59c5e0fb 100644
|
||||
index ce19d3ba9e86440152f01e9fde22361ccd967ebd..73b476c5c2baa0122cb3cbeb76ec8c42674b6421 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -695,6 +695,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -693,6 +693,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and
|
||||
documented as to their purpose.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 42898f986d317d44d88c39b56e4655366d5a5a1b..32ab4a254b04d8d66c62660c7ad9489ea8ecf7f2 100644
|
||||
index ca3fe38fa443eb08408eca029a34afb58cd5a118..bc17ba1dc7b744a4325b30703cda73b501da5104 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -241,6 +241,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -28,7 +28,7 @@ index 42898f986d317d44d88c39b56e4655366d5a5a1b..32ab4a254b04d8d66c62660c7ad9489e
|
||||
public boolean queueHealthUpdatePacket = false;
|
||||
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 3cd1563480d40ff358dce52891ba4bdc8d119888..1619a0573c6996e0f5494bfab6788ba96c08a6d3 100644
|
||||
index 98c4a1b8542486f5af1274f974b898a69f2684f1..45bfb32505dfd2a66d8a6ee4627ec293a88da818 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -181,6 +181,7 @@ public abstract class PlayerList {
|
||||
@@ -40,7 +40,7 @@ index 3cd1563480d40ff358dce52891ba4bdc8d119888..1619a0573c6996e0f5494bfab6788ba9
|
||||
GameProfileCache usercache = this.server.getProfileCache();
|
||||
String s;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
index e8490a58dd4d9bc39a5bb2f9fc109526e031b971..5f590575f95eff8bf0cdcafde7dee0e3c7fc30ad 100644
|
||||
index c1ef6c8c8e5f030e18b6066a509350ee1e195987..779b6bac307e252fe614cfce958d2eeed94c5f77 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
@@ -261,6 +261,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
||||
@@ -106,7 +106,7 @@ index e8490a58dd4d9bc39a5bb2f9fc109526e031b971..5f590575f95eff8bf0cdcafde7dee0e3
|
||||
public Location getLastDeathLocation() {
|
||||
if (this.getData().contains("LastDeathLocation", 10)) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 938f0cc12e7a6569a8d3585a9f58f6490fd387a0..43fb53bfef71912695266eda459d7fa2d972cd1c 100644
|
||||
index 92e64162181b73e5201e1e3e52db9e372c765a75..d939e5385d250095674c1f0c6f4209cdf87ad7cb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -195,6 +195,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -117,7 +117,7 @@ index 938f0cc12e7a6569a8d3585a9f58f6490fd387a0..43fb53bfef71912695266eda459d7fa2
|
||||
// Paper end
|
||||
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
@@ -1954,6 +1955,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1952,6 +1953,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.firstPlayed = firstPlayed;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ index 938f0cc12e7a6569a8d3585a9f58f6490fd387a0..43fb53bfef71912695266eda459d7fa2
|
||||
public void readExtraData(CompoundTag nbttagcompound) {
|
||||
this.hasPlayedBefore = true;
|
||||
if (nbttagcompound.contains("bukkit")) {
|
||||
@@ -1976,6 +1989,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1974,6 +1987,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
public void setExtraData(CompoundTag nbttagcompound) {
|
||||
@@ -145,7 +145,7 @@ index 938f0cc12e7a6569a8d3585a9f58f6490fd387a0..43fb53bfef71912695266eda459d7fa2
|
||||
if (!nbttagcompound.contains("bukkit")) {
|
||||
nbttagcompound.put("bukkit", new CompoundTag());
|
||||
}
|
||||
@@ -1990,6 +2005,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1988,6 +2003,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
data.putLong("firstPlayed", this.getFirstPlayed());
|
||||
data.putLong("lastPlayed", System.currentTimeMillis());
|
||||
data.putString("lastKnownName", handle.getScoreboardName());
|
||||
|
||||
@@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to
|
||||
be unintentional in the few cases we've seen so far.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 43fb53bfef71912695266eda459d7fa2d972cd1c..8341d66dd5cad3cebdd95cfbc995cc3e8d43d934 100644
|
||||
index 0a44010d51d8e68640bff5a384f1e79f7f293528..90186b8aef17c7db6663b8cb82fa3b27b4462bd4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2894,6 +2894,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2892,6 +2892,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void resetCooldown() {
|
||||
getHandle().resetAttackStrengthTicker();
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Heightmap API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index c92b931e2a54122e7a7aeafc5f88faee59c5e0fb..e24c43463b3997549e9a7560a464bdeb8823831e 100644
|
||||
index 73b476c5c2baa0122cb3cbeb76ec8c42674b6421..8c2f83c8c08b31a6a165ca9aa86a12082ec70ef2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -222,6 +222,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -220,6 +220,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return CraftBlock.at(this.world, new BlockPos(x, y, z));
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ index fb2851e94c178f49ee8046176b196c63254907e7..ef6d98d503fdca4322000278de4cf325
|
||||
// this.updateMobSpawningFlags();
|
||||
worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals());
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 47a1fb476e3825f489fc217ef83fd273b52676a1..dc0a02f08d1c211443f35a10270110791b6fbbcc 100644
|
||||
index 39bfb4660423cd8bdf67a0aca66fe5b0d353aa84..0c27467e481f9226f1092ba82ec566546e74d422 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1859,12 +1859,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -191,10 +191,10 @@ index 4d2348df25410a0b5364eec066880326d6667dad..286aad3205ef8a9e21a47ef07893844f
|
||||
this.maxCount = i * i;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e24c43463b3997549e9a7560a464bdeb8823831e..e790c0c348ad8e2448969516d97a036aeee12fa3 100644
|
||||
index 8c2f83c8c08b31a6a165ca9aa86a12082ec70ef2..d4193c9ec7bef6d8e307c94df034f1a24e8685eb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1353,15 +1353,21 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1351,15 +1351,21 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public void setKeepSpawnInMemory(boolean keepLoaded) {
|
||||
|
||||
@@ -8,7 +8,7 @@ This patch also adds a chunk status cache on region files (note that
|
||||
its only purpose is to cache the status on DISK)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 8d3a9f8210bf529484aeaf84ef9a55b54ce8f2af..15e423cdb61547ddffb4497f5c51e101f5dbe8af 100644
|
||||
index c69be9cb3f03ec50e4e57d7e1e93a83701e4cd6c..5b7260b5a14cb9d2b90cf3c411d119e6bfa84046 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -680,9 +680,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -156,10 +156,10 @@ index 42dc999d820e62c6a222afbd9239cc671fc7de53..b850dba2b0fa5bc762b170ed7083cf89
|
||||
} catch (Throwable throwable) {
|
||||
if (dataoutputstream != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e790c0c348ad8e2448969516d97a036aeee12fa3..217aac550c3bed7ccb12ed8e8da9294652345d41 100644
|
||||
index fdb3de1dee72a0e90a42a9d39fa021c0b81922ef..6c13c3c55d58d654d28d5eebcc6dd9789f6565dd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -310,9 +310,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -308,9 +308,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public boolean isChunkGenerated(int x, int z) {
|
||||
@@ -185,7 +185,7 @@ index e790c0c348ad8e2448969516d97a036aeee12fa3..217aac550c3bed7ccb12ed8e8da92946
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
@@ -426,20 +440,48 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -424,20 +438,48 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@Override
|
||||
public boolean loadChunk(int x, int z, boolean generate) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
|
||||
|
||||
@@ -1558,7 +1558,7 @@ index 593cfd68dc0f3679c684b6a1d2036419d4f3bc0c..b4b2f961d1e4f8b5b199052efefd96bc
|
||||
private static final byte[] EMPTY_LIGHT = new byte[2048];
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 53f387da05ed3c9e981cea2141c42fe630b49892..871a1095d28bde74cfb63091d77c860f92a2ea0e 100644
|
||||
index c77e36393a8aaea5954a0ab0fb21f0b6f8d14aee..0e050180f4d35177c7e13dc439813f9fa8ce1d18 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2341,7 +2341,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1571,10 +1571,10 @@ index 53f387da05ed3c9e981cea2141c42fe630b49892..871a1095d28bde74cfb63091d77c860f
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 217aac550c3bed7ccb12ed8e8da9294652345d41..2d9a298e6f364d7ea6fec689833a72b58aba3c17 100644
|
||||
index 27ec5d989be1288ea32fa115ce37e4d98dc54892..d352f6882adbf642b61e0f3f18abebbe5fff1a9b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -421,11 +421,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -419,11 +419,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
List<ServerPlayer> playersInRange = playerChunk.playerProvider.getPlayers(playerChunk.getPos(), false);
|
||||
if (playersInRange.isEmpty()) return true; // Paper - rewrite player chunk loader
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 80ffd7fd14893c70da92dddb5ec37d409c76b729..dfd12484b424fffb529f408b6a9974c21598f9c2 100644
|
||||
index 80ffd7fd14893c70da92dddb5ec37d409c76b729..dd300f1048b806c1292ac09dd232fd3eb24a7bf0 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -36,6 +36,7 @@ dependencies {
|
||||
implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
|
||||
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
+ implementation("net.fabricmc:mapping-io:0.5.0") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||
+ implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
|
||||
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
@@ -123,10 +123,10 @@ index 0bb4aaa546939b67a5d22865190f30478a9337c1..d3e619655382e50e9ac9323ed942502d
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/ObfHelper.java b/src/main/java/io/papermc/paper/util/ObfHelper.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e8ff684d8bd994c64ff34f20e1e0601b678244c1
|
||||
index 0000000000000000000000000000000000000000..b8b17d046f836c8652ab094db00ab1af84971b2c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/util/ObfHelper.java
|
||||
@@ -0,0 +1,147 @@
|
||||
@@ -0,0 +1,146 @@
|
||||
+package io.papermc.paper.util;
|
||||
+
|
||||
+import java.io.IOException;
|
||||
@@ -136,7 +136,6 @@ index 0000000000000000000000000000000000000000..e8ff684d8bd994c64ff34f20e1e0601b
|
||||
+import java.util.HashMap;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Map;
|
||||
+import java.util.Objects;
|
||||
+import java.util.Set;
|
||||
+import java.util.function.Function;
|
||||
+import java.util.stream.Collectors;
|
||||
@@ -223,7 +222,7 @@ index 0000000000000000000000000000000000000000..e8ff684d8bd994c64ff34f20e1e0601b
|
||||
+ return null;
|
||||
+ }
|
||||
+ final MemoryMappingTree tree = new MemoryMappingTree();
|
||||
+ MappingReader.read(new InputStreamReader(mappingsInputStream, StandardCharsets.UTF_8), MappingFormat.TINY_2_FILE, tree);
|
||||
+ MappingReader.read(new InputStreamReader(mappingsInputStream, StandardCharsets.UTF_8), MappingFormat.TINY_2, tree);
|
||||
+ final Set<ClassMapping> classes = new HashSet<>();
|
||||
+
|
||||
+ final StringPool pool = new StringPool();
|
||||
@@ -233,16 +232,16 @@ index 0000000000000000000000000000000000000000..e8ff684d8bd994c64ff34f20e1e0601b
|
||||
+ for (final MappingTree.MethodMapping methodMapping : cls.getMethods()) {
|
||||
+ methods.put(
|
||||
+ pool.string(methodKey(
|
||||
+ Objects.requireNonNull(methodMapping.getName(SPIGOT_NAMESPACE)),
|
||||
+ Objects.requireNonNull(methodMapping.getDesc(SPIGOT_NAMESPACE))
|
||||
+ methodMapping.getName(SPIGOT_NAMESPACE),
|
||||
+ methodMapping.getDesc(SPIGOT_NAMESPACE)
|
||||
+ )),
|
||||
+ pool.string(Objects.requireNonNull(methodMapping.getName(MOJANG_PLUS_YARN_NAMESPACE)))
|
||||
+ pool.string(methodMapping.getName(MOJANG_PLUS_YARN_NAMESPACE))
|
||||
+ );
|
||||
+ }
|
||||
+
|
||||
+ final ClassMapping map = new ClassMapping(
|
||||
+ Objects.requireNonNull(cls.getName(SPIGOT_NAMESPACE)).replace('/', '.'),
|
||||
+ Objects.requireNonNull(cls.getName(MOJANG_PLUS_YARN_NAMESPACE)).replace('/', '.'),
|
||||
+ cls.getName(SPIGOT_NAMESPACE).replace('/', '.'),
|
||||
+ cls.getName(MOJANG_PLUS_YARN_NAMESPACE).replace('/', '.'),
|
||||
+ Map.copyOf(methods)
|
||||
+ );
|
||||
+ classes.add(map);
|
||||
|
||||
@@ -7,15 +7,15 @@ Subject: [PATCH] Fix CraftScheduler#runTaskTimerAsynchronously(Plugin,
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index 215310984100722757d9dd38182f7cbc163a4a0f..acb2af336184c0215c409c748b56fddd8d1fb4be 100644
|
||||
index 918e11422854d7301c84b466533770c2a429a682..addf3c442a085281a7ac06245ccd741f08ed7ccb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -196,7 +196,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
|
||||
@Override
|
||||
public void runTaskTimerAsynchronously(Plugin plugin, Consumer<? super BukkitTask> task, long delay, long period) throws IllegalArgumentException {
|
||||
public void runTaskTimerAsynchronously(Plugin plugin, Consumer<BukkitTask> task, long delay, long period) throws IllegalArgumentException {
|
||||
- this.runTaskTimerAsynchronously(plugin, (Object) task, delay, CraftTask.NO_REPEATING);
|
||||
+ this.runTaskTimerAsynchronously(plugin, (Object) task, delay, period); // Paper
|
||||
+ this.runTaskTimerAsynchronously(plugin, (Object) task, delay, period);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +63,7 @@ index 89be3991ef4fb2deb7276c5409cb571a7fb1f821..9c272f7cf8cbd2bbe147e57f7fabe135
|
||||
return Component.translatable("commands.difficulty.success", difficulty.getDisplayName());
|
||||
}, true);
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 557fc4e380c00bc2ca34381b36eb3d6a38177209..9e631002278e21f1e0a3989573e7d5b2e1a82dd8 100644
|
||||
index 474492c3f02f99e801885a983b9c110a8656c7b5..6d7095a62f30b18bc8fb8dbc5a0f3331980b7140 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -325,7 +325,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -102,7 +102,7 @@ index 6add371484deca6ed041e434fea5dc54c8db12d9..0080136d9aaead083fd1d94d2f7a0df2
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 8d78720a613c089ad1bd2d78b83da8a42b76fc76..2ac9b9001f60e2b4c2b660cc104387e49141bcf5 100644
|
||||
index 509927dc2a8d7f4968470130cde346d039aa50d4..a51cebb2f0f2ade695bb9f8c2b07b066c4872875 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -959,8 +959,8 @@ public final class CraftServer implements Server {
|
||||
@@ -117,10 +117,10 @@ index 8d78720a613c089ad1bd2d78b83da8a42b76fc76..2ac9b9001f60e2b4c2b660cc104387e4
|
||||
for (SpawnCategory spawnCategory : SpawnCategory.values()) {
|
||||
if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 2d9a298e6f364d7ea6fec689833a72b58aba3c17..5fc0c6652f2dff1b41bb447407a1780bd609c6bb 100644
|
||||
index d352f6882adbf642b61e0f3f18abebbe5fff1a9b..2a5eea1bce3ed7af358c2dc9456d57e3168b2249 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1153,7 +1153,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1151,7 +1151,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public void setDifficulty(Difficulty difficulty) {
|
||||
|
||||
@@ -22,7 +22,7 @@ wants it to collect even faster, they can restore that setting back to 1 instead
|
||||
Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2ac9b9001f60e2b4c2b660cc104387e49141bcf5..c71a409a457deea6817b863ddbb8bcbf64206544 100644
|
||||
index a51cebb2f0f2ade695bb9f8c2b07b066c4872875..a0e67773f4af7e35edad2535f95426308868c69b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -386,7 +386,7 @@ public final class CraftServer implements Server {
|
||||
@@ -44,10 +44,10 @@ index 2ac9b9001f60e2b4c2b660cc104387e49141bcf5..c71a409a457deea6817b863ddbb8bcbf
|
||||
this.printSaveWarning = false;
|
||||
this.console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 5fc0c6652f2dff1b41bb447407a1780bd609c6bb..8306f8cce689260111fbf88b31515440a44d3a8c 100644
|
||||
index 2a5eea1bce3ed7af358c2dc9456d57e3168b2249..6af214882a4208864b1e80231023b9a0644041fb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -282,7 +282,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -280,7 +280,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public Chunk getChunkAt(int x, int z) {
|
||||
@@ -62,7 +62,7 @@ index 5fc0c6652f2dff1b41bb447407a1780bd609c6bb..8306f8cce689260111fbf88b31515440
|
||||
return new CraftChunk(chunk);
|
||||
}
|
||||
|
||||
@@ -296,6 +302,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -294,6 +300,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return new CraftChunk(this.getHandle(), x, z);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ index 5fc0c6652f2dff1b41bb447407a1780bd609c6bb..8306f8cce689260111fbf88b31515440
|
||||
@Override
|
||||
public Chunk getChunkAt(Block block) {
|
||||
Preconditions.checkArgument(block != null, "null block");
|
||||
@@ -361,7 +373,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -359,7 +371,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
public boolean unloadChunkRequest(int x, int z) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("chunk unload"); // Spigot
|
||||
if (this.isChunkLoaded(x, z)) {
|
||||
@@ -84,7 +84,7 @@ index 5fc0c6652f2dff1b41bb447407a1780bd609c6bb..8306f8cce689260111fbf88b31515440
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -447,9 +459,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -445,9 +457,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
|
||||
// Paper start - Optimize this method
|
||||
ChunkPos chunkPos = new ChunkPos(x, z);
|
||||
@@ -98,7 +98,7 @@ index 5fc0c6652f2dff1b41bb447407a1780bd609c6bb..8306f8cce689260111fbf88b31515440
|
||||
if (immediate == null) {
|
||||
immediate = world.getChunkSource().chunkMap.getUnloadingChunk(x, z);
|
||||
}
|
||||
@@ -457,7 +472,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -455,7 +470,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
if (!(immediate instanceof ImposterProtoChunk) && !(immediate instanceof net.minecraft.world.level.chunk.LevelChunk)) {
|
||||
return false; // not full status
|
||||
}
|
||||
@@ -107,7 +107,7 @@ index 5fc0c6652f2dff1b41bb447407a1780bd609c6bb..8306f8cce689260111fbf88b31515440
|
||||
world.getChunk(x, z); // make sure we're at ticket level 32 or lower
|
||||
return true;
|
||||
}
|
||||
@@ -483,7 +498,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -481,7 +496,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
// we do this so we do not re-read the chunk data on disk
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ index 5fc0c6652f2dff1b41bb447407a1780bd609c6bb..8306f8cce689260111fbf88b31515440
|
||||
world.getChunkSource().getChunk(x, z, ChunkStatus.FULL, true);
|
||||
return true;
|
||||
// Paper end
|
||||
@@ -2263,6 +2278,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -2236,6 +2251,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
|
||||
net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
|
||||
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c;
|
||||
|
||||
@@ -57,10 +57,10 @@ index d25b6431ce617d90fd1d6489a308d6630b92c175..96ee68e6656a59d959ad7a7e78f5a375
|
||||
} catch (Exception ex) {
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 7c40718a53d2ef480441fd053de7c45971efe416..5e0fc3fd8e55b3dd238b38105fc6da75bfb709fc 100644
|
||||
index b92cc9f8d62cc3bfefe42c4c1fb08af4731dd48f..7b1404ac481ea9a059197b9f752327ef0bf72c5c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3011,6 +3011,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -3009,6 +3009,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
// Paper end
|
||||
};
|
||||
|
||||
|
||||
Loaded 100 of 141 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user