Skip to content

Commit

Permalink
Fix #40
Browse files Browse the repository at this point in the history
  • Loading branch information
Chailotl committed Oct 3, 2024
1 parent 492d5c8 commit c3ee606
Showing 1 changed file with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit c3ee606

Please sign in to comment.