Archiviert
13
0

Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9825)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
897a0a23 SPIGOT-5753: Back PotionType by a minecraft registry
255b2aa1 SPIGOT-7080: Add World#locateNearestBiome
ff984826 Remove javadoc.io doc links

CraftBukkit Changes:
71b0135cc SPIGOT-5753: Back PotionType by a minecraft registry
a6bcb8489 SPIGOT-7080: Add World#locateNearestBiome
ad0e57434 SPIGOT-7502: CraftMetaItem - cannot deserialize BlockStateTag
b3efca57a SPIGOT-6400: Use Mockito instead of InvocationHandler
38c599f9d PR-1272: Only allow one entity in CraftItem instead of two
f065271ac SPIGOT-7498: ChunkSnapshot.getBlockEmittedLight() gets 64 blocks upper in Overworld

Spigot Changes:
e0e223fe Remove javadoc.io doc links
Dieser Commit ist enthalten in:
Jake Potrebic 2023-10-22 12:12:00 -07:00 committet von GitHub
Ursprung 489bff9bbd
Commit 90fe0d58a5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
523 geänderte Dateien mit 359 neuen und 641 gelöschten Zeilen

Datei anzeigen

@ -124,10 +124,10 @@ index 0000000000000000000000000000000000000000..41e77b687df6480adf8f5e21daad105d
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index e31246ebbe2af2950d63ad413460ea7c0c6baa36..0000000000000000000000000000000000000000
index a464312b63bb62d196d6ec2d55ffcdc85ae4da67..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,281 +0,0 @@
@@ -1,278 +0,0 @@
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -330,9 +330,6 @@ index e31246ebbe2af2950d63ad413460ea7c0c6baa36..00000000000000000000000000000000
- <configuration>
- <links>
- <link>https://guava.dev/releases/31.1-jre/api/docs/</link>
- <link>https://javadoc.io/doc/org.yaml/snakeyaml/2.0/</link>
- <link>https://javadoc.io/doc/org.jetbrains/annotations-java5/24.0.1/</link>
- <link>https://javadoc.io/doc/net.md-5/bungeecord-chat/1.20-R0.1/</link>
- </links>
- <tags>
- <tag>

Datei anzeigen

