mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-18 05:11:32 +01:00
Returning back basic chat payment messages
This commit is contained in:
parent
8cc7a25778
commit
4d94195146
@ -294,7 +294,7 @@ public class LanguageManager {
|
|||||||
|
|
||||||
c.get("command.recalculatepermissions.help.info", "Reset players permission cache");
|
c.get("command.recalculatepermissions.help.info", "Reset players permission cache");
|
||||||
c.get("command.recalculatepermissions.help.args", "(playername)");
|
c.get("command.recalculatepermissions.help.args", "(playername)");
|
||||||
|
|
||||||
c.get("command.stats.help.info", "Show the level you are in each job you are part of.");
|
c.get("command.stats.help.info", "Show the level you are in each job you are part of.");
|
||||||
c.get("command.stats.help.args", "[playername]");
|
c.get("command.stats.help.args", "[playername]");
|
||||||
Jobs.getGCManager().getCommandArgs().put("stats", Arrays.asList("[playername]"));
|
Jobs.getGCManager().getCommandArgs().put("stats", Arrays.asList("[playername]"));
|
||||||
@ -561,7 +561,7 @@ public class LanguageManager {
|
|||||||
c.get("command.area.output.removed", "&eRemoved the restricted area &6%name%");
|
c.get("command.area.output.removed", "&eRemoved the restricted area &6%name%");
|
||||||
c.get("command.area.output.lists", "&7%number%&f. &7%areaname% &f%worldname% &7(&a%x1%:%y1%:%z1%&7/&e%x2%:%y2%:%z2%&7) &2%money% &6%points% &e%exp%");
|
c.get("command.area.output.lists", "&7%number%&f. &7%areaname% &f%worldname% &7(&a%x1%:%y1%:%z1%&7/&e%x2%:%y2%:%z2%&7) &2%money% &6%points% &e%exp%");
|
||||||
c.get("command.area.output.wgLists", "&7%number%&f. WorldGuard: &7%areaname% &2%money% &6%points% &e%exp%");
|
c.get("command.area.output.wgLists", "&7%number%&f. WorldGuard: &7%areaname% &2%money% &6%points% &e%exp%");
|
||||||
c.get("command.area.output.noAreas", "&eThere are no saved restricted areas");
|
c.get("command.area.output.noAreas", "&eThere are no saved restricted areas");
|
||||||
c.get("command.area.output.noAreasByLoc", "&eThere are no restricted areas in this location");
|
c.get("command.area.output.noAreasByLoc", "&eThere are no restricted areas in this location");
|
||||||
c.get("command.area.output.areaList", "&eRestricted areas by your location: &6%list%");
|
c.get("command.area.output.areaList", "&eRestricted areas by your location: &6%list%");
|
||||||
c.get("command.area.output.selected1", "&eSelected the first point: &6%x%:%y%:%z%");
|
c.get("command.area.output.selected1", "&eSelected the first point: &6%x%:%y%:%z%");
|
||||||
@ -648,11 +648,16 @@ public class LanguageManager {
|
|||||||
c.get("command.toggle.help.args", "actionbar/bossbar");
|
c.get("command.toggle.help.args", "actionbar/bossbar");
|
||||||
Jobs.getGCManager().getCommandArgs().put("toggle", Arrays.asList("actionbar%%bossbar"));
|
Jobs.getGCManager().getCommandArgs().put("toggle", Arrays.asList("actionbar%%bossbar"));
|
||||||
c.get("command.toggle.output.turnedoff", "&4This feature is turned off!");
|
c.get("command.toggle.output.turnedoff", "&4This feature is turned off!");
|
||||||
|
|
||||||
|
c.get("command.toggle.output.paid.main", "&aYou got:");
|
||||||
|
c.get("command.toggle.output.paid.money", "&e[amount] money");
|
||||||
|
c.get("command.toggle.output.paid.exp", "&7[exp] exp");
|
||||||
|
c.get("command.toggle.output.paid.points", "&6[points] points");
|
||||||
|
|
||||||
c.get("command.toggle.output.paid.ACmoney", "&e+[amount]$ ");
|
c.get("command.toggle.output.paid.ACmoney", "&e+[amount]$ ");
|
||||||
c.get("command.toggle.output.paid.ACexp", "&7+[exp]XP ");
|
c.get("command.toggle.output.paid.ACexp", "&7+[exp]XP ");
|
||||||
c.get("command.toggle.output.paid.ACpoints", "&6+[points]pts ");
|
c.get("command.toggle.output.paid.ACpoints", "&6+[points]pts ");
|
||||||
|
|
||||||
c.get("command.toggle.output.on", "&aToggled: &aON");
|
c.get("command.toggle.output.on", "&aToggled: &aON");
|
||||||
c.get("command.toggle.output.off", "&aToggled: &4OFF");
|
c.get("command.toggle.output.off", "&aToggled: &4OFF");
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ import com.gamingmesh.jobs.stuff.ToggleBarHandling;
|
|||||||
import com.gamingmesh.jobs.tasks.BufferedPaymentTask;
|
import com.gamingmesh.jobs.tasks.BufferedPaymentTask;
|
||||||
|
|
||||||
import net.Zrips.CMILib.ActionBar.CMIActionBar;
|
import net.Zrips.CMILib.ActionBar.CMIActionBar;
|
||||||
|
import net.Zrips.CMILib.Logs.CMIDebug;
|
||||||
import net.Zrips.CMILib.Version.Version;
|
import net.Zrips.CMILib.Version.Version;
|
||||||
import net.Zrips.CMILib.Version.Schedulers.CMIScheduler;
|
import net.Zrips.CMILib.Version.Schedulers.CMIScheduler;
|
||||||
|
|
||||||
@ -207,9 +208,6 @@ public class BufferedEconomy {
|
|||||||
if (jobsPaymentEvent.isCancelled())
|
if (jobsPaymentEvent.isCancelled())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Do we need this?
|
|
||||||
payment.getPayment().putAll(jobsPaymentEvent.getPayment());
|
|
||||||
|
|
||||||
if (Jobs.getGCManager().UseServerAccount && !hasMoney) {
|
if (Jobs.getGCManager().UseServerAccount && !hasMoney) {
|
||||||
CMIActionBar.send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney"));
|
CMIActionBar.send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney"));
|
||||||
continue;
|
continue;
|
||||||
|
@ -31,10 +31,13 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
import com.gamingmesh.jobs.api.JobsInstancePaymentEvent;
|
import com.gamingmesh.jobs.api.JobsInstancePaymentEvent;
|
||||||
|
import com.gamingmesh.jobs.api.JobsPaymentEvent;
|
||||||
import com.gamingmesh.jobs.container.CurrencyType;
|
import com.gamingmesh.jobs.container.CurrencyType;
|
||||||
|
import com.gamingmesh.jobs.economy.BufferedPayment;
|
||||||
import com.gamingmesh.jobs.stuff.ToggleBarHandling;
|
import com.gamingmesh.jobs.stuff.ToggleBarHandling;
|
||||||
|
|
||||||
import net.Zrips.CMILib.ActionBar.CMIActionBar;
|
import net.Zrips.CMILib.ActionBar.CMIActionBar;
|
||||||
|
import net.Zrips.CMILib.Logs.CMIDebug;
|
||||||
import net.Zrips.CMILib.Version.Version;
|
import net.Zrips.CMILib.Version.Version;
|
||||||
|
|
||||||
public class JobsPaymentVisualizationListener implements Listener {
|
public class JobsPaymentVisualizationListener implements Listener {
|
||||||
@ -90,6 +93,44 @@ public class JobsPaymentVisualizationListener implements Listener {
|
|||||||
paymentCaches.remove(event.getPlayer().getUniqueId());
|
paymentCaches.remove(event.getPlayer().getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
|
public void onJobsPaymentEvent(JobsPaymentEvent event) {
|
||||||
|
if (event.isCancelled())
|
||||||
|
return;
|
||||||
|
showPayment(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void showPayment(JobsPaymentEvent event) {
|
||||||
|
|
||||||
|
if (event.getPlayer() == null || !event.getPlayer().isOnline() || event.getPayment().isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
UUID playerUUID = event.getPlayer().getUniqueId();
|
||||||
|
Player abp = Bukkit.getPlayer(playerUUID);
|
||||||
|
if (abp == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ToggleBarHandling.getActionBarToggle().getOrDefault(playerUUID, Jobs.getGCManager().ActionBarsMessageByDefault))
|
||||||
|
return;
|
||||||
|
|
||||||
|
String message = Jobs.getLanguage().getMessage("command.toggle.output.paid.main");
|
||||||
|
double money = event.getPayment().get(CurrencyType.MONEY);
|
||||||
|
if (money != 0D)
|
||||||
|
message += " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.money", "[amount]", String.format(Jobs.getGCManager().getDecimalPlacesMoney(), money));
|
||||||
|
|
||||||
|
double points = event.getPayment().get(CurrencyType.POINTS);
|
||||||
|
if (points != 0D)
|
||||||
|
message += " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.points", "[points]", String.format(Jobs.getGCManager().getDecimalPlacesPoints(), points));
|
||||||
|
|
||||||
|
double exp = event.getPayment().get(CurrencyType.EXP);
|
||||||
|
if (exp != 0D)
|
||||||
|
message += " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.exp", "[exp]", String.format(Jobs.getGCManager().getDecimalPlacesExp(), exp));
|
||||||
|
|
||||||
|
if (!message.isEmpty())
|
||||||
|
abp.sendMessage(message);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onJobsInstancePaymentBossEvent(JobsInstancePaymentEvent event) {
|
public void onJobsInstancePaymentBossEvent(JobsInstancePaymentEvent event) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user