diff --git a/core/src/main/java/zone/themcgamer/core/deliveryMan/DeliveryManManager.java b/core/src/main/java/zone/themcgamer/core/deliveryMan/DeliveryManManager.java index 1bda050..fa1a498 100644 --- a/core/src/main/java/zone/themcgamer/core/deliveryMan/DeliveryManManager.java +++ b/core/src/main/java/zone/themcgamer/core/deliveryMan/DeliveryManManager.java @@ -1,5 +1,6 @@ package zone.themcgamer.core.deliveryMan; +import com.cryptomorin.xseries.XSound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -25,11 +26,14 @@ import java.util.UUID; public class DeliveryManManager extends MiniAccount { public static final String DELIVERY_MAN_NAME = "Harold"; + private final boolean displayNotification; + private final DeliveryManRepository repository; - public DeliveryManManager(JavaPlugin plugin, MySQLController mySQLController) { + public DeliveryManManager(JavaPlugin plugin, MySQLController mySQLController, boolean displayNotification) { super(plugin); repository = new DeliveryManRepository(mySQLController.getDataSource()); + this.displayNotification = displayNotification; registerCommand(new DeliveryManCommand(this)); } @@ -58,6 +62,8 @@ public class DeliveryManManager extends MiniAccount { @EventHandler(priority = EventPriority.HIGHEST) private void onJoin(PlayerJoinEvent event) { + if (!displayNotification) + return; Player player = event.getPlayer(); Optional optionalAccount = AccountManager.fromCache(player.getUniqueId()); if (optionalAccount.isEmpty()) @@ -90,6 +96,7 @@ public class DeliveryManManager extends MiniAccount { return; repository.claim(optionalAccount.get().getId(), reward); optionalClient.get().getLastClaimedRewards().put(reward, System.currentTimeMillis()); + player.playSound(player.getEyeLocation(), XSound.ENTITY_PLAYER_LEVELUP.parseSound(), 0.9f, 1f); player.sendMessage(Style.main(DELIVERY_MAN_NAME, "You claimed §b" + reward.getDisplayName() + "§7.")); } diff --git a/core/src/main/java/zone/themcgamer/core/deliveryMan/menu/DeliveryManMenu.java b/core/src/main/java/zone/themcgamer/core/deliveryMan/menu/DeliveryManMenu.java index 19c2ef5..a559e48 100644 --- a/core/src/main/java/zone/themcgamer/core/deliveryMan/menu/DeliveryManMenu.java +++ b/core/src/main/java/zone/themcgamer/core/deliveryMan/menu/DeliveryManMenu.java @@ -39,9 +39,10 @@ public class DeliveryManMenu extends UpdatableMenu { .toItemStack(), event -> player.sendMessage("voting rewards"))); set(2, 5, new Button(new ItemBuilder(XMaterial.PLAYER_HEAD) .setSkullOwner(SkullTexture.DISCORD) - .setName("§d§lNitro Reward") - .addLoreLine("§7Claimable: §cNo") - .toItemStack(), event -> player.sendMessage("nitro reward"))); + .setName("§d§lNitro Rewards") + .addLoreLine("§7Click to view your §d0 §7unclaimed") + .addLoreLine("§7nitro boosting rewards!") + .toItemStack(), event -> player.sendMessage("nitro rewards"))); } @Override diff --git a/hub/src/main/java/zone/themcgamer/hub/Hub.java b/hub/src/main/java/zone/themcgamer/hub/Hub.java index f623545..d744f5e 100644 --- a/hub/src/main/java/zone/themcgamer/hub/Hub.java +++ b/hub/src/main/java/zone/themcgamer/hub/Hub.java @@ -56,7 +56,7 @@ public class Hub extends MGZPlugin { }); new KingdomManager(this, traveller); - AccountManager.addMiniAccount(new DeliveryManManager(this, mySQLController)); + AccountManager.addMiniAccount(new DeliveryManManager(this, mySQLController, true)); commandManager.registerCommand(new SpawnCommand(this)); }