mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-18 05:11:32 +01:00
Fix #323 /jobs employ if target has, then checked the permission at the target
- Now checking correctly for plants when break
This commit is contained in:
parent
33c1bb961d
commit
aadf514dba
@ -19,15 +19,15 @@ public class employ implements Cmd {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Jobs.hasPermission(sender, "jobs.command.employ", true))
|
||||||
|
return true;
|
||||||
|
|
||||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(args[0]);
|
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(args[0]);
|
||||||
if (jPlayer == null) {
|
if (jPlayer == null) {
|
||||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", args[0]));
|
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", args[0]));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Jobs.hasPermission(jPlayer.getPlayer(), "jobs.command.employ", true))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
Job job = Jobs.getJob(args[1]);
|
Job job = Jobs.getJob(args[1]);
|
||||||
if (job == null) {
|
if (job == null) {
|
||||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
||||||
|
@ -100,8 +100,8 @@ public class GeneralConfigManager {
|
|||||||
private boolean useTnTFinder = false;
|
private boolean useTnTFinder = false;
|
||||||
public boolean CancelCowMilking;
|
public boolean CancelCowMilking;
|
||||||
public boolean fixAtMaxLevel, ToggleActionBar, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
|
public boolean fixAtMaxLevel, ToggleActionBar, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
|
||||||
LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAcountChat,
|
LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAccountChat,
|
||||||
EmptyServerAcountActionBar, ActionBarsMessageByDefault, ShowTotalWorkers, ShowPenaltyBonus, useDynamicPayment,
|
EmptyServerAccountActionBar, ActionBarsMessageByDefault, ShowTotalWorkers, ShowPenaltyBonus, useDynamicPayment,
|
||||||
JobsGUIOpenOnBrowse, JobsGUIShowChatBrowse, JobsGUISwitcheButtons, JobsGUIOpenOnJoin;
|
JobsGUIOpenOnBrowse, JobsGUIShowChatBrowse, JobsGUISwitcheButtons, JobsGUIOpenOnJoin;
|
||||||
|
|
||||||
private int JobsGUIRows, JobsGUIBackButton,
|
private int JobsGUIRows, JobsGUIBackButton,
|
||||||
@ -128,7 +128,7 @@ public class GeneralConfigManager {
|
|||||||
public boolean useMaxPaymentCurve;
|
public boolean useMaxPaymentCurve;
|
||||||
public float maxPaymentCurveFactor;
|
public float maxPaymentCurveFactor;
|
||||||
public double TaxesAmount;
|
public double TaxesAmount;
|
||||||
public String SoundLevelupSound, SoundTitleChangeSound, ServerAcountName, ServertaxesAcountName;
|
public String SoundLevelupSound, SoundTitleChangeSound, ServerAccountName, ServertaxesAccountName;
|
||||||
public ArrayList<String> keys;
|
public ArrayList<String> keys;
|
||||||
public boolean hideJobsInfoWithoutPermission;
|
public boolean hideJobsInfoWithoutPermission;
|
||||||
public boolean UseTaxes;
|
public boolean UseTaxes;
|
||||||
@ -621,15 +621,15 @@ public class GeneralConfigManager {
|
|||||||
useMaxPaymentCurve = c.get("Economy.MaxPayment.curve.use", false);
|
useMaxPaymentCurve = c.get("Economy.MaxPayment.curve.use", false);
|
||||||
int temp = c.get("Economy.MaxPayment.curve.factor", 10);
|
int temp = c.get("Economy.MaxPayment.curve.factor", 10);
|
||||||
maxPaymentCurveFactor = ((float) temp) / 1000;
|
maxPaymentCurveFactor = ((float) temp) / 1000;
|
||||||
c.getW().addComment("Economy.UseServerAcount", "Server economy account", "With this enabled, players will get money from defined user (server account)",
|
c.getW().addComment("Economy.UseServerAccount", "Server economy account", "With this enabled, players will get money from defined user (server account)",
|
||||||
"If this account don't have enough money to pay for players for, player will get message");
|
"If this account don't have enough money to pay for players for, player will get message");
|
||||||
UseServerAccount = c.get("Economy.UseServerAcount", false);
|
UseServerAccount = c.get("Economy.UseServerAccount", false);
|
||||||
c.getW().addComment("Economy.AcountName", "Username should be with Correct capitalization");
|
c.getW().addComment("Economy.AccountName", "Username should be with Correct capitalization");
|
||||||
ServerAcountName = c.get("Economy.AcountName", "Server");
|
ServerAccountName = c.get("Economy.AccountName", "Server");
|
||||||
c.getW().addComment("Economy.Taxes.use", "Do you want to use taxes feature for jobs payment");
|
c.getW().addComment("Economy.Taxes.use", "Do you want to use taxes feature for jobs payment");
|
||||||
UseTaxes = c.get("Economy.Taxes.use", false);
|
UseTaxes = c.get("Economy.Taxes.use", false);
|
||||||
c.getW().addComment("Economy.Taxes.AccountName", "Username should be with Correct capitalization, it can be same as setup in server account before");
|
c.getW().addComment("Economy.Taxes.AccountName", "Username should be with Correct capitalization, it can be same as setup in server account before");
|
||||||
ServertaxesAcountName = c.get("Economy.Taxes.AccountName", "Server");
|
ServertaxesAccountName = c.get("Economy.Taxes.AccountName", "Server");
|
||||||
c.getW().addComment("Economy.Taxes.Amount", "Amount in percentage");
|
c.getW().addComment("Economy.Taxes.Amount", "Amount in percentage");
|
||||||
TaxesAmount = c.get("Economy.Taxes.Amount", 15.0);
|
TaxesAmount = c.get("Economy.Taxes.Amount", 15.0);
|
||||||
c.getW().addComment("Economy.Taxes.TransferToServerAccount", "Do you want to transfer taxes to server account");
|
c.getW().addComment("Economy.Taxes.TransferToServerAccount", "Do you want to transfer taxes to server account");
|
||||||
@ -869,12 +869,12 @@ public class GeneralConfigManager {
|
|||||||
c.getW().addComment("ShowActionBars", "You can enable/disable message shown for players in action bar");
|
c.getW().addComment("ShowActionBars", "You can enable/disable message shown for players in action bar");
|
||||||
TitleChangeActionBar = c.get("ShowActionBars.OnTitleChange", true);
|
TitleChangeActionBar = c.get("ShowActionBars.OnTitleChange", true);
|
||||||
LevelChangeActionBar = c.get("ShowActionBars.OnLevelChange", true);
|
LevelChangeActionBar = c.get("ShowActionBars.OnLevelChange", true);
|
||||||
EmptyServerAcountActionBar = c.get("ShowActionBars.OnEmptyServerAcount", true);
|
EmptyServerAccountActionBar = c.get("ShowActionBars.OnEmptyServerAccount", true);
|
||||||
|
|
||||||
c.getW().addComment("ShowChatMessage", "Chat messages", "You can enable/disable message shown for players in chat");
|
c.getW().addComment("ShowChatMessage", "Chat messages", "You can enable/disable message shown for players in chat");
|
||||||
TitleChangeChat = c.get("ShowChatMessage.OnTitleChange", true);
|
TitleChangeChat = c.get("ShowChatMessage.OnTitleChange", true);
|
||||||
LevelChangeChat = c.get("ShowChatMessage.OnLevelChange", true);
|
LevelChangeChat = c.get("ShowChatMessage.OnLevelChange", true);
|
||||||
EmptyServerAcountChat = c.get("ShowChatMessage.OnEmptyServerAcount", true);
|
EmptyServerAccountChat = c.get("ShowChatMessage.OnEmptyServerAccount", true);
|
||||||
|
|
||||||
c.getW().addComment("Sounds", "Sounds", "Extra sounds on some events",
|
c.getW().addComment("Sounds", "Sounds", "Extra sounds on some events",
|
||||||
"All sounds can be found in https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html");
|
"All sounds can be found in https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html");
|
||||||
|
@ -131,8 +131,8 @@ public class BufferedEconomy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean hasMoney = false;
|
boolean hasMoney = false;
|
||||||
String ServerAccountname = Jobs.getGCManager().ServerAcountName;
|
String ServerAccountname = Jobs.getGCManager().ServerAccountName;
|
||||||
String ServerTaxesAccountname = Jobs.getGCManager().ServertaxesAcountName;
|
String ServerTaxesAccountname = Jobs.getGCManager().ServertaxesAccountName;
|
||||||
if (this.ServerAccount == null)
|
if (this.ServerAccount == null)
|
||||||
this.ServerAccount = Bukkit.getOfflinePlayer(ServerAccountname);
|
this.ServerAccount = Bukkit.getOfflinePlayer(ServerAccountname);
|
||||||
|
|
||||||
@ -145,11 +145,9 @@ public class BufferedEconomy {
|
|||||||
if (ServerTaxesAccount.isOnline()) {
|
if (ServerTaxesAccount.isOnline()) {
|
||||||
if (!Jobs.getActionbarToggleList().containsKey(ServerTaxesAccountname) && Jobs.getGCManager().ActionBarsMessageByDefault)
|
if (!Jobs.getActionbarToggleList().containsKey(ServerTaxesAccountname) && Jobs.getGCManager().ActionBarsMessageByDefault)
|
||||||
Jobs.getActionbarToggleList().put(ServerTaxesAccountname, true);
|
Jobs.getActionbarToggleList().put(ServerTaxesAccountname, true);
|
||||||
if (Jobs.getActionbarToggleList().containsKey(ServerTaxesAccountname) && Jobs.getActionbarToggleList().get(ServerTaxesAccountname)) {
|
if (Jobs.getActionbarToggleList().containsKey(ServerTaxesAccountname) && Jobs.getActionbarToggleList().get(ServerTaxesAccountname))
|
||||||
Jobs.getActionBar();
|
|
||||||
Jobs.getActionBar().send(Bukkit.getPlayer(ServerAccountname), Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100)
|
Jobs.getActionBar().send(Bukkit.getPlayer(ServerAccountname), Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100)
|
||||||
/ 100.0));
|
/ 100.0));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,14 +182,14 @@ public class BufferedEconomy {
|
|||||||
Jobs.getActionBar().send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney"));
|
Jobs.getActionBar().send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (Jobs.getGCManager().isEconomyAsync()) {
|
if (Jobs.getGCManager().isEconomyAsync())
|
||||||
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new BufferedPaymentTask(this, economy, payment), i);
|
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new BufferedPaymentTask(this, economy, payment), i);
|
||||||
} else
|
else
|
||||||
Bukkit.getScheduler().runTaskLater(plugin, new BufferedPaymentTask(this, economy, payment), i);
|
Bukkit.getScheduler().runTaskLater(plugin, new BufferedPaymentTask(this, economy, payment), i);
|
||||||
} else {
|
} else {
|
||||||
if (Jobs.getGCManager().isEconomyAsync()) {
|
if (Jobs.getGCManager().isEconomyAsync())
|
||||||
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new BufferedPaymentTask(this, economy, payment), i);
|
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new BufferedPaymentTask(this, economy, payment), i);
|
||||||
} else
|
else
|
||||||
Bukkit.getScheduler().runTaskLater(plugin, new BufferedPaymentTask(this, economy, payment), i);
|
Bukkit.getScheduler().runTaskLater(plugin, new BufferedPaymentTask(this, economy, payment), i);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -211,19 +209,19 @@ public class BufferedEconomy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void ShowActionBar(BufferedPayment payment) {
|
public void ShowActionBar(BufferedPayment payment) {
|
||||||
if (!payment.getOfflinePlayer().isOnline()) {
|
if (!payment.getOfflinePlayer().isOnline())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
String playername = payment.getOfflinePlayer().getName();
|
String playername = payment.getOfflinePlayer().getName();
|
||||||
if ((!Jobs.getActionbarToggleList().containsKey(playername)) && (Jobs.getGCManager().ActionBarsMessageByDefault)) {
|
if ((!Jobs.getActionbarToggleList().containsKey(playername)) && (Jobs.getGCManager().ActionBarsMessageByDefault))
|
||||||
Jobs.getActionbarToggleList().put(playername, Boolean.valueOf(true));
|
Jobs.getActionbarToggleList().put(playername, Boolean.valueOf(true));
|
||||||
}
|
|
||||||
if (playername == null) {
|
if (playername == null)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
if (!Jobs.getActionbarToggleList().containsKey(playername)) {
|
if (!Jobs.getActionbarToggleList().containsKey(playername))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
Boolean show = Jobs.getActionbarToggleList().get(playername);
|
Boolean show = Jobs.getActionbarToggleList().get(playername);
|
||||||
Player abp = Bukkit.getPlayer(payment.getOfflinePlayer().getUniqueId());
|
Player abp = Bukkit.getPlayer(payment.getOfflinePlayer().getUniqueId());
|
||||||
if ((abp != null) && (show.booleanValue())) {
|
if ((abp != null) && (show.booleanValue())) {
|
||||||
|
@ -1850,23 +1850,23 @@ Jobs:
|
|||||||
income: 1.5
|
income: 1.5
|
||||||
points: 1.5
|
points: 1.5
|
||||||
experience: 3.0
|
experience: 3.0
|
||||||
beetroots:
|
beetroots-7:
|
||||||
income: 1.5
|
income: 1.5
|
||||||
points: 1.5
|
points: 1.5
|
||||||
experience: 3.0
|
experience: 3.0
|
||||||
wheat:
|
wheat-7:
|
||||||
income: 1.5
|
income: 1.5
|
||||||
points: 1.5
|
points: 1.5
|
||||||
experience: 3.0
|
experience: 3.0
|
||||||
carrots:
|
carrots-7:
|
||||||
income: 1.0
|
income: 1.0
|
||||||
points: 1.0
|
points: 1.0
|
||||||
experience: 1.0
|
experience: 1.0
|
||||||
potatoes:
|
potatoes-7:
|
||||||
income: 1.0
|
income: 1.0
|
||||||
points: 1.0
|
points: 1.0
|
||||||
experience: 1.0
|
experience: 1.0
|
||||||
pumpkin:
|
pumpkin-7:
|
||||||
income: 0.5
|
income: 0.5
|
||||||
points: 0.5
|
points: 0.5
|
||||||
experience: 1.0
|
experience: 1.0
|
||||||
@ -1874,7 +1874,7 @@ Jobs:
|
|||||||
income: 0.2
|
income: 0.2
|
||||||
points: 0.2
|
points: 0.2
|
||||||
experience: 0.2
|
experience: 0.2
|
||||||
cocoa:
|
cocoa-2:
|
||||||
income: 4
|
income: 4
|
||||||
points: 4
|
points: 4
|
||||||
experience: 4.0
|
experience: 4.0
|
||||||
|
Loading…
Reference in New Issue
Block a user