2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockChest.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockChest.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -88,24 +88,7 @@
|
2019-12-10 23:00:00 +01:00
|
|
|
public Optional<ITileInventory> a(final TileEntityChest tileentitychest, final TileEntityChest tileentitychest1) {
|
2019-04-25 05:57:18 +02:00
|
|
|
final InventoryLargeChest inventorylargechest = new InventoryLargeChest(tileentitychest, tileentitychest1);
|
|
|
|
|
2019-12-10 23:00:00 +01:00
|
|
|
- return Optional.of(new ITileInventory() {
|
2019-04-25 05:57:18 +02:00
|
|
|
- @Nullable
|
|
|
|
- @Override
|
|
|
|
- public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {
|
2021-06-11 07:00:00 +02:00
|
|
|
- if (tileentitychest.d(entityhuman) && tileentitychest1.d(entityhuman)) {
|
|
|
|
- tileentitychest.e(playerinventory.player);
|
|
|
|
- tileentitychest1.e(playerinventory.player);
|
|
|
|
- return ContainerChest.b(i, playerinventory, (IInventory) inventorylargechest);
|
2019-04-25 05:57:18 +02:00
|
|
|
- } else {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public IChatBaseComponent getScoreboardDisplayName() {
|
2020-06-25 02:00:00 +02:00
|
|
|
- return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getScoreboardDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getScoreboardDisplayName() : new ChatMessage("container.chestDouble")));
|
2019-04-25 05:57:18 +02:00
|
|
|
- }
|
2019-12-10 23:00:00 +01:00
|
|
|
- });
|
|
|
|
+ return Optional.of(new DoubleInventory(tileentitychest, tileentitychest1, inventorylargechest)); // CraftBukkit
|
2019-04-25 05:57:18 +02:00
|
|
|
}
|
|
|
|
|
2019-12-10 23:00:00 +01:00
|
|
|
public Optional<ITileInventory> a(TileEntityChest tileentitychest) {
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -118,6 +101,38 @@
|
2019-04-25 05:57:18 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ public static class DoubleInventory implements ITileInventory {
|
|
|
|
+
|
|
|
|
+ private final TileEntityChest tileentitychest;
|
|
|
|
+ private final TileEntityChest tileentitychest1;
|
|
|
|
+ public final InventoryLargeChest inventorylargechest;
|
|
|
|
+
|
|
|
|
+ public DoubleInventory(TileEntityChest tileentitychest, TileEntityChest tileentitychest1, InventoryLargeChest inventorylargechest) {
|
|
|
|
+ this.tileentitychest = tileentitychest;
|
|
|
|
+ this.tileentitychest1 = tileentitychest1;
|
|
|
|
+ this.inventorylargechest = inventorylargechest;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Nullable
|
|
|
|
+ @Override
|
|
|
|
+ public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ if (tileentitychest.d(entityhuman) && tileentitychest1.d(entityhuman)) {
|
|
|
|
+ tileentitychest.e(playerinventory.player);
|
|
|
|
+ tileentitychest1.e(playerinventory.player);
|
|
|
|
+ return ContainerChest.b(i, playerinventory, (IInventory) inventorylargechest);
|
2019-04-25 05:57:18 +02:00
|
|
|
+ } else {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public IChatBaseComponent getScoreboardDisplayName() {
|
2020-06-25 02:00:00 +02:00
|
|
|
+ return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getScoreboardDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getScoreboardDisplayName() : new ChatMessage("container.chestDouble")));
|
2019-04-25 05:57:18 +02:00
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
2020-06-25 02:00:00 +02:00
|
|
|
protected BlockChest(BlockBase.Info blockbase_info, Supplier<TileEntityTypes<? extends TileEntityChest>> supplier) {
|
|
|
|
super(blockbase_info, supplier);
|
2021-06-11 07:00:00 +02:00
|
|
|
this.k((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.stateDefinition.getBlockData()).set(BlockChest.FACING, EnumDirection.NORTH)).set(BlockChest.TYPE, BlockPropertyChestType.SINGLE)).set(BlockChest.WATERLOGGED, false));
|
|
|
|
@@ -276,7 +291,7 @@
|
2019-12-10 23:00:00 +01:00
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
@Override
|
2019-12-10 23:00:00 +01:00
|
|
|
public DoubleBlockFinder.Result<? extends TileEntityChest> a(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) {
|
|
|
|
- BiPredicate bipredicate;
|
|
|
|
+ BiPredicate<GeneratorAccess, BlockPosition> bipredicate; // CraftBukkit - decompile error
|
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
bipredicate = (generatoraccess, blockposition1) -> {
|