Skip to content

Commit

Permalink
Fix empty merchant fails to properly set default title
Browse files Browse the repository at this point in the history
  • Loading branch information
Y2Kwastaken committed Feb 2, 2025
1 parent 73b39dc commit 9cc485e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.Merchant;
import org.bukkit.inventory.view.builder.MerchantInventoryViewBuilder;
import org.checkerframework.checker.units.qual.C;
import org.jspecify.annotations.Nullable;

public class CraftMerchantInventoryViewBuilder<V extends InventoryView> extends CraftAbstractInventoryViewBuilder<V> implements MerchantInventoryViewBuilder<V> {
Expand Down Expand Up @@ -52,7 +53,8 @@ public V build(final HumanEntity player) {

final MerchantMenu container;
if (this.merchant == null) {
container = new MerchantMenu(serverPlayer.nextContainerCounter(), serverPlayer.getInventory(), new CraftMerchantCustom(title).getMerchant());
this.merchant = this.title == null ? new CraftMerchantCustom().getMerchant() : new CraftMerchantCustom.MinecraftMerchant(title);
container = new MerchantMenu(serverPlayer.nextContainerCounter(), serverPlayer.getInventory(), this.merchant);
} else {
container = new MerchantMenu(serverPlayer.nextContainerCounter(), serverPlayer.getInventory(), this.merchant);
}
Expand Down

0 comments on commit 9cc485e

Please sign in to comment.