Skip to content

Commit e5c83b6

Browse files
committed
Ghost-chu#1510 Extend ability to allow user change the owner name display in chat and sign
1 parent 9bf3560 commit e5c83b6

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.maxgamer.quickshop.event;
2+
3+
import lombok.AllArgsConstructor;
4+
import lombok.Data;
5+
import org.maxgamer.quickshop.shop.Shop;
6+
7+
import java.util.UUID;
8+
@AllArgsConstructor
9+
@Data
10+
public class ShopOwnerNameGettingEvent extends AbstractQSEvent{
11+
private Shop shop;
12+
private UUID owner;
13+
private String name;
14+
}

src/main/java/org/maxgamer/quickshop/shop/ContainerShop.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,12 +579,12 @@ public void onUnload() {
579579
if (name == null || name.isEmpty()) {
580580
name = plugin.text().of("unknown-owner").forLocale();
581581
}
582-
if (forceUsername) {
583-
return name;
584-
}
585-
if (isUnlimited()) {
586-
return plugin.text().of("admin-shop").forLocale();
582+
if(!forceUsername && isUnlimited()) {
583+
name = plugin.text().of("admin-shop").forLocale();
587584
}
585+
ShopOwnerNameGettingEvent event = new ShopOwnerNameGettingEvent(this,getOwner(),name);
586+
event.callEvent();
587+
name = event.getName();
588588
return name;
589589
}
590590

0 commit comments

Comments
 (0)