Compare commits

...

6 Commits

Author SHA1 Message Date
Christian Koop d5af57f27b
Merge branch 'master' into development 2024-03-27 09:43:45 +01:00
Christian Koop abb770ef65
fix: Replaces usage of depreacted CompatibleSound with XSound
The CompatibleSound class will be removed from the Core and this ensures compatibility with
new versions of the Core and newer Minecraft versions
2024-03-27 09:43:40 +01:00
craftaro-plugins-overview[bot] d060bb6e63
Updates contents of README.md 2024-03-07 20:52:47 +00:00
Christian Koop 3ba9983dd0
Adds plugin logo at docs/Logo.png 2024-03-07 21:46:05 +01:00
ceze88 e205a07318 Merge branch 'development' 2024-01-13 15:56:39 +01:00
craftaro-plugins-overview[bot] 17d2eb43eb
Updates contents of README.md 2023-07-18 13:44:03 +00:00
3 changed files with 12 additions and 13 deletions

View File

@ -1,21 +1,22 @@
<!--suppress HtmlDeprecatedAttribute -->
<div align="center">
<img src="https://craftaro.com/images/products/509/icons/5EJsLZfmeHcwy9rIY0dAgnzqR4rL4iCKAEyjgjIk.png" width="128px">
<img src="docs/Logo.png" width="128px">
# EpicVouchers
Create vouchers that players can claim for rewards with seemingly infinite possibilities. Customize your servers vouchers through an intuitive in-game editor
**Create vouchers that players can claim for rewards with seemingly infinite possibilities**
**Customize your server&#39;s vouchers through an intuitive in-game editor**
[![Discord][Discord shield]][Discord invite]
[![Patreon][Patreon shield]][Patreon page]
<br>
[![Latest version][Latest version shield]][Marketplace page]
[![Latest version][Latest version shield]][Plugin page]
[![bStats Servers][bStats shield]][bStats page]
</div>
## Download (Marketplace)
You can visit [our marketplace][Marketplace page] to download EpicVouchers as well as take a
You can visit [our marketplace][Plugin page] to download EpicVouchers as well as take a
look at many other fantastic plugins which are sure to catch your eye.
## Documentation
@ -33,13 +34,13 @@ For suggestions about features you think should be added to the plugin to increa
create a thread over on [our Discord server][Discord invite].
[Marketplace page]: https://craftaro.com/marketplace/product/25
[Plugin page]: https://songoda.com/product/12
[Plugin wiki]: https://wiki.craftaro.com/index.php/Epic_Vouchers
[Patreon page]: https://www.patreon.com/join/songoda
[Discord invite]: https://discord.gg/craftaro
[Discord invite]: https://discord.gg/7TXM8xr2Ng
[bStats page]: https://bstats.org/plugin/bukkit/EpicVouchers/4209
[Patreon shield]: https://img.shields.io/badge/-Support_us_on_Patreon-F96854.svg?logo=patreon&style=flat&logoColor=white
[Discord shield]: https://img.shields.io/discord/293212540723396608?color=5865F2&label=Discord&logo=discord&logoColor=5865F2
[Discord shield]: https://img.shields.io/discord/1214289374506917889?color=5865F2&label=Discord&logo=discord&logoColor=5865F2
[bStats shield]: https://img.shields.io/bstats/servers/4209?label=Servers
[Latest version shield]: https://img.shields.io/badge/dynamic/xml?style=flat&color=blue&logo=github&logoColor=white&label=Latest&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcraftaro%2FEpicVouchers%2Fmaster%2Fpom.xml&query=%2F*%5Blocal-name()%3D'project'%5D%2F*%5Blocal-name()%3D'version'%5D

BIN
docs/Logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -1,10 +1,10 @@
package com.craftaro.epicvouchers.voucher;
import com.craftaro.core.compatibility.CompatibleSound;
import com.craftaro.core.compatibility.ServerVersion;
import com.craftaro.epicvouchers.EpicVouchers;
import com.craftaro.epicvouchers.events.VoucherRedeemEvent;
import com.craftaro.epicvouchers.listeners.PlayerCommandListener;
import com.craftaro.third_party.com.cryptomorin.xseries.XSound;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
@ -15,6 +15,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import java.util.Optional;
import java.util.logging.Level;
public class VoucherExecutor {
@ -142,11 +143,8 @@ public class VoucherExecutor {
}
if (voucher.getSound() != null && !voucher.getSound().isEmpty()) {
try {
CompatibleSound sound = CompatibleSound.valueOf(voucher.getSound());
sound.play(player, Integer.MAX_VALUE, voucher.getSoundPitch());
} catch (IllegalArgumentException ignored) {
}
Optional<XSound> sound = XSound.matchXSound(voucher.getSound());
sound.ifPresent(xSound -> xSound.play(player, 1.0f, voucher.getSoundPitch()));
}
String particle = voucher.getParticle();