Skip to content

Commit 2d7f5ea

Browse files
committed
add shelf inventory type
1 parent 5e42ae9 commit 2d7f5ea

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

paper-api/src/main/java/org/bukkit/event/inventory/InventoryType.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ public enum InventoryType {
143143
* Pseudo chiseled bookshelf inventory, with 6 slots of undefined type.
144144
*/
145145
CHISELED_BOOKSHELF(6, "Chiseled Bookshelf", null, false),
146+
/**
147+
* Pseudo shelf inventory, with 3 slots of undefined type.
148+
*/
149+
SHELF(3, "Shelf", null, false),
146150
/**
147151
* Pseudo jukebox inventory with 1 slot of undefined type.
148152
*/

paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import net.minecraft.world.level.block.entity.Hopper;
2121
import net.minecraft.world.level.block.entity.JukeboxBlockEntity;
2222
import net.minecraft.world.level.block.entity.LecternBlockEntity;
23+
import net.minecraft.world.level.block.entity.ShelfBlockEntity;
2324
import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity;
2425
import net.minecraft.world.level.block.entity.SmokerBlockEntity;
2526
import org.bukkit.Location;
@@ -517,6 +518,8 @@ public InventoryType getType() {
517518
return InventoryType.LECTERN;
518519
} else if (this.inventory instanceof ChiseledBookShelfBlockEntity) {
519520
return InventoryType.CHISELED_BOOKSHELF;
521+
} else if (this.inventory instanceof ShelfBlockEntity) {
522+
return InventoryType.SHELF;
520523
} else if (this instanceof CraftInventoryLoom) {
521524
return InventoryType.LOOM;
522525
} else if (this instanceof CraftInventoryCartography) {

0 commit comments

Comments
 (0)