aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/ChestBoat.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/ChestBoat.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/ChestBoat.java.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/ChestBoat.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/ChestBoat.java.patch
new file mode 100644
index 0000000000..9d7239e776
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/ChestBoat.java.patch
@@ -0,0 +1,68 @@
+--- a/net/minecraft/world/entity/vehicle/ChestBoat.java
++++ b/net/minecraft/world/entity/vehicle/ChestBoat.java
+@@ -22,6 +23,13 @@
+ import net.minecraft.world.item.Items;
+ import net.minecraft.world.level.Level;
+ import net.minecraft.world.level.gameevent.GameEvent;
++// CraftBukkit start
++import java.util.List;
++import org.bukkit.Location;
++import org.bukkit.craftbukkit.entity.CraftHumanEntity;
++import org.bukkit.entity.HumanEntity;
++import org.bukkit.inventory.InventoryHolder;
++// CraftBukkit end
+
+ public class ChestBoat extends Boat implements HasCustomInventoryScreen, ContainerEntity {
+ private static final int CONTAINER_SIZE = 27;
+@@ -212,4 +245,51 @@
+ public void stopOpen(Player player) {
+ this.level().gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.Context.of(player));
+ }
++
++ // CraftBukkit start
++ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
++ private int maxStack = MAX_STACK;
++
++ @Override
++ public List<ItemStack> getContents() {
++ return this.itemStacks;
++ }
++
++ @Override
++ public void onOpen(CraftHumanEntity who) {
++ transaction.add(who);
++ }
++
++ @Override
++ public void onClose(CraftHumanEntity who) {
++ transaction.remove(who);
++ }
++
++ @Override
++ public List<HumanEntity> getViewers() {
++ return transaction;
++ }
++
++ @Override
++ public InventoryHolder getOwner() {
++ org.bukkit.entity.Entity entity = getBukkitEntity();
++ if (entity instanceof InventoryHolder) return (InventoryHolder) entity;
++ return null;
++ }
++
++ @Override
++ public int getMaxStackSize() {
++ return maxStack;
++ }
++
++ @Override
++ public void setMaxStackSize(int size) {
++ maxStack = size;
++ }
++
++ @Override
++ public Location getLocation() {
++ return getBukkitEntity().getLocation();
++ }
++ // CraftBukkit end
+ }