1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-29 04:18:07 +01:00

General permission over specific

This commit is contained in:
Zrips 2023-02-16 16:37:21 +02:00
parent 4d11d4ef03
commit c1d08d61fb
2 changed files with 14 additions and 7 deletions

View File

@ -95,7 +95,8 @@ public class GeneralConfigManager {
SignsColorizeJobName, ShowToplistInScoreboard, useGlobalTimer, useSilkTouchProtection, UseCustomNames,
PreventSlimeSplit, PreventMagmaCubeSplit, PreventHopperFillUps, PreventBrewingStandFillUps, informOnPaymentDisable,
BrowseUseNewLook, payExploringWhenGliding = false, resetExploringData = false, disablePaymentIfMaxLevelReached, disablePaymentIfRiding,
boostedItemsInOffHand = false, boostedItemsInMainHand, boostedArmorItems, boostedItemsSlotSpecific, multiplyBoostedExtraValues, addPermissionBoost /*, preventCropResizePayment*/, payItemDurabilityLoss,
boostedItemsInOffHand = false, boostedItemsInMainHand, boostedArmorItems, boostedItemsSlotSpecific, multiplyBoostedExtraValues, addPermissionBoost, highestPermissionBoost /*, preventCropResizePayment*/,
payItemDurabilityLoss,
applyToNegativeIncome, useMinimumOveralPayment, useMinimumOveralPoints, useMinimumOveralExp, useBreederFinder,
CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAccountChat,
@ -493,8 +494,14 @@ public class GeneralConfigManager {
"When set to true and for example nearSpawner set to -0.98 aka 2% of original payment with other bonuses which should double payment will result in you getting 4% instead of corrent 102% payment",
"If set to false all bonus are sumed to one");
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",
c.addComment("highest-permission-boost",
"Default (false) and we will prioritize specific permission over general, which means that jobs.boost.miner.money.0.5 will override and be used instead of jobs.boost.all.money.0.8",
"When enabled we will pick highest permission node from all accesible ones",
"Only applies while add-permission-boost set to false");
highestPermissionBoost = c.get("highest-permission-boost", 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);
@ -1051,7 +1058,7 @@ public class GeneralConfigManager {
c.addComment("JobsGUI.SkipAmount", "Defines by how many slots we need to skip after group");
JobsGUISkipAmount = c.get("JobsGUI.SkipAmount", 2);
c.addComment("JobsGUI.InfoButton.Slot", "Slot for info button. Set it to 0 if you want to disable it","Locale can be customized in locale file under gui->infoLore section");
c.addComment("JobsGUI.InfoButton.Slot", "Slot for info button. Set it to 0 if you want to disable it", "Locale can be customized in locale file under gui->infoLore section");
InfoButtonSlot = c.get("JobsGUI.InfoButton.Slot", 9);
CMIItemStack item = CMILib.getInstance().getItemManager().getItem(c.get("JobsGUI.InfoButton.Material",

View File

@ -406,15 +406,15 @@ public class JobsPlayer {
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 && !Jobs.getGCManager().highestPermissionBoost))
boost = v1;
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all.all", false, false);
if (v1 != 0d && (v1 > boost || v1 < boost))
if (v1 != 0d && (v1 > boost || v1 < boost && !Jobs.getGCManager().highestPermissionBoost))
boost = v1;
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all." + type.getName(), false, false);
if (v1 != 0d && (v1 > boost || v1 < boost))
if (v1 != 0d && (v1 > boost || v1 < boost && !Jobs.getGCManager().highestPermissionBoost))
boost = v1;
return boost;