Skip to content

Commit 50243e6

Browse files
committed
Clean up events
1 parent c4b3f3e commit 50243e6

File tree

6 files changed

+112
-61
lines changed

6 files changed

+112
-61
lines changed

src/main/java/org/maxgamer/quickshop/QuickShop.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ public void run() {
949949
this.shopPurger = new ShopPurger(this, false);
950950
shopPurger.runTaskAsynchronously(this);
951951
Util.debugLog("Now using display-type: " + AbstractDisplayItem.getNowUsing().name());
952-
getLogger().info("QuickShop Loaded! " + enableTimer.stopAndGetTimePassed() + " ms.");c
952+
getLogger().info("QuickShop Loaded! " + enableTimer.stopAndGetTimePassed() + " ms.");
953953
}
954954

955955
private void loadItemMatcher() {
@@ -1053,8 +1053,6 @@ private void submitMeritcs() {
10531053
metrics.addCustomChart(new Metrics.SimplePie("chat_adapter", () -> "Hardcoded Adventure"));
10541054
metrics.addCustomChart(new Metrics.SimplePie("event_adapter", () -> eventAdapter));
10551055
metrics.addCustomChart(new Metrics.SingleLineChart("shops_created_on_all_servers", () -> this.getShopManager().getAllShops().size()));
1056-
// Exp for stats, maybe i need improve this, so i add this.// Submit now!
1057-
getLogger().info("Metrics submitted.");
10581056
} else {
10591057
getLogger().info("You have disabled mertics, Skipping...");
10601058
}

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Backup.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/main/java/org/maxgamer/quickshop/event/QSHandleChatEvent.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,30 @@
99
@AllArgsConstructor
1010
@Data
1111
public class QSHandleChatEvent extends AbstractQSEvent{
12-
private Player sender;
12+
private final Player sender;
1313
private String message;
14+
15+
/**
16+
* Getting the chat sender
17+
* @return The chat sender
18+
*/
19+
public Player getSender() {
20+
return sender;
21+
}
22+
23+
/**
24+
* Getting the player chat content
25+
* @return The chat content
26+
*/
27+
public String getMessage() {
28+
return message;
29+
}
30+
31+
/**
32+
* Sets the new player chat content that pass to the QuickShop
33+
* @param message The new chat content
34+
*/
35+
public void setMessage(String message) {
36+
this.message = message;
37+
}
1438
}

src/main/java/org/maxgamer/quickshop/event/ShopInventoryCalculate.java

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,31 @@
99
@Data
1010
@AllArgsConstructor
1111
public class ShopInventoryCalculate extends AbstractQSEvent {
12-
private Shop shop;
13-
private int space;
14-
private int stock;
12+
private final Shop shop;
13+
private final int space;
14+
private final int stock;
15+
16+
/**
17+
* Gets the shop that inventory has been calculated
18+
* @return The shop
19+
*/
20+
public Shop getShop() {
21+
return shop;
22+
}
23+
24+
/**
25+
* Getting the inventory space
26+
* @return The inventory space (-1 if not get calculated)
27+
*/
28+
public int getSpace() {
29+
return space;
30+
}
31+
32+
/**
33+
* Getting the inventory stock
34+
* @return The inventory stock (-1 if not get calculated)
35+
*/
36+
public int getStock() {
37+
return stock;
38+
}
1539
}
Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,45 @@
11
package org.maxgamer.quickshop.event;
22

33
import lombok.AllArgsConstructor;
4-
import lombok.Data;
5-
import lombok.EqualsAndHashCode;
64
import org.maxgamer.quickshop.shop.Shop;
75

86
import java.util.UUID;
97

10-
@EqualsAndHashCode(callSuper = true)
118
@AllArgsConstructor
12-
@Data
139
public class ShopOwnerNameGettingEvent extends AbstractQSEvent {
14-
private Shop shop;
15-
private UUID owner;
10+
private final Shop shop;
11+
private final UUID owner;
1612
private String name;
13+
14+
/**
15+
* Getting the shop that trying getting the shop owner name
16+
* @return The shop
17+
*/
18+
public Shop getShop() {
19+
return shop;
20+
}
21+
22+
/**
23+
* Getting the shop owner unique id
24+
* @return The shop owner unique id
25+
*/
26+
public UUID getOwner() {
27+
return owner;
28+
}
29+
30+
/**
31+
* Getting the shop owner display name
32+
* @return The shop owner display name
33+
*/
34+
public String getName() {
35+
return name;
36+
}
37+
38+
/**
39+
* Sets the shop owner display name
40+
* @param name New shop owner display name, just display, won't change actual shop owner
41+
*/
42+
public void setName(String name) {
43+
this.name = name;
44+
}
1745
}
Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
11
package org.maxgamer.quickshop.event;
22

33
import lombok.AllArgsConstructor;
4-
import lombok.Data;
5-
import lombok.EqualsAndHashCode;
64
import org.jetbrains.annotations.Nullable;
75
import org.maxgamer.quickshop.shop.Shop;
86

97
import java.util.UUID;
10-
@EqualsAndHashCode(callSuper = true)
118
@AllArgsConstructor
12-
@Data
139
public class ShopTaxAccountGettingEvent extends AbstractQSEvent{
1410
@Nullable
1511
private UUID taxAccount;
1612
private final Shop shop;
13+
14+
/**
15+
* Getting the tax account
16+
* @return The tax account, null if tax has been disabled
17+
*/
18+
@Nullable
19+
public UUID getTaxAccount() {
20+
return taxAccount;
21+
}
22+
23+
/**
24+
* Sets the tax account
25+
* @param taxAccount The tax account
26+
*/
27+
public void setTaxAccount(@Nullable UUID taxAccount) {
28+
this.taxAccount = taxAccount;
29+
}
30+
31+
/**
32+
* Gets the shop
33+
* @return The shop
34+
*/
35+
public Shop getShop() {
36+
return shop;
37+
}
1738
}

0 commit comments

Comments
 (0)