From e71930939eb79879154948d1c32a13f9d4bcc99a Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 15 Mar 2023 10:33:43 +0100 Subject: [PATCH] Updated Upstream (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 CraftBukkit Changes: e1fc95c50 Fix crash with 1.20 smithing table 04dfb921d Fix crash with juke boxes 1264a6fb5 Fix crash with composters --- patches/server/Add-PrepareResultEvent.patch | 2 +- ...ntityChangeBlockEvent-in-more-places.patch | 2 +- patches/server/Fix-Jukeboxes.patch | 52 ------------------- ...smithing-table.patch => Fix-sniffer.patch} | 15 +----- work/CraftBukkit | 2 +- 5 files changed, 4 insertions(+), 69 deletions(-) rename patches/server/{Fix-sniffer-and-new-smithing-table.patch => Fix-sniffer.patch} (57%) diff --git a/patches/server/Add-PrepareResultEvent.patch b/patches/server/Add-PrepareResultEvent.patch index 3a455309e8..6218deffd8 100644 --- a/patches/server/Add-PrepareResultEvent.patch +++ b/patches/server/Add-PrepareResultEvent.patch @@ -134,7 +134,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public static void callPrepareSmithingEvent(InventoryView view, ItemStack item) { // Paper - verify nothing uses return - handled below in PrepareResult + PrepareSmithingEvent event = new PrepareSmithingEvent(view, CraftItemStack.asCraftMirror(item)); // Paper - remove clone + //event.getView().getPlayer().getServer().getPluginManager().callEvent(event); // Paper - disable event - event.getInventory().setItem(2, event.getResult()); + event.getInventory().setResult(event.getResult()); - return event; + //return event; // Paper } diff --git a/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch index 28fb44eb5f..90514073a4 100644 --- a/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch @@ -209,7 +209,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void gameEvent(GameEvent event, Vec3 emitterPos, GameEvent.Context emitter) { -- throw new UnsupportedOperationException("Not supported yet."); +- // Used by BlockComposter + // Used by ComposterBlock } diff --git a/patches/server/Fix-Jukeboxes.patch b/patches/server/Fix-Jukeboxes.patch index f41164014e..ac2cc1c503 100644 --- a/patches/server/Fix-Jukeboxes.patch +++ b/patches/server/Fix-Jukeboxes.patch @@ -4,58 +4,6 @@ Date: Tue, 14 Mar 2023 18:55:56 -0700 Subject: [PATCH] Fix Jukeboxes -diff --git a/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java -@@ -0,0 +0,0 @@ public class JukeboxBlockEntity extends BlockEntity implements Clearable, Contai - - @Override - public int getMaxStackSize() { -- return 1; -+ return this.maxStack; // Paper - } - - @Override -@@ -0,0 +0,0 @@ public class JukeboxBlockEntity extends BlockEntity implements Clearable, Contai - this.level.updateNeighborsAt(this.getBlockPos(), this.getBlockState().getBlock()); - this.setChanged(); - } -+ -+ // Paper start -+ public java.util.List transaction = new java.util.ArrayList<>(); -+ private int maxStack = 1; -+ @Override -+ public java.util.List getContents() { -+ return this.items; -+ } -+ -+ @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 getViewers() { -+ return this.transaction; -+ } -+ -+ @Override -+ public void setMaxStackSize(int size) { -+ this.maxStack = size; -+ } -+ -+ @Override -+ public org.bukkit.Location getLocation() { -+ return new org.bukkit.Location(this.level.getWorld(), this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ()); -+ } -+ // Paper end - } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java diff --git a/patches/server/Fix-sniffer-and-new-smithing-table.patch b/patches/server/Fix-sniffer.patch similarity index 57% rename from patches/server/Fix-sniffer-and-new-smithing-table.patch rename to patches/server/Fix-sniffer.patch index ccf53a49a5..d47730f698 100644 --- a/patches/server/Fix-sniffer-and-new-smithing-table.patch +++ b/patches/server/Fix-sniffer.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 14 Mar 2023 20:03:21 -0700 -Subject: [PATCH] Fix sniffer and new smithing table +Subject: [PATCH] Fix sniffer diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java @@ -40,16 +40,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -0,0 +0,0 @@ public class CraftEventFactory { - public static void callPrepareSmithingEvent(InventoryView view, ItemStack item) { // Paper - verify nothing uses return - handled below in PrepareResult - PrepareSmithingEvent event = new PrepareSmithingEvent(view, CraftItemStack.asCraftMirror(item)); // Paper - remove clone - //event.getView().getPlayer().getServer().getPluginManager().callEvent(event); // Paper - disable event -- event.getInventory().setItem(2, event.getResult()); -+ event.getInventory().setItem(view.getType() == org.bukkit.event.inventory.InventoryType.SMITHING_NEW ? 3 : 2, event.getResult()); // Paper - use correct result slot index depending on inventory type - //return event; // Paper - } - // Paper end diff --git a/work/CraftBukkit b/work/CraftBukkit index 703575fc77..e1fc95c506 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 703575fc7725efaf27b633c64316edf235860ae9 +Subproject commit e1fc95c506834dfbb12c5adf00764ed5c46a2fca