Remove shop on trait remove

This commit is contained in:
fullwall 2022-12-06 22:54:27 +08:00
parent 97c2417c49
commit 6533cdccf8

View File

@ -85,6 +85,11 @@ public class ShopTrait extends Trait {
return shops.globalShops.computeIfAbsent(name, (s) -> new NPCShop(s));
}
@Override
public void onRemove() {
deleteShop(npc.getUniqueId().toString());
}
public void onRightClick(Player player) {
if (rightClickShop == null)
return;
@ -608,6 +613,7 @@ public class ShopTrait extends Trait {
item.onClick(shop, evt);
});
}
InventoryMenuSlot prev = ctx.getSlot(4 * 9 + 3);
InventoryMenuSlot next = ctx.getSlot(4 * 9 + 5);
prev.clear();