mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-26 04:25:15 +01:00
Option to add all bonuses
This commit is contained in:
parent
237cabf82f
commit
4d11d4ef03
@ -997,8 +997,6 @@ public final class Jobs extends JavaPlugin {
|
|||||||
if (jPlayer == null)
|
if (jPlayer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CMIDebug.d("action");
|
|
||||||
|
|
||||||
List<JobProgression> progression = jPlayer.getJobProgression();
|
List<JobProgression> progression = jPlayer.getJobProgression();
|
||||||
int numjobs = progression.size();
|
int numjobs = progression.size();
|
||||||
|
|
||||||
|
@ -125,7 +125,6 @@ public class BlockProtectionManager {
|
|||||||
locations = new ConcurrentHashMap<>();
|
locations = new ConcurrentHashMap<>();
|
||||||
tempCache.put(loc.getWorld(), locations);
|
tempCache.put(loc.getWorld(), locations);
|
||||||
}
|
}
|
||||||
CMIDebug.d("Cached");
|
|
||||||
|
|
||||||
locations.put(v, Bp);
|
locations.put(v, Bp);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ public class GeneralConfigManager {
|
|||||||
SignsColorizeJobName, ShowToplistInScoreboard, useGlobalTimer, useSilkTouchProtection, UseCustomNames,
|
SignsColorizeJobName, ShowToplistInScoreboard, useGlobalTimer, useSilkTouchProtection, UseCustomNames,
|
||||||
PreventSlimeSplit, PreventMagmaCubeSplit, PreventHopperFillUps, PreventBrewingStandFillUps, informOnPaymentDisable,
|
PreventSlimeSplit, PreventMagmaCubeSplit, PreventHopperFillUps, PreventBrewingStandFillUps, informOnPaymentDisable,
|
||||||
BrowseUseNewLook, payExploringWhenGliding = false, resetExploringData = false, disablePaymentIfMaxLevelReached, disablePaymentIfRiding,
|
BrowseUseNewLook, payExploringWhenGliding = false, resetExploringData = false, disablePaymentIfMaxLevelReached, disablePaymentIfRiding,
|
||||||
boostedItemsInOffHand = false, boostedItemsInMainHand, boostedArmorItems, boostedItemsSlotSpecific, multiplyBoostedExtraValues/*, preventCropResizePayment*/, payItemDurabilityLoss,
|
boostedItemsInOffHand = false, boostedItemsInMainHand, boostedArmorItems, boostedItemsSlotSpecific, multiplyBoostedExtraValues, addPermissionBoost /*, preventCropResizePayment*/, payItemDurabilityLoss,
|
||||||
applyToNegativeIncome, useMinimumOveralPayment, useMinimumOveralPoints, useMinimumOveralExp, useBreederFinder,
|
applyToNegativeIncome, useMinimumOveralPayment, useMinimumOveralPoints, useMinimumOveralExp, useBreederFinder,
|
||||||
CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
|
CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
|
||||||
LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAccountChat,
|
LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAccountChat,
|
||||||
@ -494,6 +494,10 @@ public class GeneralConfigManager {
|
|||||||
"If set to false all bonus are sumed to one");
|
"If set to false all bonus are sumed to one");
|
||||||
multiplyBoostedExtraValues = c.get("multiply-boosted-extra-values", false);
|
multiplyBoostedExtraValues = c.get("multiply-boosted-extra-values", false);
|
||||||
|
|
||||||
|
c.addComment("add-permission-boost", "When enabled we will add all permission bonuses and penalties instead of picking highest one",
|
||||||
|
"This will add access to all permissions from jobs.boost.[jobName].[type].[amount] jobs.boost.all.[type].[amount] jobs.boost.[jobName].all.[amount] and jobs.boost.all.all.[amount] category");
|
||||||
|
addPermissionBoost = c.get("add-permission-boost", false);
|
||||||
|
|
||||||
// Better implementation?
|
// Better implementation?
|
||||||
/*c.addComment("prevent-crop-resize-payment", "Do you want to prevent crop resizing payment when placing more cactus?",
|
/*c.addComment("prevent-crop-resize-payment", "Do you want to prevent crop resizing payment when placing more cactus?",
|
||||||
"This option is only related to: sugar_cane, cactus, kelp, bamboo");
|
"This option is only related to: sugar_cane, cactus, kelp, bamboo");
|
||||||
|
@ -42,8 +42,7 @@ public class NameTranslatorManager {
|
|||||||
|
|
||||||
public String translate(String materialName, ActionType action, int id, String meta, String name) {
|
public String translate(String materialName, ActionType action, int id, String meta, String name) {
|
||||||
// Translating name to user friendly
|
// Translating name to user friendly
|
||||||
if (materialName.toLowerCase().contains("arrow"))
|
|
||||||
CMIDebug.d(materialName, meta, Util.getPotionByName(meta));
|
|
||||||
if (Jobs.getGCManager().UseCustomNames)
|
if (Jobs.getGCManager().UseCustomNames)
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case BREAK:
|
case BREAK:
|
||||||
|
@ -383,10 +383,29 @@ public class JobsPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Double getPlayerBoostNew(String jobName, CurrencyType type) {
|
private Double getPlayerBoostNew(String jobName, CurrencyType type) {
|
||||||
Double v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + jobName + "." + type.getName(), true, false);
|
|
||||||
Double boost = v1;
|
|
||||||
|
|
||||||
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + jobName + ".all", false, false);
|
if (Jobs.getGCManager().addPermissionBoost) {
|
||||||
|
|
||||||
|
Double boost = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + jobName + "." + type.getName(), true, true);
|
||||||
|
|
||||||
|
Double v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + jobName + ".all", false, true);
|
||||||
|
if (v1 != 0d)
|
||||||
|
boost += v1;
|
||||||
|
|
||||||
|
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all.all", false, true);
|
||||||
|
if (v1 != 0d)
|
||||||
|
boost += v1;
|
||||||
|
|
||||||
|
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all." + type.getName(), false, true);
|
||||||
|
if (v1 != 0d)
|
||||||
|
boost += v1;
|
||||||
|
|
||||||
|
return boost;
|
||||||
|
}
|
||||||
|
|
||||||
|
Double boost = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + jobName + "." + type.getName(), true, false);
|
||||||
|
|
||||||
|
Double v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + jobName + ".all", false, false);
|
||||||
if (v1 != 0d && (v1 > boost || v1 < boost))
|
if (v1 != 0d && (v1 > boost || v1 < boost))
|
||||||
boost = v1;
|
boost = v1;
|
||||||
|
|
||||||
|
@ -434,12 +434,9 @@ public final class JobsPaymentListener implements Listener {
|
|||||||
if (Jobs.getGCManager().disablePaymentIfRiding && player.isInsideVehicle())
|
if (Jobs.getGCManager().disablePaymentIfRiding && player.isInsideVehicle())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CMIDebug.d("BlockBreakEvent2");
|
|
||||||
|
|
||||||
// check if in creative
|
// check if in creative
|
||||||
if (!payIfCreative(player))
|
if (!payIfCreative(player))
|
||||||
return;
|
return;
|
||||||
CMIDebug.d("BlockBreakEvent3");
|
|
||||||
|
|
||||||
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
|
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
|
||||||
return;
|
return;
|
||||||
@ -1899,7 +1896,8 @@ public final class JobsPaymentListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean payIfCreative(Player player) {
|
public static boolean payIfCreative(Player player) {
|
||||||
return player.getGameMode() != GameMode.CREATIVE || Jobs.getGCManager().payInCreative() || Jobs.getPermissionManager().hasPermission(Jobs.getPlayerManager().getJobsPlayer(player), "jobs.paycreative");
|
return player.getGameMode() != GameMode.CREATIVE || Jobs.getGCManager().payInCreative() || Jobs.getPermissionManager().hasPermission(Jobs.getPlayerManager().getJobsPlayer(player),
|
||||||
|
"jobs.paycreative");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent item durability loss
|
// Prevent item durability loss
|
||||||
|
Loading…
Reference in New Issue
Block a user