Updated Upstream (Bukkit/CraftBukkit)

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:
368c48be1 Fix formatting issue in previous commit
da8f91f31 SPIGOT-7534: Error when chunk with decorated pot trying to save
d20c9291a SPIGOT-7532: Entity#isValid() returns false after server restart
ec1fa2ead PR-1309: Add tests for Bukkit Pose
5a7080b58 Add unique ID to PlayerResourcePackStatusEvent
0fd734950 SPIGOT-7528: Fix certain custom shaped recipes
This commit is contained in:
Nassim Jahnke 2023-12-06 22:59:39 +01:00
parent 866d36c9ad
commit 7bd24cf0a9
7 changed files with 14 additions and 69 deletions

View file

@ -147,36 +147,38 @@ diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
public class PlayerResourcePackStatusEvent extends PlayerEvent {
@@ -0,0 +0,0 @@ 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.
*

View file

@ -12,11 +12,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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
}

View file

@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -0,0 +0,0 @@ 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) {

View file

@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
Date: Wed, 6 Dec 2023 22:00:10 +0100
Subject: [PATCH] Fix decorated pots crashing the server
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
@@ -0,0 +0,0 @@ public class DecoratedPotBlockEntity extends BlockEntity implements Randomizable
@Nullable
protected ResourceLocation lootTable;
protected long lootTableSeed;
+ // Paper start - fix cb dumb
+ public java.util.List<org.bukkit.entity.HumanEntity> transaction = new java.util.ArrayList<>();
+ private int maxStack = MAX_STACK;
+
+ @Override
+ public int getMaxStackSize() {
+ return this.maxStack;
+ }
+
+ @Override
+ public java.util.List<ItemStack> getContents() {
+ return java.util.Arrays.asList(this.item);
+ }
+
+ @Override
+ public void onOpen(org.bukkit.craftbukkit.entity.CraftHumanEntity who) {
+ this.transaction.add(who);
+ }
+
+ @Override
+ public void onClose(org.bukkit.craftbukkit.entity.CraftHumanEntity who) {
+ this.transaction.remove(who);
+ }
+
+ @Override
+ public java.util.List<org.bukkit.entity.HumanEntity> getViewers() {
+ return this.transaction;
+ }
+
+ @Override
+ public void setMaxStackSize(int size) {
+ this.maxStack = size;
+ }
+
+ @Override
+ public org.bukkit.Location getLocation() {
+ if (this.level == null) return null;
+ return new org.bukkit.Location(this.level.getWorld(), this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ());
+ }
+ // Paper end - fix cb dumb
public DecoratedPotBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityType.DECORATED_POT, pos, state);

View file

@ -38,8 +38,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ServerPlayer entityplayer = (ServerPlayer) entity;
@@ -0,0 +0,0 @@ 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

@ -1 +1 @@
Subproject commit adcf6347c520b143677b2380edfb228661facf0e
Subproject commit 9a294519b082385a41711eed78797c6b7f3c2476

@ -1 +1 @@
Subproject commit 8232a74cf8d32bce37c33ff6d0cd9b688a1ef8e9
Subproject commit 368c48be1b32ddc3c062f46b96e4450ea66be935