Skip to content

Commit 501834e

Browse files
Fix custom inventory holders (#6199)
1 parent db81163 commit 501834e

File tree

4 files changed

+340
-38
lines changed

4 files changed

+340
-38
lines changed

build-data/paper.at

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,7 @@ public-f net.minecraft.world.level.chunk.ChunkGenerator strongholdSeed
311311

312312
# More Sculk Sensor API
313313
public-f net.minecraft.world.level.gameevent.vibrations.VibrationListener listenerRange
314+
315+
# Fix custom inventory holders
316+
public-f net.minecraft.world.inventory.AbstractContainerMenu dataSlots
317+
public-f net.minecraft.world.inventory.AbstractContainerMenu remoteDataSlots

patches/server/0012-Adventure.patch

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,28 +3269,23 @@ index ed4415f6dd588c08c922efd5beebb3b124beb9d6..78a7ac47f20e84ccd67ff44d0bc7a2f2
32693269
return new CraftInventoryCustom(owner, size, title);
32703270
}
32713271
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java
3272-
index 4e705b7367b78c2da98d0b174807ecbce75f3a59..0899afd175f969da0df9371d96d3b5e1de4c8533 100644
3272+
index 4e705b7367b78c2da98d0b174807ecbce75f3a59..4972ce5d876d74e04a4fbfeb860f1d44e25b3470 100644
32733273
--- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java
32743274
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java
3275-
@@ -43,6 +43,17 @@ public final class CraftInventoryCreator {
3275+
@@ -43,6 +43,12 @@ public final class CraftInventoryCreator {
32763276
return this.converterMap.get(type).createInventory(holder, type);
32773277
}
32783278

32793279
+ // Paper start
32803280
+ public Inventory createInventory(InventoryHolder holder, InventoryType type, net.kyori.adventure.text.Component title) {
3281-
+ // Paper start
3282-
+ if (holder != null) {
3283-
+ return DEFAULT_CONVERTER.createInventory(holder, type, title);
3284-
+ }
3285-
+ //noinspection ConstantConditions // Paper end
32863281
+ return converterMap.get(type).createInventory(holder, type, title);
32873282
+ }
32883283
+ // Paper end
32893284
+
32903285
public Inventory createInventory(InventoryHolder holder, InventoryType type, String title) {
32913286
return this.converterMap.get(type).createInventory(holder, type, title);
32923287
}
3293-
@@ -51,6 +62,12 @@ public final class CraftInventoryCreator {
3288+
@@ -51,6 +57,12 @@ public final class CraftInventoryCreator {
32943289
return this.DEFAULT_CONVERTER.createInventory(holder, size);
32953290
}
32963291

@@ -3303,7 +3298,7 @@ index 4e705b7367b78c2da98d0b174807ecbce75f3a59..0899afd175f969da0df9371d96d3b5e1
33033298
public Inventory createInventory(InventoryHolder holder, int size, String title) {
33043299
return this.DEFAULT_CONVERTER.createInventory(holder, size, title);
33053300
}
3306-
@@ -59,6 +76,10 @@ public final class CraftInventoryCreator {
3301+
@@ -59,6 +71,10 @@ public final class CraftInventoryCreator {
33073302

33083303
Inventory createInventory(InventoryHolder holder, InventoryType type);
33093304

0 commit comments

Comments
 (0)