Allow For Default Titles in InventoryView Builders (#12013)

This commit is contained in:
Miles
2025-02-16 22:07:00 +00:00
committed by GitHub
parent 84609dc046
commit 8eb8e44ac3
18 changed files with 201 additions and 70 deletions

View File

@@ -9,8 +9,12 @@
@Nullable
@Override
public AbstractContainerMenu createMenu(int containerId, Inventory playerInventory, Player player) {
@@ -106,7 +_,7 @@
return (Component)(second.hasCustomName() ? second.getDisplayName() : Component.translatable("container.chestDouble"));
@@ -103,10 +_,10 @@
if (first.hasCustomName()) {
return first.getDisplayName();
} else {
- return (Component)(second.hasCustomName() ? second.getDisplayName() : Component.translatable("container.chestDouble"));
+ return (Component)(second.hasCustomName() ? second.getDisplayName() : Component.translatable("container.chestDouble")); // Paper - diff on change - CraftDoubleChestInventoryViewBuilder.defaultTitle
}
}
- });

View File

@@ -37,3 +37,12 @@
protected ChestBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState blockState) {
super(type, pos, blockState);
}
@@ -71,7 +_,7 @@
@Override
protected Component getDefaultName() {
- return Component.translatable("container.chest");
+ return Component.translatable("container.chest"); // Paper - diff on change - CraftStandardInventoryViewBuilder.defaultTitle
}
@Override