mirror of
https://github.com/songoda/EpicVouchers.git
synced 2024-11-21 17:45:48 +01:00
Hotfix for: SD-3014
This commit is contained in:
parent
8ad2b5d31c
commit
c44c7adca4
2
.gitignore
vendored
2
.gitignore
vendored
@ -91,3 +91,5 @@ target/classes/en_US\.lang
|
||||
target/classes/plugin\.yml
|
||||
|
||||
target/classes/vouchers\.yml
|
||||
|
||||
dependency-reduced-pom\.xml
|
||||
|
@ -19,6 +19,7 @@
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.13.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.songoda:songodaupdater:1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.2" level="project" />
|
||||
|
@ -18,6 +18,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicvouchers.utils.Methods.format;
|
||||
@ -141,16 +142,17 @@ public class Voucher {
|
||||
}
|
||||
|
||||
public void give(CommandSender sender, List<Player> players, int amount) {
|
||||
|
||||
String giveMessage = instance.getLocale().getMessage("command.give.send")
|
||||
.replaceAll("%player%", players.size() == 1 ? players.get(0).getName() : "everyone")
|
||||
.replaceAll("%voucher%", Matcher.quoteReplacement(getName(true)))
|
||||
.replaceAll("%amount%", String.valueOf(amount));
|
||||
.replaceAll(Pattern.quote("%player%"), players.size() == 1 ? players.get(0).getName() : "everyone")
|
||||
.replaceAll(Pattern.quote("%voucher%"), Matcher.quoteReplacement(getName(true)))
|
||||
.replaceAll(Pattern.quote("%amount%"), String.valueOf(amount));
|
||||
|
||||
for (Player player : players) {
|
||||
String receiveMessage = instance.getLocale().getMessage("command.give.receive")
|
||||
.replaceAll("%voucher%", getName(true))
|
||||
.replaceAll("%player%", player.getName())
|
||||
.replaceAll("%amount%", String.valueOf(amount));
|
||||
.replaceAll(Pattern.quote("%voucher%"), getName(true))
|
||||
.replaceAll(Pattern.quote("%player%"), player.getName())
|
||||
.replaceAll(Pattern.quote("%amount%"), String.valueOf(amount));
|
||||
|
||||
VoucherReceiveEvent event = new VoucherReceiveEvent(player, getName(true), toItemStack(amount), amount, sender);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user