Skip to content

Commit

Permalink
fix: Empty item
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinhong11 committed Jan 19, 2025
1 parent 14a66a8 commit e536aac
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ public class SimpleDrawer extends SlimefunItem implements NotHopperable {
private final NamespacedKey COUNT_ENTITY = new NamespacedKey(BetterChests.INSTANCE, "drawer_item_count_entity");
private final NamespacedKey FACING = new NamespacedKey(BetterChests.INSTANCE, "drawer_facing");

private static final ItemStack EMPTY = new ItemStack(Material.BARRIER);

private final Map<Location, EntityContainer> entities = new HashMap<>();
/**
* Get the capacity of the drawer.
*/
@Getter
private final long capacity;

static {
EMPTY.editMeta(m -> m.displayName(Component.text("Empty")));
}

public SimpleDrawer(SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, long capacity) {
super(BCGroups.STORAGES, item, recipeType, recipe);

Expand Down Expand Up @@ -152,7 +158,7 @@ public void onPlayerPlace(@NotNull BlockPlaceEvent e) {

if (count - toTake == 0) {
container.itemName.text(Component.text("Empty"));
container.item.setItemStack(new ItemStack(Material.BARRIER));
container.item.setItemStack(EMPTY);
}

pinv.addItem(beingGet);
Expand Down

0 comments on commit e536aac

Please sign in to comment.