aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/ChestBlock.java.patch
diff options
context:
space:
mode:
authorMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
committerMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
commitbee74680e607c2e29b038329f62181238911cd83 (patch)
tree708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/ChestBlock.java.patch
parent0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff)
downloadPaper-softspoon.tar.gz
Paper-softspoon.zip
add remapped patches as a testsoftspoon
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/ChestBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/ChestBlock.java.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/ChestBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/ChestBlock.java.patch
new file mode 100644
index 0000000000..7682147213
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/ChestBlock.java.patch
@@ -0,0 +1,71 @@
+--- a/net/minecraft/world/level/block/ChestBlock.java
++++ b/net/minecraft/world/level/block/ChestBlock.java
+@@ -92,24 +89,23 @@
+ return Optional.empty();
+ }
+ };
+- private static final DoubleBlockCombiner.Combiner<ChestBlockEntity, Optional<MenuProvider>> MENU_PROVIDER_COMBINER = new DoubleBlockCombiner.Combiner<ChestBlockEntity, Optional<MenuProvider>>() {
++ private static final DoubleBlockCombiner.Combiner<ChestBlockEntity, Optional<ITileInventory>> MENU_PROVIDER_COMBINER = new DoubleBlockCombiner.Combiner<ChestBlockEntity, Optional<ITileInventory>>() {
++ public Optional<ITileInventory> acceptDouble(final ChestBlockEntity tileentitychest, final ChestBlockEntity tileentitychest1) {
++ final CompoundContainer inventorylargechest = new CompoundContainer(tileentitychest, tileentitychest1);
++
++ return Optional.of(new DoubleInventory(tileentitychest, tileentitychest1, inventorylargechest)); // CraftBukkit
++ }
++
++ public Optional<ITileInventory> acceptSingle(ChestBlockEntity tileentitychest) {
++ return Optional.of(tileentitychest);
++ }
++
+ @Override
+ public Optional<MenuProvider> acceptDouble(final ChestBlockEntity chestblockentity, final ChestBlockEntity chestblockentity1) {
+ final CompoundContainer compoundcontainer = new CompoundContainer(chestblockentity, chestblockentity1);
+
+- return Optional.of(new MenuProvider() {
+- @Nullable
+- @Override
+- @Override
+- public AbstractContainerMenu createMenu(int i, Inventory inventory, Player player) {
+- if (chestblockentity.canOpen(player) && chestblockentity1.canOpen(player)) {
+- chestblockentity.unpackLootTable(inventory.player);
+- chestblockentity1.unpackLootTable(inventory.player);
+- return ChestMenu.sixRows(i, inventory, compoundcontainer);
+- } else {
+- return null;
+- }
+- }
++ // CraftBukkit start
++ public static class DoubleInventory implements ITileInventory {
+
+ @Override
+ @Override
+@@ -130,6 +136,7 @@
+ return Optional.empty();
+ }
+ };
++ // CraftBukkit end
+
+ @Override
+ @Override
+@@ -311,12 +308,18 @@
+
+ @Nullable
+ @Override
+- @Override
+- public MenuProvider getMenuProvider(BlockState blockstate, Level level, BlockPos blockpos) {
+- return (MenuProvider) ((Optional) this.combine(blockstate, level, blockpos, false).apply(ChestBlock.MENU_PROVIDER_COMBINER)).orElse((Object) null);
++ public ITileInventory getMenuProvider(IBlockData state, Level level, BlockPos pos) {
++ // CraftBukkit start
++ return getMenuProvider(state, level, pos, false);
+ }
+
+- public static DoubleBlockCombiner.Combiner<ChestBlockEntity, Float2FloatFunction> opennessCombiner(final LidBlockEntity lidblockentity) {
++ @Nullable
++ public ITileInventory getMenuProvider(IBlockData iblockdata, Level world, BlockPos blockposition, boolean ignoreObstructions) {
++ return (ITileInventory) ((Optional) this.combine(iblockdata, world, blockposition, ignoreObstructions).apply(ChestBlock.MENU_PROVIDER_COMBINER)).orElse((Object) null);
++ // CraftBukkit end
++ }
++
++ public static DoubleBlockCombiner.Combiner<ChestBlockEntity, Float2FloatFunction> opennessCombiner(final LidBlockEntity lid) {
+ return new DoubleBlockCombiner.Combiner<ChestBlockEntity, Float2FloatFunction>() {
+ @Override
+ public Float2FloatFunction acceptDouble(ChestBlockEntity chestblockentity, ChestBlockEntity chestblockentity1) {