@ -1476,10 +1476,10 @@ index ac5e263d737973af077e3406a84a84baca4370db..2d91924b7f5ef16a91d40cdc1bfc3d68
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 68194147e96307eca1147f3b2be5771270efb3d7..90b0253bd16a2b3c2ba3155f3eb9af35aab9f36f 100644
index 4a9a82540e40685d2b837c76c431827a00cf4ba3..a3ee6f2f588bc9c87e49378359f450820b9af1b9 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -25,6 +25,15 @@ import org.jetbrains.annotations.Nullable;
@@ -26,6 +26,15 @@ import org.jetbrains.annotations.Nullable;
*/
@Deprecated
public interface UnsafeValues {
@ -1508,10 +1508,10 @@ 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 2009f98dc12bc8921cd3108884c1ab65bcfc0109..4c2d252a8298336b0ad23d15fc9290f05e5438c6 100644
index 5c9d74a5d8876507ee855dbecc2bfa8755f4062e..1403d28bf9124e3c4cd741dfda06400318e8a0a0 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -44,7 +44,7 @@ import org.jetbrains.annotations.Nullable;
@@ -45,7 +45,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a world, which may contain entities, chunks and blocks
*/
@ -1520,7 +1520,7 @@ index 2009f98dc12bc8921cd3108884c1ab65bcfc0109..4c2d252a8298336b0ad23d15fc9290f0
/**
* Gets the {@link Block} at the given coordinates
@@ -605,6 +605,14 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -606,6 +606,14 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public List<Player> getPlayers();

Datei anzeigen

@ -1346,13 +1346,13 @@ index 0000000000000000000000000000000000000000..6bf3d212a6156ad9ab0e82d1ca0a04f8
+
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 90b0253bd16a2b3c2ba3155f3eb9af35aab9f36f..08b7e95f56d0454de57de492327542c36f46369d 100644
index a3ee6f2f588bc9c87e49378359f450820b9af1b9..0743592273cc1c5f4ab6935349941bf25b438448 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -100,4 +100,14 @@ public interface UnsafeValues {
@Nullable
FeatureFlag getFeatureFlag(@NotNull NamespacedKey key);
@@ -109,4 +109,14 @@ public interface UnsafeValues {
* @return an internal potion data
*/
PotionType.InternalPotionData getInternalPotionData(NamespacedKey key);
+
+ // Paper start
+ @Deprecated(forRemoval = true)

Datei anzeigen

@ -2897,10 +2897,10 @@ index e3602c6703b29ffec17ef7806c9deb3eead8a112..3e642d8a0294f7290c3d4310813e6e8a
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 08b7e95f56d0454de57de492327542c36f46369d..5d089d2fbbead69e744bb5a7dd172183e28d0eab 100644
index 0743592273cc1c5f4ab6935349941bf25b438448..659405d84b5a61618576e930805da5cd3a054b4c 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -35,6 +35,7 @@ public interface UnsafeValues {
@@ -36,6 +36,7 @@ public interface UnsafeValues {
net.kyori.adventure.text.Component resolveWithContext(net.kyori.adventure.text.Component component, org.bukkit.command.CommandSender context, org.bukkit.entity.Entity scoreboardSubject, boolean bypassPermissions) throws java.io.IOException;
// Paper end
@ -2908,7 +2908,7 @@ index 08b7e95f56d0454de57de492327542c36f46369d..5d089d2fbbead69e744bb5a7dd172183
Material toLegacy(Material material);
Material fromLegacy(Material material);
@@ -110,4 +111,12 @@ public interface UnsafeValues {
@@ -119,4 +120,12 @@ public interface UnsafeValues {
return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
}
// Paper end

Datei anzeigen

@ -56,10 +56,10 @@ index 0000000000000000000000000000000000000000..a736d7bcdc5861a01b66ba36158db1c7
+ }
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 5d089d2fbbead69e744bb5a7dd172183e28d0eab..7ded4b932917a4a7b00b419e94a98aa8d59efe59 100644
index 659405d84b5a61618576e930805da5cd3a054b4c..4604392831d19a789e4906cf1a5f0197105fd6f2 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -118,5 +118,12 @@ public interface UnsafeValues {
@@ -127,5 +127,12 @@ public interface UnsafeValues {
* @return name
*/
String getTimingsServerName();

Datei anzeigen

@ -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 4c2d252a8298336b0ad23d15fc9290f05e5438c6..20a949a65a92e1d4c5162585339732377b8fba0c 100644
index 1403d28bf9124e3c4cd741dfda06400318e8a0a0..3559115d09b57acf5c2853b811862e5131f2a625 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2662,6 +2662,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2663,6 +2663,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
int getSimulationDistance();
// Spigot end

Datei anzeigen

@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 20a949a65a92e1d4c5162585339732377b8fba0c..9c8cfd05bbac5155b723414113ab9a9ec9ada81f 100644
index 3559115d09b57acf5c2853b811862e5131f2a625..dbb799aed5bbb80edd2428b63d3fce15cf2e2f05 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -46,6 +46,33 @@ import org.jetbrains.annotations.Nullable;
@@ -47,6 +47,33 @@ import org.jetbrains.annotations.Nullable;
*/
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper

Datei anzeigen

@ -161,10 +161,10 @@ index 22d508a6c80d7e19352bceb57009fdbcb16bc723..3c1862b9a9293155f756615b5bd23cc8
* @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 9c8cfd05bbac5155b723414113ab9a9ec9ada81f..bb36bb6e98d36d407fc0ed8e9562feffb45f3f97 100644
index dbb799aed5bbb80edd2428b63d3fce15cf2e2f05..609e4908ed21f69b9e813500e702bbe784bff00c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2576,7 +2576,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
@ -173,7 +173,7 @@ index 9c8cfd05bbac5155b723414113ab9a9ec9ada81f..bb36bb6e98d36d407fc0ed8e9562feff
* temporarily freezing while locating an unexplored structure.
* <p>
* The {@code radius} is not a rigid square radius. Each structure may alter
@@ -2610,7 +2610,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
@ -182,7 +182,7 @@ index 9c8cfd05bbac5155b723414113ab9a9ec9ada81f..bb36bb6e98d36d407fc0ed8e9562feff
* temporarily freezing while locating an unexplored structure.
* <p>
* The {@code radius} is not a rigid square radius. Each structure may alter
@@ -2643,7 +2643,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
@ -322,10 +322,10 @@ index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java
index 8814519df13c5e9475774f4bce4c8c6a462c2978..be9a35790fc664721ac94f3708613eb77631a0c5 100644
index 8eb0cf31b1ce6d714a14cf65bbb117ff163ae2f3..8e57082e8b19a2fd9625816c2ea4a90d41f78ca5 100644
--- a/src/main/java/org/bukkit/entity/Arrow.java
+++ b/src/main/java/org/bukkit/entity/Arrow.java
@@ -73,7 +73,7 @@ public interface Arrow extends AbstractArrow {
@@ -93,7 +93,7 @@ public interface Arrow extends AbstractArrow {
* Removes a custom potion effect from this arrow.
*
* @param type the potion effect type to remove

Datei anzeigen

@ -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 bb36bb6e98d36d407fc0ed8e9562feffb45f3f97..51e7c662f2d56c1a99818497315e75d661494145 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,7 +19,7 @@ index bb36bb6e98d36d407fc0ed8e9562feffb45f3f97..51e7c662f2d56c1a99818497315e75d6
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -624,6 +627,256 @@ 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);

Datei anzeigen

@ -522,10 +522,10 @@ index e9cbbdf310e48011ee538c5592baee2535965fee..dbedaf6a92681bc32d74f067cd4686c8
* 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 51e7c662f2d56c1a99818497315e75d661494145..1c7cdfe7a20500be8347a848e424e7409f73263c 100644
index 7a6caf93606203198369030a295f1edbffde3c31..3e7385d21380abcd40649045e4666cf4bed32195 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2776,7 +2776,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()}
*/

Datei anzeigen

@ -108,10 +108,10 @@ index 6693e3d8dc2519facb12db981a6b6325faa095bf..b7ff09ffdd3aecc1843d175bc76fe5fa
* 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 1c7cdfe7a20500be8347a848e424e7409f73263c..e551347c8db9a89e8e450d39accb37f3ee4589ee 100644
index 3e7385d21380abcd40649045e4666cf4bed32195..266ed71b79d32f9b812be322563c247051ccd9d0 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1391,6 +1391,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);

Datei anzeigen

@ -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 e551347c8db9a89e8e450d39accb37f3ee4589ee..6ed9d86683947a9b529b8ec0f8d88a7924742585 100644
index 266ed71b79d32f9b812be322563c247051ccd9d0..ffe6c8be86fc93d39e256a89e5016e3025afbe5c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -911,6 +911,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);

Datei anzeigen

@ -44,10 +44,10 @@ index efbfed855248cff8b4bdbfc181d3e82058df4749..766d643f0fe79660942fdad25e39e488
* Gets the world containing this chunk
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 6ed9d86683947a9b529b8ec0f8d88a7924742585..7f104d2c94d1de3eb003e412c35b5324beeada33 100644
index ffe6c8be86fc93d39e256a89e5016e3025afbe5c..315ecb5dc0f33edfef893ead1297c8165d292250 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -179,6 +179,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -180,6 +180,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Chunk getChunkAt(@NotNull Block block);

Datei anzeigen

@ -50,10 +50,10 @@ index aa6821aa33d3c579a139bd7c0378253c43b3754a..6e6e65c40813ccce618fa7a3df2c0030
* @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 7f104d2c94d1de3eb003e412c35b5324beeada33..762be36670b12286876917b9fbf64ca5bddf6c2e 100644
index 315ecb5dc0f33edfef893ead1297c8165d292250..ad5afa7a05636cee82b517c673d281f0f4e38644 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -96,6 +96,41 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -97,6 +97,41 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Block getBlockAt(@NotNull Location location);

Datei anzeigen

@ -34,10 +34,10 @@ index 6e6e65c40813ccce618fa7a3df2c0030aa0a3bbe..8508aa2c6fb7c9f41f3d185f5228c86d
/**
* 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 762be36670b12286876917b9fbf64ca5bddf6c2e..ca1a4e9bd912258185d59ff70de1e7cc5e43d436 100644
index ad5afa7a05636cee82b517c673d281f0f4e38644..880ff5ee1237096ac2da115b665dc663c677e57b 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -245,6 +245,19 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -246,6 +246,19 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
// Paper end - chunk long key API

Datei anzeigen

@ -8,10 +8,10 @@ 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 ca1a4e9bd912258185d59ff70de1e7cc5e43d436..ddc5fd874ccbb5a75ea3e4eddc39a97761ee6a48 100644
index 880ff5ee1237096ac2da115b665dc663c677e57b..fc6b99e4f37179b15254bf0b398b1a800de1b73f 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -954,6 +954,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -955,6 +955,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
return nearby;
}

Datei anzeigen

@ -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 ddc5fd874ccbb5a75ea3e4eddc39a97761ee6a48..be5baaf499cc76dd737d6203570e3d431c18afcf 100644
index fc6b99e4f37179b15254bf0b398b1a800de1b73f..df511007ca4b3b5df04abfa6b7f1c4de636407fc 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1781,6 +1781,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -1782,6 +1782,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
public void setFullTime(long time);

Datei anzeigen

@ -156,10 +156,10 @@ index f43209cf7b752c26718c303ca8c3e1c7d9912ad3..f0094e6fb05e526736629ad3181c8d2c
/**
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 44b8c9111ddc93719d9f3bb23ee1799897389f52..74c81f73649507f21351fc003d00fbeca274d92a 100644
index f79f4f20ee9f1f2ca3d12984064fc7fe57a932ba..82a206bd3000bc8d601c6e7c0bd078b4bb7e962f 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -184,14 +184,14 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -191,14 +191,14 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see TrimMaterial
*/
@ -176,7 +176,7 @@ index 44b8c9111ddc93719d9f3bb23ee1799897389f52..74c81f73649507f21351fc003d00fbec
Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class);
/**
* Villager profession.
@@ -273,8 +273,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -280,8 +280,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @param input non-null input
* @return registered object or null if does not exist
@ -282,10 +282,10 @@ index e455eb21abf121dc6ff10ff8a13dd06f67096a8f..bbc01e7c192ae6689c301670047ff114
return origin;
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index be5baaf499cc76dd737d6203570e3d431c18afcf..399fe079035e4d38030d8ad930fbc89c69f251b0 100644
index df511007ca4b3b5df04abfa6b7f1c4de636407fc..dea26b0bd6e1dccb7b043a7395e7958461e270ee 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -415,9 +415,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -416,9 +416,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param z Z-coordinate of the chunk
* @return Whether the chunk was actually refreshed
*
@ -296,7 +296,7 @@ index be5baaf499cc76dd737d6203570e3d431c18afcf..399fe079035e4d38030d8ad930fbc89c
public boolean refreshChunk(int x, int z);
/**
@@ -3707,6 +3706,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
@ -307,7 +307,7 @@ index be5baaf499cc76dd737d6203570e3d431c18afcf..399fe079035e4d38030d8ad930fbc89c
public class Spigot {
/**
@@ -3715,8 +3718,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.
@ -320,7 +320,7 @@ index be5baaf499cc76dd737d6203570e3d431c18afcf..399fe079035e4d38030d8ad930fbc89c
public LightningStrike strikeLightning(@NotNull Location loc, boolean isSilent) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -3727,14 +3734,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.

Datei anzeigen

@ -102,10 +102,10 @@ index f7564581c18425c903e54f949728dd3742ca7bf2..1bfe465b9aaeea7d3c871140145b7de1
/**
* 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 c748679337989a7b4e2a39e542268b7fd851ed91..e9423c88ccc35a7c32e1dca970faf0ec452fcbba 100644
index e673e05c3d94c28d6809a0de7f7d070712b85741..5d3b645eb24f5c0e3309143fc0e53545c6de8083 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -150,6 +150,87 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -151,6 +151,87 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Block getHighestBlockAt(@NotNull Location location);

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format.
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 7ded4b932917a4a7b00b419e94a98aa8d59efe59..27178f6eee7d60caa6ee864554b60092442c9002 100644
index 4604392831d19a789e4906cf1a5f0197105fd6f2..f063016f8a88dbff480ac3b4b3ef05c16a8e515a 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -125,5 +125,9 @@ public interface UnsafeValues {
@@ -134,5 +134,9 @@ public interface UnsafeValues {
default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
}

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 27178f6eee7d60caa6ee864554b60092442c9002..591cc561f6e60bcab3e45fd56f1a50e43e728f4c 100644
index f063016f8a88dbff480ac3b4b3ef05c16a8e515a..96b66f4f6fb8637ab3ad275ddd980d5b71711a6c 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -129,5 +129,12 @@ public interface UnsafeValues {
@@ -138,5 +138,12 @@ public interface UnsafeValues {
byte[] serializeItem(ItemStack item);
ItemStack deserializeItem(byte[] data);

Datei anzeigen

@ -505,10 +505,10 @@ index 0000000000000000000000000000000000000000..1e7b53f9bc13dcd5a0a4a40004591e4f
+ }
+}
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 74c81f73649507f21351fc003d00fbeca274d92a..4efda6d0f81ac192890b5003ceebf3d8fd07ea08 100644
index 82a206bd3000bc8d601c6e7c0bd078b4bb7e962f..3818f940b98488bd1068d941cfbbac3721677c7a 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -248,6 +248,17 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -255,6 +255,17 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see GameEvent
*/
Registry<GameEvent> GAME_EVENT = Objects.requireNonNull(Bukkit.getRegistry(GameEvent.class), "No registry present for GameEvent. This is a bug.");

Datei anzeigen

@ -78,10 +78,10 @@ index c8a312bf6cef6ba62114d4f46555f517f53c7576..2bfb1cfb4d669f4bb5a4ef540683bcee
* Create a new virtual {@link WorldBorder}.
* <p>
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 591cc561f6e60bcab3e45fd56f1a50e43e728f4c..1c07e3ef0b7bf3bc0bfe234434114cb6c2f18d42 100644
index 96b66f4f6fb8637ab3ad275ddd980d5b71711a6c..27d5f37a9b2da92307e5b505e3b31cca8a067018 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -136,5 +136,10 @@ public interface UnsafeValues {
@@ -145,5 +145,10 @@ public interface UnsafeValues {
* Use this when sending custom packets, so that there are no collisions on the client or server.
*/
public int nextEntityId();

Datei anzeigen

@ -61,10 +61,10 @@ index 74f9626b485aca594cdb9f11c363c6c38c78a661..cfe35b0ca1f502c5c9af0d307bd22dce
/**
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 1c07e3ef0b7bf3bc0bfe234434114cb6c2f18d42..2c79e05db0b87599fcc650df3c81ed906ad3e76a 100644
index 27d5f37a9b2da92307e5b505e3b31cca8a067018..26b0d5c0a62e516db6eef9dedc81216d7ed5053c 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -141,5 +141,22 @@ public interface UnsafeValues {
@@ -150,5 +150,22 @@ public interface UnsafeValues {
* Just don't use it.
*/
@org.jetbrains.annotations.NotNull String getMainLevelName();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Expose protocol version
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 2c79e05db0b87599fcc650df3c81ed906ad3e76a..664c0221566e48eb5c2fe5ce046608573e735b2a 100644
index 26b0d5c0a62e516db6eef9dedc81216d7ed5053c..3ae23a15a2c8757d3003041425ced583187d3d21 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -158,5 +158,12 @@ public interface UnsafeValues {
@@ -167,5 +167,12 @@ public interface UnsafeValues {
* @return the itemstack rarity
*/
public io.papermc.paper.inventory.ItemRarity getItemStackRarity(ItemStack itemStack);

Datei anzeigen

@ -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 ec94aa4967cb2dfc92d6b41d91b31125a1509cb9..768be78bd617c21b360cf1b650dcb2e8c481c084 100644
index 75a3f5528182fed8086bbb7fb9529f7746d005e6..efca79f7fd5a4e3c75d7060efae44c564edeb036 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -3714,6 +3714,114 @@ 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);
@ -21,9 +21,13 @@ index ec94aa4967cb2dfc92d6b41d91b31125a1509cb9..768be78bd617c21b360cf1b650dcb2e8
+ * @param biome Biome to find
+ * @param radius radius to search
+ * @return Location of biome or null if not found in specified radius
+ * @deprecated use {@link #locateNearestBiome(Location, int, Biome...)}
+ */
+ @Deprecated
+ @Nullable
+ Location locateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius);
+ default Location locateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius) {
+ return java.util.Optional.ofNullable(this.locateNearestBiome(origin, radius, 8, 8, biome)).map(BiomeSearchResult::getLocation).orElse(null);
+ }
+
+ /**
+ * Locates the nearest biome based on an origin, biome type, and radius to search
@ -34,9 +38,13 @@ index ec94aa4967cb2dfc92d6b41d91b31125a1509cb9..768be78bd617c21b360cf1b650dcb2e8
+ * @param radius radius to search
+ * @param step Search step 1 would mean checking every block, 8 would be every 8th block
+ * @return Location of biome or null if not found in specified radius
+ * @deprecated use {@link #locateNearestBiome(Location, int, int, int, Biome...)}
+ */
+ @Deprecated
+ @Nullable
+ Location locateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius, int step);
+ default Location locateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius, int step) {
+ return java.util.Optional.ofNullable(this.locateNearestBiome(origin, radius, step, step, biome)).map(BiomeSearchResult::getLocation).orElse(null);
+ }
+
+ /**
+ * Checks if the world:

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack repair check API
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 664c0221566e48eb5c2fe5ce046608573e735b2a..edc9b1ec665a57d9e4954c8409b1a42b29118b8c 100644
index 3ae23a15a2c8757d3003041425ced583187d3d21..6b8013b072c9ca0a6f5ba86f37de3744fc70979e 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -159,6 +159,16 @@ public interface UnsafeValues {
@@ -168,6 +168,16 @@ public interface UnsafeValues {
*/
public io.papermc.paper.inventory.ItemRarity getItemStackRarity(ItemStack itemStack);

Datei anzeigen

@ -31,10 +31,10 @@ index cfe35b0ca1f502c5c9af0d307bd22dcecc3b0f32..9be00bc616b1c6ad9619d9a48d5870f6
/**
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index edc9b1ec665a57d9e4954c8409b1a42b29118b8c..d30cdfece8d324fb95c96c156974317450518274 100644
index 6b8013b072c9ca0a6f5ba86f37de3744fc70979e..0f09250d536b7405f0dc253afb1f3c4ccbaeb0da 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -169,6 +169,18 @@ public interface UnsafeValues {
@@ -178,6 +178,18 @@ public interface UnsafeValues {
*/
public boolean isValidRepairItemStack(@org.jetbrains.annotations.NotNull ItemStack itemToBeRepaired, @org.jetbrains.annotations.NotNull ItemStack repairMaterial);

Datei anzeigen

@ -153,10 +153,10 @@ index 0d88dce9978243a1f995c5fb448c5d71b01136eb..8b1048c94dffd058eb9fd9144f7f59fc
+ // Paper end - Horse API
}
diff --git a/src/main/java/org/bukkit/entity/AreaEffectCloud.java b/src/main/java/org/bukkit/entity/AreaEffectCloud.java
index c2096b5344d48d855d031538ec32e0154bd9054d..f3180f6a4910984fc324f4a69eac59e036e32f2b 100644
index 8d6caae8ba11e1fe73cd5f88657eaac5f66c9d3d..fc59d6d4c2d43b09aef3a6f30b73d26280e831fa 100644
--- a/src/main/java/org/bukkit/entity/AreaEffectCloud.java
+++ b/src/main/java/org/bukkit/entity/AreaEffectCloud.java
@@ -239,4 +239,20 @@ public interface AreaEffectCloud extends Entity {
@@ -259,4 +259,20 @@ public interface AreaEffectCloud extends Entity {
* @param source the {@link ProjectileSource} that threw the LingeringPotion
*/
public void setSource(@Nullable ProjectileSource source);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add methods to find targets for lightning strikes
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index b7a2ef57ed089ca750693a413c57bc80048b5608..6ee336e9cda8b740aa3984b115797cd9333e012f 100644
index e097ac0d62fe9f97762cef4d3a4b740613b8dc34..ec46baeeaed183e3e2565f98d6a3fcafd972e0bc 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -734,6 +734,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -735,6 +735,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public LightningStrike strikeLightningEffect(@NotNull Location loc);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Get entity default attributes
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index d30cdfece8d324fb95c96c156974317450518274..827da519862c32907b41be77f61d51a244b2a749 100644
index 0f09250d536b7405f0dc253afb1f3c4ccbaeb0da..f08e03c71f1e59d31a22822701b4e9ae6cc1429d 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -187,5 +187,22 @@ public interface UnsafeValues {
@@ -196,5 +196,22 @@ public interface UnsafeValues {
* @return the server's protocol version
*/
int getProtocolVersion();

Datei anzeigen

@ -26,10 +26,10 @@ index 9be00bc616b1c6ad9619d9a48d5870f6d7ffb917..da6e36a16e609272b60fc41ff69a6fa3
/**
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 827da519862c32907b41be77f61d51a244b2a749..c9fdcda4d86a8419852d7acc0e85fe51656a829b 100644
index f08e03c71f1e59d31a22822701b4e9ae6cc1429d..7dc808f94c42e821fa125073b1a9b853e16d5b41 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -204,5 +204,14 @@ public interface UnsafeValues {
@@ -213,5 +213,14 @@ public interface UnsafeValues {
* @throws IllegalArgumentException if the entity does not exist of have default attributes (use {@link #hasDefaultEntityAttributes(NamespacedKey)} first)
*/
@org.jetbrains.annotations.NotNull org.bukkit.attribute.Attributable getDefaultEntityAttributes(@org.jetbrains.annotations.NotNull NamespacedKey entityKey);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index c9fdcda4d86a8419852d7acc0e85fe51656a829b..943736891bf58e620c47391b37c1d00610f68744 100644
index 7dc808f94c42e821fa125073b1a9b853e16d5b41..fc0356b0600946af0a46312cee16b080a7769ae2 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -130,6 +130,14 @@ public interface UnsafeValues {
@@ -139,6 +139,14 @@ public interface UnsafeValues {
ItemStack deserializeItem(byte[] data);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] More PotionEffectType API
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 4efda6d0f81ac192890b5003ceebf3d8fd07ea08..44d863510d454f316a5d9b7214b54ca499226d74 100644
index 3818f940b98488bd1068d941cfbbac3721677c7a..c936a6e193163f2af147484daf6accf24c2f3644 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -257,6 +257,31 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -264,6 +264,31 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*/
@Deprecated(forRemoval = true)
Registry<io.papermc.paper.world.structure.ConfiguredStructure> CONFIGURED_STRUCTURE = Bukkit.getRegistry(io.papermc.paper.world.structure.ConfiguredStructure.class);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Implement regenerateChunk
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 6ee336e9cda8b740aa3984b115797cd9333e012f..da524a71af74b02515b037f7fe09ba6988e2c8bf 100644
index ec46baeeaed183e3e2565f98d6a3fcafd972e0bc..1825b5f08c2a5bb3fd41ecabf60285400ad78c9c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -483,8 +483,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -484,8 +484,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @return Whether the chunk was actually regenerated
*
* @deprecated regenerating a single chunk is not likely to produce the same

Datei anzeigen

@ -192,12 +192,12 @@ index c2a9afee5c57d62bb6d62807eadae513b53849ba..20f95f8911852d86ea938dd73ed0d44c
// Paper end
}
diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java
index d21f407cc16cfd709c1cabf408e8d8d16aba7e1a..1598f34d306fb34ff7ffe7886b0d6e4abe734b6b 100644
index 2072f048e10eba829cef047d854b5a22c8f055a3..eb189e170bc4975c5378f95f86ecf2cc880bd931 100644
--- a/src/main/java/org/bukkit/potion/PotionBrewer.java
+++ b/src/main/java/org/bukkit/potion/PotionBrewer.java
@@ -43,4 +43,25 @@ public interface PotionBrewer {
*/
@@ -45,4 +45,25 @@ public interface PotionBrewer {
@NotNull
@Deprecated
public Collection<PotionEffect> getEffects(@NotNull PotionType type, boolean upgraded, boolean extended);
+
+ // Paper start

Datei anzeigen

@ -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 109acbccfa0e5bcd32889e1911798176d600a5fc..8d861f5522a33669f67b3e41dfbc5234637114b4 100644
index 6606fa0fb7d8230546e42c51e4cd576118cba751..59c1224cf9b96bde607fa71d89c93a4eae053783 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2241,8 +2241,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 109acbccfa0e5bcd32889e1911798176d600a5fc..8d861f5522a33669f67b3e41dfbc5234
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) throws IllegalArgumentException;
/**
@@ -2255,8 +2257,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 109acbccfa0e5bcd32889e1911798176d600a5fc..8d861f5522a33669f67b3e41dfbc5234
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull BlockData data) throws IllegalArgumentException;
/**
@@ -2273,7 +2277,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

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Add NamespacedKey biome methods
Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com>
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 943736891bf58e620c47391b37c1d00610f68744..fd340351587b408c59d5b2da1965357dc72be356 100644
index fc0356b0600946af0a46312cee16b080a7769ae2..815b16338ed5f90daf24edc5be14a6f49e978832 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -221,5 +221,32 @@ public interface UnsafeValues {
@@ -230,5 +230,32 @@ public interface UnsafeValues {
* @throws IllegalArgumentException if {@link Material#isBlock()} is false
*/
boolean isCollidable(@org.jetbrains.annotations.NotNull Material material);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix custom statistic criteria creation
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index fd340351587b408c59d5b2da1965357dc72be356..9237e2fca0557890b718de9029207a552396e45a 100644
index 815b16338ed5f90daf24edc5be14a6f49e978832..a4b38f284d4fea7df7f9df9bf44e4f68fefaf20f 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -248,5 +248,7 @@ public interface UnsafeValues {
@@ -257,5 +257,7 @@ public interface UnsafeValues {
* @throws IllegalStateException if no biome by the given key is registered.
*/
void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey);

Datei anzeigen

@ -28,10 +28,10 @@ index 3df8c60ab5cd1454660980883f80668d535b742b..37c3a00659ce21623be07317f4f6a45b
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..beb19d5aa6cb60115cbd173b2a7f67769b4a367d
index 0000000000000000000000000000000000000000..3be7f53046d821d6777481b92b3aa6e3df51ed8f
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,139 @@
@@ -0,0 +1,140 @@
+import io.papermc.paperweight.util.*
+
+plugins {
@ -57,6 +57,7 @@ index 0000000000000000000000000000000000000000..beb19d5aa6cb60115cbd173b2a7f6776
+
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
+ testImplementation("org.hamcrest:hamcrest:2.2")
+ testImplementation("org.mockito:mockito-core:5.5.0")
+}
+
+val craftbukkitPackageVersion = "1_20_R2" // Paper
@ -173,10 +174,10 @@ index 0000000000000000000000000000000000000000..beb19d5aa6cb60115cbd173b2a7f6776
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 20658694ee91e70d12ee874d8895ee9446e8ae9c..0000000000000000000000000000000000000000
index 2410a3cb98fc8d643043c7e3a85c880d4a9f2aa4..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,596 +0,0 @@
@@ -1,602 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
@ -461,6 +462,12 @@ index 20658694ee91e70d12ee874d8895ee9446e8ae9c..00000000000000000000000000000000
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>5.5.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <!-- This builds a completely 'ready to start' jar with all dependencies inside -->

Datei anzeigen

@ -9,7 +9,7 @@ public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..e8c4e7379d46b1ba88110729b8ccbde00c68ce55 100644
index 3be7f53046d821d6777481b92b3aa6e3df51ed8f..ff4d0f970990187e9b46324b5cf051fcc546119f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,10 +9,9 @@ plugins {
@ -25,7 +25,7 @@ index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..e8c4e7379d46b1ba88110729b8ccbde0
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
@@ -34,6 +33,7 @@ tasks.jar {
@@ -35,6 +34,7 @@ tasks.jar {
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
@ -33,7 +33,7 @@ index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..e8c4e7379d46b1ba88110729b8ccbde0
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@@ -42,6 +42,9 @@ tasks.jar {
@@ -43,6 +43,9 @@ tasks.jar {
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
"Specification-Vendor" to "Bukkit Team",
@ -43,7 +43,7 @@ index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..e8c4e7379d46b1ba88110729b8ccbde0
)
for (tld in setOf("net", "com", "org")) {
attributes("$tld/bukkit", "Sealed" to true)
@@ -49,6 +52,11 @@ tasks.jar {
@@ -50,6 +53,11 @@ tasks.jar {
}
}
@ -55,7 +55,7 @@ index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..e8c4e7379d46b1ba88110729b8ccbde0
publishing {
publications.create<MavenPublication>("maven") {
artifact(tasks.shadowJar)
@@ -75,6 +83,17 @@ tasks.shadowJar {
@@ -76,6 +84,17 @@ tasks.shadowJar {
}
}
@ -73,7 +73,7 @@ index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..e8c4e7379d46b1ba88110729b8ccbde0
tasks.test {
exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
useJUnitPlatform()
@@ -133,7 +152,14 @@ tasks.registerRunTask("runReobf") {
@@ -134,7 +153,14 @@ tasks.registerRunTask("runReobf") {
classpath(runtimeClasspathWithoutVanillaServer)
}

Datei anzeigen

@ -5,18 +5,10 @@ Subject: [PATCH] Test changes
diff --git a/build.gradle.kts b/build.gradle.kts
index e8c4e7379d46b1ba88110729b8ccbde00c68ce55..9c2e9f73fada65f67144c4f85bb182dcc4282055 100644
index ff4d0f970990187e9b46324b5cf051fcc546119f..844eff88c9ad95871900c2d8aa3136b3f2928bf9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -12,6 +12,7 @@ dependencies {
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
implementation("org.ow2.asm:asm:9.5")
implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
+ testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
@@ -57,6 +58,12 @@ tasks.compileJava {
@@ -58,6 +58,12 @@ tasks.compileJava {
options.setIncremental(false)
}
@ -29,228 +21,22 @@ index e8c4e7379d46b1ba88110729b8ccbde00c68ce55..9c2e9f73fada65f67144c4f85bb182dc
publishing {
publications.create<MavenPublication>("maven") {
artifact(tasks.shadowJar)
diff --git a/src/test/java/io/papermc/paper/testing/DummyServer.java b/src/test/java/io/papermc/paper/testing/DummyServer.java
new file mode 100644
index 0000000000000000000000000000000000000000..fd40d6818fe6b511a57f60896cf523a5e871af64
--- /dev/null
+++ b/src/test/java/io/papermc/paper/testing/DummyServer.java
@@ -0,0 +1,66 @@
+package io.papermc.paper.testing;
+
+import java.util.logging.Logger;
+import org.bukkit.Bukkit;
+import org.bukkit.Material;
+import org.bukkit.NamespacedKey;
+import org.bukkit.Server;
+import org.bukkit.command.SimpleCommandMap;
+import org.bukkit.craftbukkit.CraftRegistry;
+import org.bukkit.craftbukkit.block.data.CraftBlockData;
+import org.bukkit.craftbukkit.inventory.CraftItemFactory;
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.plugin.PluginManager;
+import org.bukkit.plugin.SimplePluginManager;
+import org.bukkit.support.AbstractTestingBase;
+import org.mockito.Mockito;
+
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class DummyServer {
+
+ @SuppressWarnings({"deprecation", "removal"})
+ public static void setup() {
+ //noinspection ConstantValue
+ if (Bukkit.getServer() != null) {
+ return;
+ }
+
+ final Server dummyServer = mock(Server.class, Mockito.withSettings().stubOnly());
+
+ final Logger logger = Logger.getLogger(DummyServer.class.getCanonicalName());
+ when(dummyServer.getLogger()).thenReturn(logger);
+ when(dummyServer.getName()).thenReturn(DummyServer.class.getSimpleName());
+ when(dummyServer.getVersion()).thenReturn("Version_" + DummyServer.class.getPackage().getImplementationVersion());
+ when(dummyServer.getBukkitVersion()).thenReturn("BukkitVersion_" + DummyServer.class.getPackage().getImplementationVersion());
+
+ final Thread currentThread = Thread.currentThread();
+ when(dummyServer.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread));
+
+ when(dummyServer.getItemFactory()).thenReturn(CraftItemFactory.instance());
+
+ when(dummyServer.getUnsafe()).thenAnswer(ignored -> CraftMagicNumbers.INSTANCE); // lambda for lazy load
+
+ when(dummyServer.createBlockData(any(Material.class))).thenAnswer(invocation -> {
+ return CraftBlockData.newData(invocation.getArgument(0, Material.class), null);
+ });
+
+ when(dummyServer.getLootTable(any(NamespacedKey.class))).thenAnswer(invocation -> {
+ final NamespacedKey key = invocation.getArgument(0, NamespacedKey.class);
+ return new org.bukkit.craftbukkit.CraftLootTable(key, AbstractTestingBase.DATA_PACK.getLootData().getLootTable(CraftNamespacedKey.toMinecraft(key)));
+ });
+
+ when(dummyServer.getRegistry(any())).thenAnswer(invocation -> {
+ return CraftRegistry.createRegistry(invocation.getArgument(0), org.bukkit.support.AbstractTestingBase.REGISTRY_CUSTOM);
+ });
+
+ final PluginManager pluginManager = new SimplePluginManager(dummyServer, new SimpleCommandMap(dummyServer));
+ when(dummyServer.getPluginManager()).thenReturn(pluginManager);
+
+ Bukkit.setServer(dummyServer);
+
+ }
+}
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
index c3c0dff6497ba47604c29a9ff7bcc4692e9ba757..bedb1c43fd9d27eda2411e23d46eb1ad96429507 100644
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
@@ -54,6 +54,7 @@ public abstract class AbstractTestingBase {
LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES);
REGISTRY_CUSTOM = layers.compositeAccess().freeze();
+ io.papermc.paper.testing.DummyServer.setup(); // Paper
// Register vanilla pack
DATA_PACK = ReloadableServerResources.loadResources(resourceManager, REGISTRY_CUSTOM, FeatureFlags.REGISTRY.allFlags(), Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join();
// Bind tags
@@ -61,7 +62,6 @@ public abstract class AbstractTestingBase {
// Biome shortcut
BIOMES = REGISTRY_CUSTOM.registryOrThrow(Registries.BIOME);
- DummyServer.setup();
DummyEnchantments.setup();
CraftRegistry.setMinecraftRegistry(REGISTRY_CUSTOM);
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
deleted file mode 100644
index e3197ea88b68de8f893f3fa986507b95b789645d..0000000000000000000000000000000000000000
index d96efc9aa90debcca5f237c949ba11b10070223a..efa4452cd20231051cdac1b497d7bfafb72bed78 100644
--- a/src/test/java/org/bukkit/support/DummyServer.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.bukkit.support;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.HashMap;
-import java.util.logging.Logger;
-import org.bukkit.Bukkit;
-import org.bukkit.Material;
-import org.bukkit.NamespacedKey;
-import org.bukkit.Server;
-import org.bukkit.craftbukkit.CraftLootTable;
-import org.bukkit.craftbukkit.CraftRegistry;
-import org.bukkit.craftbukkit.block.data.CraftBlockData;
-import org.bukkit.craftbukkit.inventory.CraftItemFactory;
-import org.bukkit.craftbukkit.util.CraftMagicNumbers;
-import org.bukkit.craftbukkit.util.CraftNamespacedKey;
-import org.bukkit.craftbukkit.util.Versioning;
-
-public final class DummyServer implements InvocationHandler {
- private static interface MethodHandler {
- Object handle(DummyServer server, Object[] args);
- }
- private static final HashMap<Method, MethodHandler> methods = new HashMap<Method, MethodHandler>();
- static {
- try {
- methods.put(
- Server.class.getMethod("getItemFactory"),
- new MethodHandler() {
- @Override
- public Object handle(DummyServer server, Object[] args) {
- return CraftItemFactory.instance();
- }
- }
- );
- methods.put(
- Server.class.getMethod("getName"),
- new MethodHandler() {
- @Override
- public Object handle(DummyServer server, Object[] args) {
- return DummyServer.class.getName();
- }
- }
- );
- methods.put(
- Server.class.getMethod("getVersion"),
- new MethodHandler() {
- @Override
- public Object handle(DummyServer server, Object[] args) {
- return DummyServer.class.getPackage().getImplementationVersion();
- }
- }
- );
- methods.put(
- Server.class.getMethod("getBukkitVersion"),
- new MethodHandler() {
- @Override
- public Object handle(DummyServer server, Object[] args) {
- return Versioning.getBukkitVersion();
- }
- }
- );
- methods.put(
- Server.class.getMethod("getLogger"),
- new MethodHandler() {
- final Logger logger = Logger.getLogger(DummyServer.class.getCanonicalName());
- @Override
- public Object handle(DummyServer server, Object[] args) {
- return logger;
- }
- }
- );
- methods.put(
- Server.class.getMethod("getUnsafe"),
- new MethodHandler() {
- @Override
- public Object handle(DummyServer server, Object[] args) {
- return CraftMagicNumbers.INSTANCE;
- }
- }
- );
- methods.put(
- Server.class.getMethod("createBlockData", Material.class),
- new MethodHandler() {
- final Logger logger = Logger.getLogger(DummyServer.class.getCanonicalName());
- @Override
- public Object handle(DummyServer server, Object[] args) {
- return CraftBlockData.newData((Material) args[0], null);
- }
- }
- );
- methods.put(Server.class.getMethod("getLootTable", NamespacedKey.class),
- new MethodHandler() {
- @Override
- public Object handle(DummyServer server, Object[] args) {
- NamespacedKey key = (NamespacedKey) args[0];
- return new CraftLootTable(key, AbstractTestingBase.DATA_PACK.getLootData().getLootTable(CraftNamespacedKey.toMinecraft(key)));
- }
- }
- );
- methods.put(Server.class.getMethod("getRegistry", Class.class),
- new MethodHandler() {
- @Override
- public Object handle(DummyServer server, Object[] args) {
- return CraftRegistry.createRegistry((Class) args[0], AbstractTestingBase.REGISTRY_CUSTOM);
- }
- }
- );
- Bukkit.setServer(Proxy.getProxyClass(Server.class.getClassLoader(), Server.class).asSubclass(Server.class).getConstructor(InvocationHandler.class).newInstance(new DummyServer()));
- } catch (Throwable t) {
- throw new Error(t);
- }
- }
-
- public static void setup() {}
-
- private DummyServer() {};
-
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) {
- MethodHandler handler = DummyServer.methods.get(method);
- if (handler != null) {
- return handler.handle(this, args);
- }
- throw new UnsupportedOperationException(String.valueOf(method));
- }
-}
+++ b/src/test/java/org/bukkit/support/DummyServer.java
@@ -38,6 +38,14 @@ public final class DummyServer {
when(instance.getRegistry(any())).then(mock -> CraftRegistry.createRegistry(mock.getArgument(0), AbstractTestingBase.REGISTRY_CUSTOM));
+ // Paper start - testing additions
+ final Thread currentThread = Thread.currentThread();
+ when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread));
+
+ final org.bukkit.plugin.PluginManager pluginManager = new org.bukkit.plugin.SimplePluginManager(instance, new org.bukkit.command.SimpleCommandMap(instance));
+ when(instance.getPluginManager()).thenReturn(pluginManager);
+ // paper end - testing additions
+
Bukkit.setServer(instance);
} catch (Throwable t) {
throw new Error(t);

Datei anzeigen

@ -15,13 +15,13 @@ public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/mine
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
diff --git a/build.gradle.kts b/build.gradle.kts
index e03e01c4b9f3886a72c569d7a64da0cca5cbcc5b..ded8824a43c99754ea12544930b416c610bd2ead 100644
index 677ec3d3b440dba6fd38ffb6f1102794ab3b013a..fd4eb839bbfa99a66ad30289d29bdc6a9fd1f3c8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,6 +13,7 @@ dependencies {
@@ -12,6 +12,7 @@ dependencies {
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
implementation("org.ow2.asm:asm:9.5")
implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
+ implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
@ -4996,12 +4996,12 @@ index 0000000000000000000000000000000000000000..0396589795da1f83ddf62426236dde9a
+ }
+}
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
index bedb1c43fd9d27eda2411e23d46eb1ad96429507..8174b6bb78553cbe124b499ffa235368179d1564 100644
index c3c0dff6497ba47604c29a9ff7bcc4692e9ba757..6dd31027808cd309b6ee5ece9fe73d251c03b7cf 100644
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
@@ -63,6 +63,7 @@ public abstract class AbstractTestingBase {
BIOMES = REGISTRY_CUSTOM.registryOrThrow(Registries.BIOME);
DummyServer.setup();
DummyEnchantments.setup();
+ io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper

Datei anzeigen

@ -7856,10 +7856,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 29bd4879ef94bcfea879fac49dea22eba4af8251..f07c3bfa42c3e26b19c08b3b5ad2ad8d86fd2fc6 100644
index 72120be90f1aa3a5408b9dc96f00b5f645809fe6..437f546cb22e0ed7d400540d890e5130889fac0c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -242,8 +242,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -243,8 +243,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public Chunk[] getLoadedChunks() {
@ -7870,7 +7870,7 @@ index 29bd4879ef94bcfea879fac49dea22eba4af8251..f07c3bfa42c3e26b19c08b3b5ad2ad8d
}
@Override
@@ -318,7 +318,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) {
@ -7879,7 +7879,7 @@ index 29bd4879ef94bcfea879fac49dea22eba4af8251..f07c3bfa42c3e26b19c08b3b5ad2ad8d
if (playerChunk == null) return false;
playerChunk.getTickingChunkFuture().thenAccept(either -> {
@@ -1970,4 +1970,32 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1995,4 +1995,32 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return this.spigot;
}
// Spigot end
@ -8198,10 +8198,10 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index b5506411a893e5eccfb83ab58d718753338b490a..bf6e87116df29a99d7aad3250e8e59d2d957159b 100644
index 795d2ef869f9ec229bac76bac5fefff9adc0f2a1..641b1f0444af8d4c4e878495605bc5ba97b124af 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -99,8 +99,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -104,8 +104,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
private static final Map<Item, Material> ITEM_MATERIAL = new HashMap<>();
private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>();
private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>();
@ -8219,7 +8219,7 @@ index b5506411a893e5eccfb83ab58d718753338b490a..bf6e87116df29a99d7aad3250e8e59d2
for (Block block : BuiltInRegistries.BLOCK) {
BLOCK_MATERIAL.put(block, Material.getMaterial(BuiltInRegistries.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT)));
}
@@ -151,6 +160,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -156,6 +165,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
public static ResourceLocation key(Material mat) {
return CraftNamespacedKey.toMinecraft(mat.getKey());
}

Datei anzeigen

@ -3051,10 +3051,10 @@ index f890e0e8ae52965f671fe82911b006a61a33a86b..e04b981e990efc6402978a329dee8024
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index f07c3bfa42c3e26b19c08b3b5ad2ad8d86fd2fc6..296cd22069ed95b35c59191def2ff568f49a944f 100644
index 437f546cb22e0ed7d400540d890e5130889fac0c..91334fc68e9e66facbf1ba9b445d87fcf4b26ddf 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -152,6 +152,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);
@ -3062,7 +3062,7 @@ index f07c3bfa42c3e26b19c08b3b5ad2ad8d86fd2fc6..296cd22069ed95b35c59191def2ff568
private static final Random rand = new Random();
@@ -1603,6 +1604,39 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1604,6 +1605,39 @@ public class CraftWorld extends CraftRegionAccessor implements World {
entityTracker.broadcastAndSend(packet);
}
}
@ -3102,7 +3102,7 @@ index f07c3bfa42c3e26b19c08b3b5ad2ad8d86fd2fc6..296cd22069ed95b35c59191def2ff568
private static Map<String, GameRules.Key<?>> gamerules;
public static synchronized Map<String, GameRules.Key<?>> getGameRulesNMS() {
@@ -1997,5 +2031,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2022,5 +2056,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return ret;
}
@ -4562,7 +4562,7 @@ index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..5c6eb9b6f3ca4fc6534fe023fe78be5c
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index fca7eb9d4a91a2dff3ebcc5522b2b0aedac75afc..087080e4df07d87b55b42436cffc2f772d883db3 100644
index 0cb3806b57c5a381b7f1fc04dcb7cfbf74fb5ef4..d1b2ff690580edb4e42cce6607afb189f28fb09a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -750,6 +750,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@ -4908,10 +4908,10 @@ index 78ea79b66cc9e90402ef5cdc2e5e04e0c74b1c26..4fede2161792ba3e7cdf0cc5a1f53318
boolean hadFormat = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index bf6e87116df29a99d7aad3250e8e59d2d957159b..c72179ff4eb4b2b479da302f648eff85a6345f34 100644
index 641b1f0444af8d4c4e878495605bc5ba97b124af..da7bc4cfde594dba68dfc644b49748b4865f7d89 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -70,6 +70,43 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -75,6 +75,43 @@ public final class CraftMagicNumbers implements UnsafeValues {
private CraftMagicNumbers() {}

Datei anzeigen

@ -7083,10 +7083,10 @@ index 909b2c98e7a9117d2f737245e4661792ffafb744..d96399e9bf1a58db5a4a22e58abb99e7
@Override
public FileConfiguration getConfig() {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index c72179ff4eb4b2b479da302f648eff85a6345f34..9e08622fbee6d1e4f5b320a6d9780a8b88f34457 100644
index da7bc4cfde594dba68dfc644b49748b4865f7d89..1c70aa4475bb43aba2f66eedabd4d1f5c5ae3409 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -419,6 +419,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -424,6 +424,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
}
@ -7891,16 +7891,16 @@ index 0000000000000000000000000000000000000000..ba271c35eb2804f94cfc893bf94affb9
+ return "null";
+ }
+}
diff --git a/src/test/java/io/papermc/paper/testing/DummyServer.java b/src/test/java/io/papermc/paper/testing/DummyServer.java
index fd40d6818fe6b511a57f60896cf523a5e871af64..88894731a6a21d74ce78d15c16e34d8a363f39cf 100644
--- a/src/test/java/io/papermc/paper/testing/DummyServer.java
+++ b/src/test/java/io/papermc/paper/testing/DummyServer.java
@@ -57,7 +57,7 @@ public final class DummyServer {
return CraftRegistry.createRegistry(invocation.getArgument(0), org.bukkit.support.AbstractTestingBase.REGISTRY_CUSTOM);
});
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
index efa4452cd20231051cdac1b497d7bfafb72bed78..1f6f055805454d7c0f726c9feef57578482c003a 100644
--- a/src/test/java/org/bukkit/support/DummyServer.java
+++ b/src/test/java/org/bukkit/support/DummyServer.java
@@ -42,7 +42,7 @@ public final class DummyServer {
final Thread currentThread = Thread.currentThread();
when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread));
- final PluginManager pluginManager = new SimplePluginManager(dummyServer, new SimpleCommandMap(dummyServer));
+ final PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(dummyServer, new SimpleCommandMap(dummyServer), null);
when(dummyServer.getPluginManager()).thenReturn(pluginManager);
- final org.bukkit.plugin.PluginManager pluginManager = new org.bukkit.plugin.SimplePluginManager(instance, new org.bukkit.command.SimpleCommandMap(instance));
+ final org.bukkit.plugin.PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(instance, new org.bukkit.command.SimpleCommandMap(instance), null);
when(instance.getPluginManager()).thenReturn(pluginManager);
// paper end - testing additions
Bukkit.setServer(dummyServer);

Datei anzeigen

@ -2050,10 +2050,10 @@ index f97eccb6a17c7876e1e002d798eb67bbe80571a0..76effc345d362047e64d064eb64a5222
+ } // Paper
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 9e08622fbee6d1e4f5b320a6d9780a8b88f34457..1ea2d4a1b378694120d599f52cc07922831f5a65 100644
index 1c70aa4475bb43aba2f66eedabd4d1f5c5ae3409..0a2a6697118833d45ffe95252cee8011b505d566 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -206,6 +206,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -211,6 +211,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
// Paper end
// ========================================================================
@ -2066,8 +2066,8 @@ index 9e08622fbee6d1e4f5b320a6d9780a8b88f34457..1ea2d4a1b378694120d599f52cc07922
public static byte toLegacyData(BlockState data) {
return CraftLegacy.toLegacyData(data);
@@ -432,6 +438,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
return CraftFeatureFlag.getFromNMS(namespacedKey);
@@ -445,6 +451,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
return new CraftPotionType(namespacedKey, potionRegistry);
}
+ // Paper start

Datei anzeigen

@ -22586,7 +22586,7 @@ index 9f6c2e5b5d9e8d714a47c770e255d06c0ef7c190..ac807277a6b26d140ea9873d17c7aa4f
for(SavedTick<T> savedTick : this.pendingTicks) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index 762d37ab5a98b19514c8ec38cb3f2ecdf1e5ba8e..4efdde5f48f50db57fdd70f84bf36a768e2601ea 100644
index 86f4d05a70d4c02a8eecfb685a23e257b55f58fd..03431a9d2ba736285836f5df1fe46b4e0d7ff50e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -112,7 +112,7 @@ public class CraftChunk implements Chunk {
@ -22683,10 +22683,10 @@ index 319be97869dcc8fb1baed483633612bae17a491a..8377270a5daa3257cd9799e242fe8894
// Paper start - Adventure
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 296cd22069ed95b35c59191def2ff568f49a944f..a41c937d8b4648c900bf6b5d4c47fcd0bbc72401 100644
index 91334fc68e9e66facbf1ba9b445d87fcf4b26ddf..dfd45e5a32e8ff8d7f803addefa8240c0f7424c0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -322,10 +322,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 296cd22069ed95b35c59191def2ff568f49a944f..a41c937d8b4648c900bf6b5d4c47fcd0
ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null);
for (ServerPlayer player : playersInRange) {
@@ -333,8 +337,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 296cd22069ed95b35c59191def2ff568f49a944f..a41c937d8b4648c900bf6b5d4c47fcd0
return true;
}
@@ -411,20 +414,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 296cd22069ed95b35c59191def2ff568f49a944f..a41c937d8b4648c900bf6b5d4c47fcd0
}
@Override
@@ -432,7 +422,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 296cd22069ed95b35c59191def2ff568f49a944f..a41c937d8b4648c900bf6b5d4c47fcd0
long chunkKey = chunkTickets.getLongKey();
SortedArraySet<Ticket<?>> tickets = chunkTickets.getValue();
@@ -1964,14 +1954,53 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1989,14 +1979,53 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Spigot start
@Override
public int getViewDistance() {

Datei anzeigen

@ -140,10 +140,10 @@ index 0000000000000000000000000000000000000000..22a55be34fde453fedd987173d95b8b3
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 1ea2d4a1b378694120d599f52cc07922831f5a65..e7d5006fcf55c5a7ba1cea0dab0edd2bf410247c 100644
index 0a2a6697118833d45ffe95252cee8011b505d566..f967975d641fadce813a34a9344f6294368b797c 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -443,6 +443,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -456,6 +456,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
public String getTimingsServerName() {
return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName;
}

Datei anzeigen

@ -20,10 +20,10 @@ index 7b681914b7f9e7fb6d2ea607e0d63ca7024a7ec3..7cfcbc1e38f5e9145c827dfe26299277
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 a41c937d8b4648c900bf6b5d4c47fcd0bbc72401..53a5f6709bca2aa76297e55e555cbfeb38e8ad4e 100644
index dfd45e5a32e8ff8d7f803addefa8240c0f7424c0..9fc72dd4db44fa65c2d4e8d30cf8c19f0fb556a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -154,6 +154,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

Datei anzeigen

@ -33,25 +33,25 @@ index 11dad6b6c6cf922417ab54a1db13d809c10c999e..adb8ac976397322f0b4122fd9469dd51
public ItemEntity(EntityType<? extends ItemEntity> type, Level world) {
super(type, world);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 4fbbc3c76d49c31aadd957ad3a30d479f6c99c15..66e69cb13e2d82acc0a2398625766a49bc701a09 100644
index 8badae31059e3f229f448ca0f99e05627f1ee141..b1be6c99ebff90ff98a7d5cafec4a856b9704b66 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@@ -65,6 +65,18 @@ public class CraftItem extends CraftEntity implements Item {
@@ -63,6 +63,18 @@ public class CraftItem extends CraftEntity implements Item {
}
}
+ // Paper Start
+ @Override
+ public boolean canMobPickup() {
+ return item.canMobPickup;
+ return this.getHandle().canMobPickup;
+ }
+
+ @Override
+ public void setCanMobPickup(boolean canMobPickup) {
+ item.canMobPickup = canMobPickup;
+ this.getHandle().canMobPickup = canMobPickup;
+ }
+ // Paper End
+
@Override
public void setOwner(UUID uuid) {
this.item.setTarget(uuid);
this.getHandle().setTarget(uuid);

Datei anzeigen

@ -34,10 +34,10 @@ index 445b8839d2a7a5ec2debb853d606e499c2a1f20b..4c1911140197568685524721e3140739
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 53a5f6709bca2aa76297e55e555cbfeb38e8ad4e..2104609f5dae00457725a57a03e3d51e2bb8b841 100644
index 9fc72dd4db44fa65c2d4e8d30cf8c19f0fb556a0..c8d960d1fc8b44f64e84abb38f12e3825d2c97bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1863,11 +1863,17 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1864,11 +1864,17 @@ 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) {

Datei anzeigen

@ -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 2104609f5dae00457725a57a03e3d51e2bb8b841..f288570c8b3cee0c0b79981f332c1c067cd7bb9e 100644
index c8d960d1fc8b44f64e84abb38f12e3825d2c97bc..2e8e66b6f89334d37a93a8571131a9cf4eb35c6f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -716,6 +716,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;
}

Datei anzeigen

@ -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 f288570c8b3cee0c0b79981f332c1c067cd7bb9e..a29cb2e267e0a9d7f4cec3cf503968933b999435 100644
index 2e8e66b6f89334d37a93a8571131a9cf4eb35c6f..a0878c2a3164cb0dd6cd5b1b982c5c854b86c322 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1040,6 +1040,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1041,6 +1041,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return list;
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread
diff --git a/build.gradle.kts b/build.gradle.kts
index 3e07bc8be9b1406b8ecbb9a4b3c6ed05f48cdbde..85c3b070da9dcde26b8f947e52ba390c535feae2 100644
index 05ca5df9b74ebf2b7d4674dabcbd88b7f8aaec53..d7b0aab57d3bd6f215876fd585b11f44b0c31829 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -38,6 +38,7 @@ dependencies {
@@ -37,6 +37,7 @@ dependencies {
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")

Datei anzeigen

@ -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 a29cb2e267e0a9d7f4cec3cf503968933b999435..6e806ede0d94cb3cdb7e772ba56a010ad241590c 100644
index a0878c2a3164cb0dd6cd5b1b982c5c854b86c322..2948cf1b2ca8e342d366077407231a89bbb36667 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -400,7 +400,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

Datei anzeigen

@ -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 6e806ede0d94cb3cdb7e772ba56a010ad241590c..238669816f082704b62a7bef8b78058dceef8be2 100644
index 2948cf1b2ca8e342d366077407231a89bbb36667..342bf2941414333ebedaf7d1bd9778a651078ff3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -692,6 +692,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -693,6 +693,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}
}

Datei anzeigen

@ -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 238669816f082704b62a7bef8b78058dceef8be2..3ff94314e2dcfab964d230684ff218c634b75499 100644
index 342bf2941414333ebedaf7d1bd9778a651078ff3..ebc2b01b21d15c52928c62edb88dbd088c8ab460 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -219,6 +219,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -220,6 +220,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return CraftBlock.at(world, new BlockPos(x, y, z));
}

Datei anzeigen

@ -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 3ff94314e2dcfab964d230684ff218c634b75499..7c6ebec598bac78e3055e5c890550238c2795f23 100644
index ebc2b01b21d15c52928c62edb88dbd088c8ab460..fdb3de1dee72a0e90a42a9d39fa021c0b81922ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1350,15 +1350,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) {

Datei anzeigen

@ -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 7c6ebec598bac78e3055e5c890550238c2795f23..0a9cf69ce0983f167ce63dc58eace455561da8e7 100644
index fdb3de1dee72a0e90a42a9d39fa021c0b81922ef..6c13c3c55d58d654d28d5eebcc6dd9789f6565dd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -307,9 +307,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 7c6ebec598bac78e3055e5c890550238c2795f23..0a9cf69ce0983f167ce63dc58eace455
throw new RuntimeException(ex);
}
}
@@ -423,20 +437,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

Datei anzeigen

@ -1541,7 +1541,7 @@ index 982fb3ef071d6a66f16744717e8e146bef6d9e8c..02beedb84a8bec001270116c6ce496db
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index d10dcf5b9c987bbd4761470c16c9d4693ccf896d..adee86c79f9db0a93691ec338791d7c75ab2dd4b 100644
index 35f8fbd29e18cf3aba120a6658552eb5dbe535d4..593c73bf497ff571ea4c19867aa9be4b8272f39b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -53,7 +53,7 @@ public class CraftChunk implements Chunk {
@ -1567,10 +1567,10 @@ index dd4d1b6f59992c8bf0336b146cc163c6a612999d..be805e78fb4cb9fba25afd53af8d72ff
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0a9cf69ce0983f167ce63dc58eace455561da8e7..83df374d5f471a9a40c670a7496a8a03970d10a3 100644
index 6c13c3c55d58d654d28d5eebcc6dd9789f6565dd..0f2166ce8facfdc8d51a580ca0c5107b7fbe67c2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -418,11 +418,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

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format.
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index e7d5006fcf55c5a7ba1cea0dab0edd2bf410247c..46af63d8a36621f48a7610b5c3d55ae71639bcf5 100644
index f967975d641fadce813a34a9344f6294368b797c..a78c6610be6e89dd89881867b8b91ed9cece7562 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -448,6 +448,52 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -461,6 +461,52 @@ public final class CraftMagicNumbers implements UnsafeValues {
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
return new com.destroystokyo.paper.PaperVersionFetcher();
}

Datei anzeigen

@ -9,8 +9,8 @@ diff --git a/build.gradle.kts b/build.gradle.kts
index 8b892c96eae2395093fcbfd696731fefd2003941..c210a1d4d779cc64ff7f5ae2d2c63b249ceb6205 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -37,6 +37,7 @@ dependencies {
testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
@@ -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.3.0") // Paper - needed to read mappings for stacktrace deobfuscation

Datei anzeigen

@ -8,14 +8,14 @@ diff --git a/build.gradle.kts b/build.gradle.kts
index c210a1d4d779cc64ff7f5ae2d2c63b249ceb6205..0fb730260d1a31cf74db808d3655a566a61fd754 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -46,6 +46,7 @@ dependencies {
@@ -45,6 +45,7 @@ dependencies {
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
+ testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.hamcrest:hamcrest:2.2")
}
testImplementation("org.mockito:mockito-core:5.5.0")
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
new file mode 100644
index 0000000000000000000000000000000000000000..f80a6ad7638453348ee82ea00b166a3aac029142

Datei anzeigen

@ -117,10 +117,10 @@ index b35b3feafbd25d698d3fea463d4bf65b6a09b590..7494c8762f7ea9828a7dfc71dc296583
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 83df374d5f471a9a40c670a7496a8a03970d10a3..047f2e4ff74089ae6e99db4d622f4c109869717a 100644
index 0f2166ce8facfdc8d51a580ca0c5107b7fbe67c2..689a0ca651e51b0207afc7346c891f363d1ec1aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1150,7 +1150,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) {

Datei anzeigen

@ -44,10 +44,10 @@ index 7494c8762f7ea9828a7dfc71dc2965838bbd8a0f..e58a2a3532d6ba62e99708b0f4f2cc8f
this.printSaveWarning = false;
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 047f2e4ff74089ae6e99db4d622f4c109869717a..8cd35efe17cd6cf06fa77cc0e3b018f3437ef71f 100644
index 689a0ca651e51b0207afc7346c891f363d1ec1aa..38d8a8306acb43e9a8bc69bd3990be8e53536e0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -279,7 +279,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 047f2e4ff74089ae6e99db4d622f4c109869717a..8cd35efe17cd6cf06fa77cc0e3b018f3
return new CraftChunk(chunk);
}
@@ -293,6 +299,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 047f2e4ff74089ae6e99db4d622f4c109869717a..8cd35efe17cd6cf06fa77cc0e3b018f3
@Override
public Chunk getChunkAt(Block block) {
Preconditions.checkArgument(block != null, "null block");
@@ -358,7 +370,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 047f2e4ff74089ae6e99db4d622f4c109869717a..8cd35efe17cd6cf06fa77cc0e3b018f3
}
return true;
@@ -444,9 +456,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 047f2e4ff74089ae6e99db4d622f4c109869717a..8cd35efe17cd6cf06fa77cc0e3b018f3
if (immediate == null) {
immediate = world.getChunkSource().chunkMap.getUnloadingChunk(x, z);
}
@@ -454,7 +469,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 047f2e4ff74089ae6e99db4d622f4c109869717a..8cd35efe17cd6cf06fa77cc0e3b018f3
world.getChunk(x, z); // make sure we're at ticket level 32 or lower
return true;
}
@@ -480,7 +495,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 047f2e4ff74089ae6e99db4d622f4c109869717a..8cd35efe17cd6cf06fa77cc0e3b018f3
world.getChunkSource().getChunk(x, z, ChunkStatus.FULL, true);
return true;
// Paper end
@@ -2208,6 +2223,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2233,6 +2248,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;

Datei anzeigen

@ -21,10 +21,10 @@ index 5826536978724b54080d7d4ee61aa79800d57800..197ef343cb2d7a072852dc36964d54d5
// if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
this.removeTicketsForSpawn(this.paperConfig().spawn.keepSpawnLoadedRange * 16, prevSpawn);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 8cd35efe17cd6cf06fa77cc0e3b018f3437ef71f..54c7316ff9d9f9352a1cf01bd508830130988a05 100644
index 38d8a8306acb43e9a8bc69bd3990be8e53536e0d..e0c3a5cf44a66d3df31871da57460bb648c8770b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -259,12 +259,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -260,12 +260,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean setSpawnLocation(int x, int y, int z, float angle) {
try {

Datei anzeigen

@ -21,10 +21,10 @@ index b0a73ddd7438b9ecd4462638f9f784d796c62c6c..71dc4112cb932c6b1305f0f22e99f069
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 46af63d8a36621f48a7610b5c3d55ae71639bcf5..62ade83a9dbf4faf226b3a39c0e4249a231390dd 100644
index a78c6610be6e89dd89881867b8b91ed9cece7562..d40ea1a394c483abe18915446d61b3f1f496af53 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -494,6 +494,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -507,6 +507,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!");
return compound;
}

Datei anzeigen

@ -15,10 +15,10 @@ manually reload the advancement data for all players, which
normally takes place as a part of the datapack reloading.
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 62ade83a9dbf4faf226b3a39c0e4249a231390dd..b6436d708b2f99d3c923c112859ecd5ea2a123d8 100644
index d40ea1a394c483abe18915446d61b3f1f496af53..fc8c1e46a2cfb4fc3095d249ba249d6eb4bbb1b2 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -327,7 +327,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -332,7 +332,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex);
}

Datei anzeigen

@ -5,45 +5,44 @@ Subject: [PATCH] Item no age & no player pickup
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 66e69cb13e2d82acc0a2398625766a49bc701a09..ff6868ab31cec208045353c842f20ca31191bc0a 100644
index b1be6c99ebff90ff98a7d5cafec4a856b9704b66..43f6422fedae4304801c7be21990725eca11fc62 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@@ -9,6 +9,12 @@ import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
@@ -9,6 +9,11 @@ import org.bukkit.inventory.ItemStack;
public class CraftItem extends CraftEntity implements Item {
+
+ // Paper start
+ private final static int NO_AGE_TIME = (int) Short.MIN_VALUE;
+ private final static int NO_PICKUP_TIME = (int) Short.MAX_VALUE;
+ // Paper end
+
private final ItemEntity item;
public CraftItem(CraftServer server, Entity entity, ItemEntity item) {
@@ -75,6 +81,26 @@ public class CraftItem extends CraftEntity implements Item {
public CraftItem(CraftServer server, ItemEntity entity) {
super(server, entity);
}
@@ -73,6 +78,26 @@ public class CraftItem extends CraftEntity implements Item {
public void setCanMobPickup(boolean canMobPickup) {
item.canMobPickup = canMobPickup;
this.getHandle().canMobPickup = canMobPickup;
}
+
+ @Override
+ public boolean canPlayerPickup() {
+ return item.pickupDelay != NO_PICKUP_TIME;
+ return this.getHandle().pickupDelay != NO_PICKUP_TIME;
+ }
+
+ @Override
+ public void setCanPlayerPickup(boolean canPlayerPickup) {
+ item.pickupDelay = canPlayerPickup ? 0 : NO_PICKUP_TIME;
+ this.getHandle().pickupDelay = canPlayerPickup ? 0 : NO_PICKUP_TIME;
+ }
+
+ @Override
+ public boolean willAge() {
+ return item.age != NO_AGE_TIME;
+ return this.getHandle().age != NO_AGE_TIME;
+ }
+
+ @Override
+ public void setWillAge(boolean willAge) {
+ item.age = willAge ? 0 : NO_AGE_TIME;
+ this.getHandle().age = willAge ? 0 : NO_AGE_TIME;
+ }
// Paper End

Datei anzeigen

@ -64,10 +64,10 @@ index 6a1001cb708a7f779a801428d2b00fbcde888bc1..2e240ad721928a9a68370114ba61c218
public int get() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 54c7316ff9d9f9352a1cf01bd508830130988a05..013d7f6107230e3e530ff86cc9219ca0a6681ec6 100644
index e0c3a5cf44a66d3df31871da57460bb648c8770b..31fda85d5da2cbf4af199fd2431b258592f14af4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1845,8 +1845,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1846,8 +1846,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
if (!this.isGameRule(rule)) return false;
@ -82,7 +82,7 @@ index 54c7316ff9d9f9352a1cf01bd508830130988a05..013d7f6107230e3e530ff86cc9219ca0
handle.onChanged(this.getHandle().getServer());
return true;
}
@@ -1882,8 +1887,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1883,8 +1888,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
if (!this.isGameRule(rule.getName())) return false;

Datei anzeigen

@ -67,10 +67,10 @@ index 877ce4baa6a0e755d81bdc3df57fcc9a0a90f1a5..48ba01082041281d247b898cfa84bccf
// Check if a World already exists with the UID.
if (this.getWorld(world.getUID()) != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index b6436d708b2f99d3c923c112859ecd5ea2a123d8..8a2b8f8b36e54b97fa2518eb54c31da8fe0d6d67 100644
index fc8c1e46a2cfb4fc3095d249ba249d6eb4bbb1b2..9c8d50e072db0551182dd7ea31eca11c1371702a 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -505,6 +505,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -518,6 +518,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
public int nextEntityId() {
return net.minecraft.world.entity.Entity.nextEntityId();
}

Datei anzeigen

@ -7,10 +7,10 @@ Subject: [PATCH] Item Rarity API
public net.minecraft.world.item.Item rarity
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 8a2b8f8b36e54b97fa2518eb54c31da8fe0d6d67..2039442d5d7f99e6589e4625a76ebbc62944d018 100644
index 9c8d50e072db0551182dd7ea31eca11c1371702a..38dbbc1977aa29292a89e8f9d8baf6030d89d7d1 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -510,6 +510,20 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -523,6 +523,20 @@ public final class CraftMagicNumbers implements UnsafeValues {
public String getMainLevelName() {
return ((net.minecraft.server.dedicated.DedicatedServer) net.minecraft.server.MinecraftServer.getServer()).getProperties().levelName;
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Expose protocol version
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 2039442d5d7f99e6589e4625a76ebbc62944d018..aed137c6857190e6dad62ab70ae0be3613f3bea3 100644
index 38dbbc1977aa29292a89e8f9d8baf6030d89d7d1..35484b3ad8a767b4d74ca926d9d8610d142624a1 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -524,6 +524,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -537,6 +537,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
public io.papermc.paper.inventory.ItemRarity getItemStackRarity(org.bukkit.inventory.ItemStack itemStack) {
return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()];
}

Datei anzeigen

@ -5,31 +5,15 @@ Subject: [PATCH] More World API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 013d7f6107230e3e530ff86cc9219ca0a6681ec6..085faebd53c0d620fe4e9aa5f0fc88b0e96d0b10 100644
index 31fda85d5da2cbf4af199fd2431b258592f14af4..4d5e34a9ad59c3ed3b39630f0fd4e119ea3326e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2088,6 +2088,69 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2089,6 +2089,53 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value(), this.getHandle().registryAccess()), CraftLocation.toBukkit(found.getFirst(), this));
}
+ // Paper start
+ @Override
+ public Location locateNearestBiome(Location origin, Biome biome, int radius) {
+ return this.locateNearestBiome(origin, biome, radius, 8);
+ }
+
+ @Override
+ public Location locateNearestBiome(Location origin, Biome biome, int radius, int step) {
+ BlockPos originPos = io.papermc.paper.util.MCUtil.toBlockPos(origin);
+ Pair<BlockPos, Holder<net.minecraft.world.level.biome.Biome>> pair = getHandle().findClosestBiome3d(holder -> holder.is(CraftNamespacedKey.toMinecraft(biome.getKey())), originPos, radius, step, step);
+ if (pair == null) {
+ return null;
+ }
+ BlockPos nearest = pair.getFirst();
+ return new Location(this, nearest.getX(), nearest.getY(), nearest.getZ());
+ }
+
+ @Override
+ public boolean isUltrawarm() {
+ return getHandle().dimensionType().ultraWarm();
+ }
@ -76,8 +60,8 @@ index 013d7f6107230e3e530ff86cc9219ca0a6681ec6..085faebd53c0d620fe4e9aa5f0fc88b0
+ // Paper end
+
@Override
public Raid locateNearestRaid(Location location, int radius) {
Preconditions.checkArgument(location != null, "Location cannot be null");
public BiomeSearchResult locateNearestBiome(Location origin, int radius, Biome... biomes) {
return this.locateNearestBiome(origin, radius, 32, 64, biomes);
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftVector.java b/src/main/java/org/bukkit/craftbukkit/util/CraftVector.java
index 3071ac1ac0e733d73dade49597a39f7d156bbc04..967445b2eb158454100a27369a1f463d69f54f27 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftVector.java

Datei anzeigen

@ -1,44 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sceri <scerimail@gmail.com>
Date: Fri, 14 May 2021 19:06:51 +0500
Subject: [PATCH] Fix CraftPotionBrewer cache
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
index 1e4bc0d9f9d2e45157929af685f116988cbb8c03..8fdc9a3bb2f1b6bdc6c2c96f8ade7e9cd88ea4e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
@@ -15,12 +15,18 @@ import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
public class CraftPotionBrewer implements PotionBrewer {
- private static final Map<PotionType, Collection<PotionEffect>> cache = Maps.newHashMap();
+ private static final Map<Integer, Collection<PotionEffect>> cache = Maps.newHashMap(); // Paper
@Override
public Collection<PotionEffect> getEffects(PotionType damage, boolean upgraded, boolean extended) {
- if (CraftPotionBrewer.cache.containsKey(damage))
- return CraftPotionBrewer.cache.get(damage);
+ // Paper start
+ int key = damage.ordinal() << 2;
+ key |= (upgraded ? 1 : 0) << 1;
+ key |= extended ? 1 : 0;
+
+ if (CraftPotionBrewer.cache.containsKey(key))
+ return CraftPotionBrewer.cache.get(key);
+ // Paper end
List<MobEffectInstance> mcEffects = Potion.byName(CraftPotionUtil.fromBukkit(new PotionData(damage, extended, upgraded))).getEffects();
@@ -29,9 +35,9 @@ public class CraftPotionBrewer implements PotionBrewer {
builder.add(CraftPotionUtil.toBukkit(effect));
}
- CraftPotionBrewer.cache.put(damage, builder.build());
+ CraftPotionBrewer.cache.put(key, builder.build()); // Paper
- return CraftPotionBrewer.cache.get(damage);
+ return CraftPotionBrewer.cache.get(key); // Paper
}
@Override

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack repair check API
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index aed137c6857190e6dad62ab70ae0be3613f3bea3..794c1da115ccfa26fd77f7b28406e6298d88f3db 100644
index 35484b3ad8a767b4d74ca926d9d8610d142624a1..5cb6fe52514a94eeda2676659f1a990071befecd 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -525,6 +525,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -538,6 +538,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()];
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Attributes API for item defaults
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 794c1da115ccfa26fd77f7b28406e6298d88f3db..b16e22ab5f371ce8d84a77a2f709d3541d48d3b6 100644
index 5cb6fe52514a94eeda2676659f1a990071befecd..9c06e1b5853de70eb9fad444b2a97acd25328bc4 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -533,6 +533,19 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -546,6 +546,19 @@ public final class CraftMagicNumbers implements UnsafeValues {
return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial));
}

Datei anzeigen

@ -95,10 +95,10 @@ index 14b8011c8874e05647eb1636ee1eed5d90da8200..7bfc5bbfcf67e5bbf57e99e648ff5bed
if (weather.isCancelled()) {
return;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 085faebd53c0d620fe4e9aa5f0fc88b0e96d0b10..065ae3bea7dfe8f360ad9ac97d503880a41e9dd0 100644
index 784001a514b2400b07f64f7d60ec0926891b7b51..a08d724c327b8f3eb819f72713b7fe4be18c1940 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1186,7 +1186,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1187,7 +1187,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setStorm(boolean hasStorm) {
@ -107,7 +107,7 @@ index 085faebd53c0d620fe4e9aa5f0fc88b0e96d0b10..065ae3bea7dfe8f360ad9ac97d503880
this.setWeatherDuration(0); // Reset weather duration (legacy behaviour)
this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
}
@@ -1208,7 +1208,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1209,7 +1209,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setThundering(boolean thundering) {

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen