@@ -26,30 +26,29 @@ public class BukkitDupeCommand implements CommandExecutor {
2626
2727 @ Override
2828 public void run (CommandSender commandSender , CommandArguments commandArguments ) throws WrapperCommandSyntaxException {
29- if (!(commandSender instanceof Player )) {
29+ if (!(commandSender instanceof Player player )) {
3030 commandSender .sendMessage (BukkitConfigyml .ConsoleMessage ());
3131 return ;
3232 }
33- Player player = (Player ) commandSender ;
3433 Audience p = getPlugin ().adventure ().player (player );
3534
3635 // Checks if permission is enabled or not.
3736 if (BukkitConfigyml .DupePermissionOption ()) {
3837 if (!(BukkitConfigyml .hasDupePermission (player ))) {
39- BukkitConfigyml .DupeNoPermission (player );
38+ BukkitConfigyml .DupeNoPermission (player , p );
4039 return ;
4140 }
4241 }
4342
4443 if (BukkitConfigyml .isWorldsEnabled ()) {
4544 if (BukkitConfigyml .getWorldsMode ().equals ("blacklist" )) {
4645 if (BukkitConfigyml .getWorlds ().contains (player .getWorld ().getName ())) {
47- BukkitConfigyml .WorldBlockedMessage (player );
46+ BukkitConfigyml .WorldBlockedMessage (player , p );
4847 return ;
4948 }
5049 } else if (BukkitConfigyml .getWorldsMode ().equals ("whitelist" )) {
5150 if (!BukkitConfigyml .getWorlds ().contains (player .getWorld ().getName ())) {
52- BukkitConfigyml .WorldBlockedMessage (player );
51+ BukkitConfigyml .WorldBlockedMessage (player , p );
5352 return ;
5453 }
5554 }
@@ -59,7 +58,7 @@ public void run(CommandSender commandSender, CommandArguments commandArguments)
5958
6059 // Send message if Dupe message isn't empty
6160 if (item .getType () == Material .AIR ) {
62- BukkitConfigyml .dupingnothingmessage (player );
61+ BukkitConfigyml .dupingnothingmessage (player , p );
6362 return ;
6463 }
6564
@@ -68,30 +67,30 @@ public void run(CommandSender commandSender, CommandArguments commandArguments)
6867 if (BukkitConfigyml .isblacklistEnabled ()) {
6968 // minecraft
7069 if (BukkitConfigyml .listedItems ().contains (item .getType ())) {
71- BukkitConfigyml .blockedmessage (player );
70+ BukkitConfigyml .blockedmessage (player , p );
7271 return ;
7372 }
7473 // itemsadder
7574 if (BukkitConfigyml .CustomBlacklistItems (item )) {
76- BukkitConfigyml .blockedmessage (player );
75+ BukkitConfigyml .blockedmessage (player , p );
7776 return ;
7877 }
7978 if (BukkitConfigyml .customBlacklistedNamespace (item )) {
80- BukkitConfigyml .blockedmessage (player );
79+ BukkitConfigyml .blockedmessage (player , p );
8180 return ;
8281 }
8382 } else {
8483 if (!BukkitConfigyml .listedItems ().contains (item .getType ())) {
85- BukkitConfigyml .blockedmessage (player );
84+ BukkitConfigyml .blockedmessage (player , p );
8685 return ;
8786 }
8887 // itemsadder
8988 if (!BukkitConfigyml .CustomBlacklistItems (item )) {
90- BukkitConfigyml .blockedmessage (player );
89+ BukkitConfigyml .blockedmessage (player , p );
9190 return ;
9291 }
9392 if (!BukkitConfigyml .customBlacklistedNamespace (item )) {
94- BukkitConfigyml .blockedmessage (player );
93+ BukkitConfigyml .blockedmessage (player , p );
9594 return ;
9695 }
9796 }
@@ -100,13 +99,13 @@ public void run(CommandSender commandSender, CommandArguments commandArguments)
10099
101100 if (BukkitConfigyml .isCooldownEnabled ()) {
102101 if (cooldownManager .hasCooldown (player .getUniqueId ())) {
103- BukkitConfigyml .Cooldownmessage (player , formatDuration (cooldownManager .getRemainingCooldown (player .getUniqueId ())));
102+ BukkitConfigyml .Cooldownmessage (p , player , formatDuration (cooldownManager .getRemainingCooldown (player .getUniqueId ())));
104103 return ;
105104 }
106105 }
107106 if (BukkitConfigyml .isCustomNBTAllowed ()) {
108107 if (BukkitConfigyml .customNBTItem (player , item )) {
109- BukkitConfigyml .customNBTItemMessage (player );
108+ BukkitConfigyml .customNBTItemMessage (player , p );
110109 return ;
111110 }
112111 }
@@ -116,7 +115,7 @@ public void run(CommandSender commandSender, CommandArguments commandArguments)
116115
117116 if (BukkitConfigyml .TimesPermissionOption ()) {
118117 if (!(BukkitConfigyml .hasTimesPermission (player ))) {
119- BukkitConfigyml .TimesNoPermission (player );
118+ BukkitConfigyml .TimesNoPermission (player , p );
120119 return ;
121120 }
122121 }
@@ -125,35 +124,35 @@ public void run(CommandSender commandSender, CommandArguments commandArguments)
125124 if (!(BukkitConfigyml .timesMax (player ) == 0 )) {
126125 if (!(player .hasPermission ("dupeplus.times.max.unlimited" ))) {
127126 if (times > BukkitConfigyml .timesMax (player )) {
128- BukkitConfigyml .timesMaxMessage (player );
127+ BukkitConfigyml .timesMaxMessage (player , p );
129128 return ;
130129 }
131130 }
132131 }
133132 if (!(BukkitConfigyml .timesMini () == 0 )) {
134133 if (!(player .hasPermission ("dupeplus.times.min.unlimited" ))) {
135134 if (times < BukkitConfigyml .timesMini ()) {
136- BukkitConfigyml .timesMiniMessage (player );
135+ BukkitConfigyml .timesMiniMessage (player , p );
137136 return ;
138137 }
139138 }
140139 }
141140
142141 if (item .getType () == Material .AIR ) {
143- BukkitConfigyml .dupingnothingmessage (player );
142+ BukkitConfigyml .dupingnothingmessage (player , p );
144143 return ;
145144 }
146145
147146 for (int i = 0 ; i < times ; i ++) {
148147 if (!BukkitConfigyml .isDupeMessageEmpty () &&
149148 !BukkitConfigyml .OneTimeMessage ()) {
150- p . sendMessage ( BukkitConfigyml .DupeMessage (player ) );
149+ BukkitConfigyml .DupeMessage (player , p );
151150 }
152151 dupe (player , item );
153152 }
154153 if (!(BukkitConfigyml .isDupeMessageEmpty ()) &&
155154 BukkitConfigyml .OneTimeMessage ()) {
156- p . sendMessage ( BukkitConfigyml .DupeMessage (player ) );
155+ BukkitConfigyml .DupeMessage (player , p );
157156 }
158157
159158 if (BukkitConfigyml .isCooldownEnabled ()) {
@@ -169,7 +168,7 @@ public void run(CommandSender commandSender, CommandArguments commandArguments)
169168
170169
171170 if (!BukkitConfigyml .isDupeMessageEmpty ()) {
172- p . sendMessage ( BukkitConfigyml .DupeMessage (player ) );
171+ BukkitConfigyml .DupeMessage (player , p );
173172 }
174173 dupe (player , item );
175174 if (BukkitConfigyml .isCooldownEnabled ()) {
0 commit comments