SPIGOT-6760: Chest#getInventory only returns one half of a double chest when one or both halves are blocked

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-10-16 18:48:21 +11:00
parent 02cdd23003
commit 55f4d6c7cb
2 changed files with 17 additions and 2 deletions

View File

@@ -74,3 +74,19 @@
if (flag) {
bipredicate = (generatoraccess, blockposition1) -> {
@@ -292,7 +307,14 @@
@Nullable
@Override
public ITileInventory getInventory(IBlockData iblockdata, World world, BlockPosition blockposition) {
- return (ITileInventory) ((Optional) this.a(iblockdata, world, blockposition, false).apply(BlockChest.MENU_PROVIDER_COMBINER)).orElse((Object) null);
+ // CraftBukkit start
+ return getInventory(iblockdata, world, blockposition, false);
+ }
+
+ @Nullable
+ public ITileInventory getInventory(IBlockData iblockdata, World world, BlockPosition blockposition, boolean ignoreObstructions) {
+ return (ITileInventory) ((Optional) this.a(iblockdata, world, blockposition, ignoreObstructions).apply(BlockChest.MENU_PROVIDER_COMBINER)).orElse((Object) null);
+ // CraftBukkit end
}
public static DoubleBlockFinder.Combiner<TileEntityChest, Float2FloatFunction> a(final LidBlockEntity lidblockentity) {