67 lines
2.0 KiB
Diff
67 lines
2.0 KiB
Diff
--- a/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
|
@@ -17,12 +17,54 @@
|
|
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
|
|
import org.slf4j.Logger;
|
|
|
|
+// CraftBukkit start
|
|
+import java.util.List;
|
|
+import org.bukkit.Location;
|
|
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
|
+import org.bukkit.entity.HumanEntity;
|
|
+// CraftBukkit end
|
|
+
|
|
public class ChiseledBookShelfBlockEntity extends TileEntity implements IInventory {
|
|
|
|
public static final int MAX_BOOKS_IN_STORAGE = 6;
|
|
private static final Logger LOGGER = LogUtils.getLogger();
|
|
private final NonNullList<ItemStack> items;
|
|
public int lastInteractedSlot;
|
|
+ // CraftBukkit start - add fields and methods
|
|
+ public List<HumanEntity> transaction = new java.util.ArrayList<>();
|
|
+ private int maxStack = 1;
|
|
+
|
|
+ @Override
|
|
+ public List<ItemStack> getContents() {
|
|
+ return this.items;
|
|
+ }
|
|
+
|
|
+ @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 void setMaxStackSize(int size) {
|
|
+ maxStack = size;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public Location getLocation() {
|
|
+ if (level == null) return null;
|
|
+ return new org.bukkit.Location(level.getWorld(), worldPosition.getX(), worldPosition.getY(), worldPosition.getZ());
|
|
+ }
|
|
+ // CraftBukkit end
|
|
|
|
public ChiseledBookShelfBlockEntity(BlockPosition blockposition, IBlockData iblockdata) {
|
|
super(TileEntityTypes.CHISELED_BOOKSHELF, blockposition, iblockdata);
|
|
@@ -113,7 +155,7 @@
|
|
|
|
@Override
|
|
public int getMaxStackSize() {
|
|
- return 1;
|
|
+ return maxStack; // CraftBukkit
|
|
}
|
|
|
|
@Override
|