3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/patches/server/0987-Expose-LootTable-of-DecoratedPot.patch
Nassim Jahnke fe53b0e76f
Updated Upstream (Bukkit/CraftBukkit/Spigot)
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:
1d522878 PR-966: Introduce getRespawnLocation as a replacement for getBedSpawnLocation
cc01b745 PR-965: Add DragonBattle#setPreviouslyKilled
28e3702f SPIGOT-6921, PR-957: Add methods to remove all enchantments on an ItemStack
8872404e PR-961: Add BlockData#copyTo
4054cc7b PR-956: Add method to get an offline player's location

CraftBukkit Changes:
292ec79e0 SPIGOT-7568: Call EntityChangeBlockEvent for DecoratedPot
b44bf5aa8 SPIGOT-7575: SuspiciousStewMeta creates invalid PotionEffect data
161784713 PR-1340: Centralize the conversion from and to Minecraft / Bukkit registry items even more and add a test case for them
b93c5a30d PR-1338: Introduce getRespawnLocation as a replacement for getBedSpawnLocation
fb973486c SPIGOT-7570: PrepareItemCraftEvent#isRepair() always returns false
c9c24535e PR-1337: Add DragonBattle#setPreviouslyKilled
c8b4da803 SPIGOT-6921, PR-1330: Add methods to remove all enchantments on an ItemStack
95bc1c4f5 PR-1333: Add BlockData#copyTo
36e2f9ce1 PR-1329: Add method to get an offline player's location

Spigot Changes:
c198da22 SPIGOT-7563: Update to latest release of bungeecord-chat
2024-01-26 20:19:17 +01:00

51 Zeilen
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: FireInstall <kettnerl@hu-berlin.de>
Date: Sat, 20 Jan 2024 16:20:06 +0100
Subject: [PATCH] Expose LootTable of DecoratedPot
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java b/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java
index d595495943bd94a86aa32a6510e46a7ea5c8a723..e2fe5d8d7d8c00ed5d21cfe409933cdde8932e97 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java
@@ -40,6 +40,39 @@ public class CraftDecoratedPot extends CraftBlockEntityState<DecoratedPotBlockEn
return new CraftInventoryDecoratedPot(this.getTileEntity());
}
+ // Paper start - expose loot table
+ @Override
+ public void setLootTable(final org.bukkit.loot.LootTable table) {
+ this.setLootTable(table, this.getSeed());
+ }
+
+ @Override
+ public void setLootTable(org.bukkit.loot.LootTable table, long seed) {
+ net.minecraft.resources.ResourceLocation key = (table == null) ? null : org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(table.getKey());
+ this.getSnapshot().setLootTable(key, seed);
+ }
+
+ @Override
+ public org.bukkit.loot.LootTable getLootTable() {
+ if (this.getSnapshot().getLootTable() == null) {
+ return null;
+ }
+
+ net.minecraft.resources.ResourceLocation key = this.getSnapshot().getLootTable();
+ return org.bukkit.Bukkit.getLootTable(org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(key));
+ }
+
+ @Override
+ public void setSeed(final long seed) {
+ this.getSnapshot().setLootTableSeed(seed);
+ }
+
+ @Override
+ public long getSeed() {
+ return this.getSnapshot().getLootTableSeed();
+ }
+ // Paper end - expose loot table
+
@Override
public void setSherd(Side face, Material sherd) {
Preconditions.checkArgument(face != null, "face must not be null");