1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

Re-added payInCreative boolean

If a group has jobs.paycreative permission then this booelean ignores.
This commit is contained in:
montlikadani 2018-12-22 14:26:45 +01:00
parent dfbf7963da
commit c9f15c8ad4
5 changed files with 33 additions and 20 deletions

View File

@ -51,7 +51,7 @@ public class MythicMobs2Listener implements Listener {
if (pDamager == null)
return;
// check if in creative
if (pDamager.getGameMode().equals(GameMode.CREATIVE) && !pDamager.hasPermission("jobs.paycreative"))
if (pDamager.getGameMode().equals(GameMode.CREATIVE) && !pDamager.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(pDamager, pDamager.getLocation().getWorld().getName()))

View File

@ -52,7 +52,7 @@ public class MythicMobs4Listener implements Listener {
if (pDamager == null)
return;
// check if in creative
if (pDamager.getGameMode().equals(GameMode.CREATIVE) && !pDamager.hasPermission("jobs.paycreative"))
if (pDamager.getGameMode().equals(GameMode.CREATIVE) && !pDamager.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(pDamager, pDamager.getLocation().getWorld().getName()))

View File

@ -49,6 +49,7 @@ public class GeneralConfigManager {
protected boolean economyAsync;
protected boolean isBroadcastingSkillups;
protected boolean isBroadcastingLevelups;
protected boolean payInCreative;
protected boolean payExploringWhenFlying;
protected boolean addXpPlayer;
protected boolean hideJobsWithoutPermission;
@ -222,6 +223,15 @@ public class GeneralConfigManager {
return isBroadcastingLevelups;
}
/**
* Function that tells if the player should be paid while in creative
* @return true - pay in creative
* @return false - do not pay in creative
*/
public synchronized boolean payInCreative() {
return payInCreative;
}
/**
* Function that tells if the player should be paid while exploring and flying
* @return true - pay
@ -529,6 +539,9 @@ public class GeneralConfigManager {
"Use jobs.nearspawner.[amount] to define multiplayer. Example jobs.nearspawner.-0.5 will pay half of payment, jobs.nearspawner.-1 will not pay at all");
payNearSpawner = c.get("enable-pay-near-spawner", false);
c.getW().addComment("enable-pay-creative", "Option to allow payment to be made in creative mode. This ignoring when a group has 'jobs.paycreative' permission.");
payInCreative = c.get("enable-pay-creative", false);
c.getW().addComment("enable-pay-for-exploring-when-flying", "Option to allow payment to be made for exploring when player flies");
payExploringWhenFlying = c.get("enable-pay-for-exploring-when-flying", false);

View File

@ -170,7 +170,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
@ -228,7 +228,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -288,7 +288,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -363,7 +363,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode() == GameMode.CREATIVE && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode() == GameMode.CREATIVE && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -433,7 +433,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -457,7 +457,7 @@ public class JobsPaymentListener implements Listener {
Player player = event.getPlayer();
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -495,7 +495,7 @@ public class JobsPaymentListener implements Listener {
if (player == null || !player.isOnline())
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -556,7 +556,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
@ -779,7 +779,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
@ -816,7 +816,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
@ -1125,7 +1125,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -1155,7 +1155,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -1193,7 +1193,7 @@ public class JobsPaymentListener implements Listener {
if (player == null || !player.isOnline())
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -1296,7 +1296,7 @@ public class JobsPaymentListener implements Listener {
if (player != null && closest < 30.0) {
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -1335,7 +1335,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -1388,7 +1388,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
@ -1544,7 +1544,7 @@ public class JobsPaymentListener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))

View File

@ -51,7 +51,7 @@ public class McMMOlistener implements Listener {
return;
// check if in creative
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative"))
if (player.getGameMode().equals(GameMode.CREATIVE) && !player.hasPermission("jobs.paycreative") && !Jobs.getGCManager().payInCreative())
return;
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);