Skip to content

Commit

Permalink
Updated Upstream (Bukkit/CraftBukkit)
Browse files Browse the repository at this point in the history
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:
9a294519 SPIGOT-7533, 943: Add missing Poses for 1.20.3
be2884c4 Add unique ID to PlayerResourcePackStatusEvent
d9c1eb83 Add additional @MinecraftExperimental annotations
68f5bb6a SPIGOT-7526: Add missing PlayerResourcePackStatusEvent statuses

CraftBukkit Changes:
368c48b Fix formatting issue in previous commit
da8f91f SPIGOT-7534: Error when chunk with decorated pot trying to save
d20c929 SPIGOT-7532: Entity#isValid() returns false after server restart
ec1fa2e PR-1309: Add tests for Bukkit Pose
5a7080b Add unique ID to PlayerResourcePackStatusEvent
0fd7349 SPIGOT-7528: Fix certain custom shaped recipes
  • Loading branch information
kennytv committed Dec 6, 2023
1 parent b1f94a8 commit 6bafacf
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 100 deletions.
16 changes: 9 additions & 7 deletions patches/api/0028-Complete-resource-pack-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -144,39 +144,41 @@ index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88

// Spigot start
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
index b98195650d49d78ec35970ca0376b6289b861e4b..4c2102a11c3d682d98f0db4ccafa35231e66bcdd 100644
index e2c4f9a0456cef345772d57b4d9c6e7d9598dd53..d80191e0848e04bbfb740113b9b1646dae087ec0 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -11,13 +11,32 @@ import org.jetbrains.annotations.NotNull;
public class PlayerResourcePackStatusEvent extends PlayerEvent {
@@ -13,14 +13,34 @@ public class PlayerResourcePackStatusEvent extends PlayerEvent {

private static final HandlerList handlers = new HandlerList();
private final UUID id;
+ @Deprecated
+ private final String hash; // Paper
private final Status status;

public PlayerResourcePackStatusEvent(@NotNull final Player who, @NotNull Status resourcePackStatus) {
public PlayerResourcePackStatusEvent(@NotNull final Player who, @NotNull UUID id, @NotNull Status resourcePackStatus) {
super(who);
this.id = id;
+ this.hash = null; // Paper
this.status = resourcePackStatus;
}

+ @Deprecated // Paper
+ public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus, String hash) {
+ public PlayerResourcePackStatusEvent(@NotNull final Player who, @NotNull UUID id, Status resourcePackStatus, String hash) {
+ super(who);
+ this.id = id;
+ this.hash = hash; // Paper
+ this.status = resourcePackStatus;
+ }
+
+ @Deprecated
+ /**
+ * @deprecated Hash does not seem to ever be set
+ */
+ @Deprecated
+ public String getHash() {
+ return this.hash;
+ }
+ // Paper end
+
/**
* Gets the status of this pack.
* Gets the unique ID of this pack.
*
4 changes: 2 additions & 2 deletions patches/api/0056-Fix-upstream-javadocs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -837,10 +837,10 @@ index 6782024735a885ba0b1b4dba4a576740c1410366..8977f7609431c3c46324a82de84d4a32
@Override
public HandlerList getHandlers() {
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
index 4c2102a11c3d682d98f0db4ccafa35231e66bcdd..ca238af544764273b9cd4cf3587e8632031c9ede 100644
index d80191e0848e04bbfb740113b9b1646dae087ec0..25ac728dac8c15c18851dde4cbcc10028552ae77 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -5,8 +5,9 @@ import org.bukkit.event.HandlerList;
@@ -6,8 +6,9 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,10 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index e3c94a56237ccd24a73857eb06404a39fff9c582..5ec5f5d3f8a8995a1ca90f251f856c7f24a940c4 100644
index ca6d0eaa9d9a37c07f3e1630b83a79bf98211edb..26d02aa5da444112f8fa84c07e3080bb669983a1 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -200,6 +200,18 @@ public enum Particle implements Keyed {
@@ -204,6 +204,18 @@ public enum Particle implements Keyed {
return key;
}

Expand Down
4 changes: 2 additions & 2 deletions patches/api/0173-Fix-Spigot-annotation-mistakes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ index 48aecc9421c500137bbef1dfe3bec8de277c3ff9..aff858346776386f1288b648b221404f
return note;
}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 5ec5f5d3f8a8995a1ca90f251f856c7f24a940c4..06c497bf342d82bcd8e481febf348811d19e629a 100644
index 26d02aa5da444112f8fa84c07e3080bb669983a1..0cb15350704955f4a1aeff184a8b60d9a9871ded 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -54,7 +54,9 @@ public enum Particle implements Keyed {
Expand All @@ -451,7 +451,7 @@ index 5ec5f5d3f8a8995a1ca90f251f856c7f24a940c4..06c497bf342d82bcd8e481febf348811
BLOCK_DUST("block", BlockData.class, false),
WATER_DROP("rain"),
MOB_APPEARANCE("elder_guardian"),
@@ -144,15 +146,21 @@ public enum Particle implements Keyed {
@@ -148,15 +150,21 @@ public enum Particle implements Keyed {
// ----- Legacy Separator -----
/**
* Uses {@link MaterialData} as DataType
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0033-Entity-Origin-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Subject: [PATCH] Entity Origin API


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 51f0705499003ea71274e1d5c8a77306fa868485..0c8042a515daeeb95b14147214e0a3151ef6f5a1 100644
index 9969b66e39fb6ce8a9ba24ccbd7ef5d3e363197f..363f94a2fb54b7a55f392cc65a6e4d68f313fb07 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2390,6 +2390,15 @@ public class ServerLevel extends Level implements WorldGenLevel {

@@ -2389,6 +2389,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::add);
entity.inWorld = true; // CraftBukkit - Mark entity as in world
entity.valid = true; // CraftBukkit
+ // Paper start - Set origin location when the entity is being added to the world
+ if (entity.getOriginVector() == null) {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0064-Complete-resource-pack-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Complete resource pack API


diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 0a6feccc657e62d7bad5e1461d5538a4c3a16b76..53833e155cf0d2328f2c2b36702970925045be3d 100644
index 56f6f65ceb1271e9273b1ee6658773eb3445beed..a26db4bd859ef52dadf03f1b62155bcc54b7a740 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -156,7 +156,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack {} rejection", this.playerProfile().getName(), packet.id());
this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"));
}
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()])); // CraftBukkit
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packet.id(), PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()])); // CraftBukkit
+ // Paper start
+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()];
+ player.getBukkitEntity().setResourcePackStatus(packStatus);
+ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
+ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packet.id(), packStatus)); // CraftBukkit
+ // Paper end

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 0718f8745fed4cd0cbb29372159ff39bdce7d0fd..3d826b82034dc12daa521414142dfe3cdd41365b 100644
index f9e9348a897d8f8bd5eb5bd951c6e2416e73562d..16abfc81d054cdc983500d3e498533ea8e8cc0be 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2402,6 +2402,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2401,6 +2401,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.setOrigin(entity.getOriginVector().toLocation(getWorld()));
}
// Paper end
+ new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
}

public void onTrackingEnd(Entity entity) {
@@ -2477,6 +2478,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2476,6 +2477,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
// CraftBukkit end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed.

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index af16cabd57a5fb28c2e70856730dd0df6c8abf9c..98ea55455d365b8d25ecb998daacbcbb1b45e5a7 100644
index 6baf4caafbb4f7a09fe3a806bbff17c9f6105fbd..97554ab72743cf2b8e87c7f3c35579f669c2308a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2423,6 +2423,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2422,6 +2422,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
{
if ( iter.next().player == entity )
{
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0190-Block-Enderpearl-Travel-Exploit.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public net.minecraft.world.entity.projectile.Projectile cachedOwner
public net.minecraft.world.entity.projectile.Projectile ownerUUID

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5f6bd432566c4e437d7580e465b52b49bdfc057d..6c03c96adfa68b1817423d012affa5b3952ade04 100644
index 97554ab72743cf2b8e87c7f3c35579f669c2308a..6d75010bf837a791f5fe04aacb973246410bbd66 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2356,6 +2356,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2354,6 +2354,12 @@ public class ServerLevel extends Level implements WorldGenLevel {

public void onTickingEnd(Entity entity) {
ServerLevel.this.entityTickList.remove(entity);
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0214-InventoryCloseEvent-Reason-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e024c296f471737764af260ca4cd7e9005e044ac..ac43aba1ae9420a2a02fd3d3e3d4426c04e76139 100644
index 0705a1bb63f056a228308d348bc5db87b0bee5a1..cc499b31cf186412e575373a5fb7cad54946b0a7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1470,7 +1470,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
Expand All @@ -19,7 +19,7 @@ index e024c296f471737764af260ca4cd7e9005e044ac..ac43aba1ae9420a2a02fd3d3e3d4426c
}
}
}
@@ -2446,7 +2446,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2445,7 +2445,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ index bd15131b7506e965bcf64be20330731256a1e1f0..0e3c89b9d75160d0e8947d042a1568da
EntityType<?> entitytypes = entity.getType();
int i = entitytypes.clientTrackingRange() * 16;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index cfb28fbb860ac3d09589776d1b722cbb72d12de8..3ba431c4841a03018660f5137894b10298b417b9 100644
index 321f90a0ad7cdd3b0e8b136682947a467f2388b9..86015c6b289ce6fb6b9d1b0ca3f637e53192eea3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2502,7 +2502,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2500,7 +2500,7 @@ public class ServerLevel extends Level implements WorldGenLevel {

public void onTrackingStart(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
Expand All @@ -37,9 +37,9 @@ index cfb28fbb860ac3d09589776d1b722cbb72d12de8..3ba431c4841a03018660f5137894b102
if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity;

@@ -2536,6 +2536,7 @@ public class ServerLevel extends Level implements WorldGenLevel {

@@ -2535,6 +2535,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::add);
entity.inWorld = true; // CraftBukkit - Mark entity as in world
entity.valid = true; // CraftBukkit
+ ServerLevel.this.getChunkSource().addEntity(entity);
// Paper start - Set origin location when the entity is being added to the world
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5ff0275067f11bcd723cf8884788f76e966832e4..cfc53b3c270e02131ef1b3daf3476e3cce21e6e1 100644
index a3ef919ff07655e835a1b423b3d4f71939a47db8..fa4a6f519a4611fe896210a97aeb334e1fae039d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2683,6 +2683,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2682,6 +2682,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0801-Don-t-tick-markers.patch
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ index ff99336e0b8131ae161cfa5c4fc83c6905e3dbc8..5f43aedc6596e2b1ac7af97115157147
}
});
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index cfc53b3c270e02131ef1b3daf3476e3cce21e6e1..3ac7c157cddfaa9262e727705eb88b55a637f618 100644
index fa4a6f519a4611fe896210a97aeb334e1fae039d..91fdab7fc3afacfa58e91d5714f6bf7c3359278a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2593,6 +2593,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2591,6 +2591,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}

public void onTickingStart(Entity entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Remove unnecessary onTrackingStart during navigation warning


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 222e85b22c5d1f5a135e7620df0786c709dff2e4..9ea6786730d6a8e9fddd49a0b28eeefd2d5a8ef4 100644
index ac9f42e8d88ca8cdb2882bd8d7676a793024599c..ab8c8643c48f6ac49f4b73eed6462cd62482b269 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2629,7 +2629,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2627,7 +2627,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Mob) {
Mob entityinsentient = (Mob) entity;

Expand All @@ -17,7 +17,7 @@ index 222e85b22c5d1f5a135e7620df0786c709dff2e4..9ea6786730d6a8e9fddd49a0b28eeefd
String s = "onTrackingStart called during navigation iteration";

Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration"));
@@ -2714,7 +2714,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2713,7 +2713,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Mob) {
Mob entityinsentient = (Mob) entity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Makes certain entities check all players when searching for a player
instead of just checking players in their world.

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9ea6786730d6a8e9fddd49a0b28eeefd2d5a8ef4..ded19a243173c9d5c3d56d61a719ce169eeb0dfa 100644
index ab8c8643c48f6ac49f4b73eed6462cd62482b269..b3ffc58db60cbe0591086c3768ae6009ca7017c7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2751,4 +2751,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2750,4 +2750,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::move);
}
}
Expand Down
Loading

0 comments on commit 6bafacf

Please sign in to comment.