File tree Expand file tree Collapse file tree 4 files changed +30
-5
lines changed
src/main/java/org/maxgamer/quickshop Expand file tree Collapse file tree 4 files changed +30
-5
lines changed Original file line number Diff line number Diff line change 1919
2020package org .maxgamer .quickshop .event ;
2121
22+ import org .bukkit .Bukkit ;
2223import org .bukkit .event .Cancellable ;
2324import org .bukkit .event .Event ;
2425import org .bukkit .event .HandlerList ;
@@ -30,7 +31,7 @@ public abstract class AbstractQSEvent extends Event {
3031 private static final HandlerList HANDLERS = new HandlerList ();
3132
3233 public AbstractQSEvent () {
33-
34+ super (! Bukkit . isPrimaryThread ());
3435 }
3536
3637 public AbstractQSEvent (boolean async ) {
Original file line number Diff line number Diff line change 22
33import lombok .AllArgsConstructor ;
44import lombok .Data ;
5+ import lombok .EqualsAndHashCode ;
56import org .maxgamer .quickshop .shop .Shop ;
67
78import java .util .UUID ;
89
10+ @ EqualsAndHashCode (callSuper = true )
911@ AllArgsConstructor
1012@ Data
1113public class ShopOwnerNameGettingEvent extends AbstractQSEvent {
Original file line number Diff line number Diff line change 1+ package org .maxgamer .quickshop .event ;
2+
3+ import lombok .AllArgsConstructor ;
4+ import lombok .Data ;
5+ import lombok .EqualsAndHashCode ;
6+ import org .jetbrains .annotations .Nullable ;
7+ import org .maxgamer .quickshop .shop .Shop ;
8+
9+ import java .util .UUID ;
10+ @ EqualsAndHashCode (callSuper = true )
11+ @ AllArgsConstructor
12+ @ Data
13+ public class ShopTaxAccountGettingEvent extends AbstractQSEvent {
14+ @ Nullable
15+ private UUID taxAccount ;
16+ private final Shop shop ;
17+ }
Original file line number Diff line number Diff line change @@ -225,12 +225,17 @@ public void setDisableDisplay(boolean disabled) {
225225 @ Override
226226 @ Nullable
227227 public UUID getTaxAccount () {
228+ UUID uuid = null ;
228229 if (taxAccount != null ) {
229- return taxAccount ;
230- }
231- if (plugin .getShopManager ().getCacheTaxAccount () != null ) {
232- return plugin .getShopManager ().getCacheTaxAccount ().getUniqueId ();
230+ uuid = taxAccount ;
231+ }else {
232+ if (plugin .getShopManager ().getCacheTaxAccount () != null ) {
233+ uuid = plugin .getShopManager ().getCacheTaxAccount ().getUniqueId ();
234+ }
233235 }
236+ ShopTaxAccountGettingEvent event = new ShopTaxAccountGettingEvent (uuid ,this );
237+ event .callEvent ();
238+ uuid = event .getTaxAccount ();
234239 return null ;
235240
236241 }
You can’t perform that action at this time.
0 commit comments