Add ShulkerBoxes to the LootTable API

This commit is contained in:
Zach Brown 2016-11-19 11:31:01 -06:00
parent 26e4ac4330
commit cb66c8dce7
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76
2 changed files with 51 additions and 2 deletions

View file

@ -1,4 +1,4 @@
From ca84cb2143adcd3dbbb2f3143e9088add4e2ee28 Mon Sep 17 00:00:00 2001 From acf9054a24ff96c9fa7c238b7679cbe3316d8a42 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sun, 1 May 2016 15:19:49 -0400 Date: Sun, 1 May 2016 15:19:49 -0400
Subject: [PATCH] LootTable API Subject: [PATCH] LootTable API
@ -352,6 +352,26 @@ index 8e5e3e8..c08a1a5 100644
+public interface Hopper extends BlockState, InventoryHolder, Lockable, Nameable, LootableInventory { // Paper +public interface Hopper extends BlockState, InventoryHolder, Lockable, Nameable, LootableInventory { // Paper
+ +
+} +}
diff --git a/src/main/java/org/bukkit/block/ShulkerBox.java b/src/main/java/org/bukkit/block/ShulkerBox.java
index 003cfb8..7b40df1 100644
--- a/src/main/java/org/bukkit/block/ShulkerBox.java
+++ b/src/main/java/org/bukkit/block/ShulkerBox.java
@@ -1,5 +1,6 @@
package org.bukkit.block;
+import com.destroystokyo.paper.loottable.LootableInventory;
import org.bukkit.DyeColor;
import org.bukkit.Nameable;
import org.bukkit.inventory.InventoryHolder;
@@ -7,7 +8,7 @@ import org.bukkit.inventory.InventoryHolder;
/**
* Represents a ShulkerBox.
*/
-public interface ShulkerBox extends BlockState, InventoryHolder, Lockable, Nameable {
+public interface ShulkerBox extends BlockState, InventoryHolder, Lockable, Nameable, LootableInventory { // Paper
/**
* Get the {@link DyeColor} corresponding to this ShulkerBox
-- --
2.10.2 2.10.2

View file

@ -1,4 +1,4 @@
From 0e03fc3328c07b66787473c4d9bd922264a973a3 Mon Sep 17 00:00:00 2001 From 8712e9ac088ad974d4eea2c12880912523da7af5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sun, 1 May 2016 21:19:14 -0400 Date: Sun, 1 May 2016 21:19:14 -0400
Subject: [PATCH] LootTable API & Replenishable Lootables Feature Subject: [PATCH] LootTable API & Replenishable Lootables Feature
@ -712,6 +712,35 @@ index b7a04bd..5d4a551 100644
private final TileEntityHopper hopper; private final TileEntityHopper hopper;
public CraftHopper(final Block block) { public CraftHopper(final Block block) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
index 8a7ce92..02f56bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
@@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.block;
+import com.destroystokyo.paper.loottable.CraftLootableBlockInventory;
import net.minecraft.server.BlockShulkerBox;
import net.minecraft.server.TileEntity;
import net.minecraft.server.TileEntityShulkerBox;
@@ -11,7 +12,7 @@ import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.inventory.Inventory;
-public class CraftShulkerBox extends CraftLootable implements ShulkerBox {
+public class CraftShulkerBox extends CraftLootable implements ShulkerBox, CraftLootableBlockInventory { // Paper
private final CraftWorld world;
private final TileEntityShulkerBox box;
@@ -31,7 +32,7 @@ public class CraftShulkerBox extends CraftLootable implements ShulkerBox {
}
@Override
- public TileEntity getTileEntity() {
+ public TileEntityShulkerBox getTileEntity() { // Paper
return box;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java
index 69435c4..4291edf 100644 index 69435c4..4291edf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java