mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 06:01:39 +01:00
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:
parent
02cdd23003
commit
55f4d6c7cb
@ -74,3 +74,19 @@
|
|||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
bipredicate = (generatoraccess, blockposition1) -> {
|
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) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.bukkit.craftbukkit.block;
|
package org.bukkit.craftbukkit.block;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import net.minecraft.sounds.SoundEffects;
|
import net.minecraft.sounds.SoundEffects;
|
||||||
import net.minecraft.world.ITileInventory;
|
import net.minecraft.world.ITileInventory;
|
||||||
import net.minecraft.world.level.block.BlockChest;
|
import net.minecraft.world.level.block.BlockChest;
|
||||||
@ -46,7 +45,7 @@ public class CraftChest extends CraftLootable<TileEntityChest> implements Chest
|
|||||||
CraftWorld world = (CraftWorld) this.getWorld();
|
CraftWorld world = (CraftWorld) this.getWorld();
|
||||||
|
|
||||||
BlockChest blockChest = (BlockChest) (this.getType() == Material.CHEST ? Blocks.CHEST : Blocks.TRAPPED_CHEST);
|
BlockChest blockChest = (BlockChest) (this.getType() == Material.CHEST ? Blocks.CHEST : Blocks.TRAPPED_CHEST);
|
||||||
ITileInventory nms = blockChest.getInventory(data, world.getHandle(), this.getPosition());
|
ITileInventory nms = blockChest.getInventory(data, world.getHandle(), this.getPosition(), true);
|
||||||
|
|
||||||
if (nms instanceof BlockChest.DoubleInventory) {
|
if (nms instanceof BlockChest.DoubleInventory) {
|
||||||
inventory = new CraftInventoryDoubleChest((BlockChest.DoubleInventory) nms);
|
inventory = new CraftInventoryDoubleChest((BlockChest.DoubleInventory) nms);
|
||||||
|
Loading…
Reference in New Issue
Block a user