aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0928-Expose-LootTable-of-DecoratedPot.patch
blob: afa86977a9b445decf9eb58ebafd06c65d77d383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 6e0258d4d6a07e0f471640a9edda0adf7ef6cd9e..47cc3ec5ccd3bb51a08b3f179cb29030948b8c11 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java
@@ -43,6 +43,33 @@ 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) {
+        this.getSnapshot().setLootTable(org.bukkit.craftbukkit.CraftLootTable.bukkitToMinecraft(table), seed);
+    }
+
+    @Override
+    public org.bukkit.loot.LootTable getLootTable() {
+        return org.bukkit.craftbukkit.CraftLootTable.minecraftToBukkit(this.getSnapshot().getLootTable());
+    }
+
+    @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");