diff --git a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch index 08744f1d7f..ff66994bf7 100644 --- a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch @@ -89,6 +89,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +@@ -0,0 +0,0 @@ public class ServerPlayerGameMode { + return event; // Paper + } + // CraftBukkit end +- this.setGameModeForPlayer(gameMode, this.previousGameModeForPlayer); ++ this.setGameModeForPlayer(gameMode, this.gameModeForPlayer); // Paper - Fix MC-259571 + this.player.onUpdateAbilities(); + this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit + this.level.updateSleepingPlayerList(); diff --git a/src/main/java/net/minecraft/world/entity/Saddleable.java b/src/main/java/net/minecraft/world/entity/Saddleable.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Saddleable.java @@ -251,17 +264,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } - -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -0,0 +0,0 @@ public class ServerPlayerGameMode { - return event; // Paper - } - // CraftBukkit end -- this.setGameModeForPlayer(gameMode, this.previousGameModeForPlayer); -+ this.setGameModeForPlayer(gameMode, this.gameModeForPlayer); // Paper - Fix MC-259571 - this.player.onUpdateAbilities(); - this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit - this.level.updateSleepingPlayerList(); diff --git a/patches/server/Fix-certain-inventories-returning-null-Locations.patch b/patches/server/Fix-certain-inventories-returning-null-Locations.patch new file mode 100644 index 0000000000..527c1d98a7 --- /dev/null +++ b/patches/server/Fix-certain-inventories-returning-null-Locations.patch @@ -0,0 +1,59 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Wed, 15 Mar 2023 18:29:45 -0700 +Subject: [PATCH] Fix certain inventories returning null Locations + +Wandering Trader, AbstractHorse, and Beacon inventories returned null locations +when a block or entity location is readily available + +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +@@ -0,0 +0,0 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, + public void createInventory() { + SimpleContainer inventorysubcontainer = this.inventory; + +- this.inventory = new SimpleContainer(this.getInventorySize(), (org.bukkit.entity.AbstractHorse) this.getBukkitEntity()); // CraftBukkit ++ // Paper start ++ this.inventory = new SimpleContainer(this.getInventorySize(), (org.bukkit.entity.AbstractHorse) this.getBukkitEntity()) // CraftBukkit ++ { ++ @Override ++ public org.bukkit.Location getLocation() { ++ return AbstractHorse.this.getBukkitEntity().getLocation(); ++ } ++ }; ++ // Paper end + if (inventorysubcontainer != null) { + inventorysubcontainer.removeListener(this); + int i = Math.min(inventorysubcontainer.getContainerSize(), this.inventory.getContainerSize()); +diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java ++++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +@@ -0,0 +0,0 @@ public class BeaconMenu extends AbstractContainerMenu { + public int getMaxStackSize() { + return 1; + } ++ // Paper start ++ @Override ++ public org.bukkit.Location getLocation() { ++ return context.getLocation(); ++ } ++ // Paper end + }; + checkContainerDataCount(propertyDelegate, 3); + this.beaconData = propertyDelegate; +diff --git a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java ++++ b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java +@@ -0,0 +0,0 @@ public class MerchantContainer implements Container { + + @Override + public Location getLocation() { +- return (this.merchant instanceof Villager) ? ((Villager) this.merchant).getBukkitEntity().getLocation() : null; ++ return (this.merchant instanceof AbstractVillager) ? ((AbstractVillager) this.merchant).getBukkitEntity().getLocation() : null; // Paper + } + // CraftBukkit end +