From c3ee6061dcbf0ede0463a9e818336c71318afe17 Mon Sep 17 00:00:00 2001 From: Chai <7232280+Chailotl@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:31:15 -0400 Subject: [PATCH] Fix #40 --- .../block/entity/ItemDisplayBlockEntity.java | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/main/java/dev/hephaestus/glowcase/block/entity/ItemDisplayBlockEntity.java b/src/main/java/dev/hephaestus/glowcase/block/entity/ItemDisplayBlockEntity.java index 664bd25..f8fb5d1 100644 --- a/src/main/java/dev/hephaestus/glowcase/block/entity/ItemDisplayBlockEntity.java +++ b/src/main/java/dev/hephaestus/glowcase/block/entity/ItemDisplayBlockEntity.java @@ -5,6 +5,7 @@ import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import net.minecraft.item.SpawnEggItem; import net.minecraft.nbt.NbtCompound; @@ -27,7 +28,7 @@ import java.util.Set; import java.util.UUID; -public class ItemDisplayBlockEntity extends BlockEntity { +public class ItemDisplayBlockEntity extends BlockEntity implements Inventory { private ItemStack stack = ItemStack.EMPTY; private Entity displayEntity = null; @@ -238,6 +239,44 @@ public enum Offset { CENTER, BACK, FRONT } + // hopper extraction + + @Override + public int size() { + return 1; + } + + @Override + public boolean isEmpty() { + return stack.isEmpty(); + } + + @Override + public ItemStack getStack(int slot) { + return stack.copyWithCount(1); + } + + @Override + public ItemStack removeStack(int slot, int amount) { + return stack.copyWithCount(1); + } + + @Override + public ItemStack removeStack(int slot) { + return stack.copyWithCount(1); + } + + @Override + public void setStack(int slot, ItemStack stack) {} + + @Override + public boolean canPlayerUse(PlayerEntity player) { + return false; + } + + @Override + public void clear() {} + // standard blockentity boilerplate public void dispatch() {