mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +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)
|
||||
return;
|
||||
|
||||
CMIDebug.d("action");
|
||||
|
||||
List<JobProgression> progression = jPlayer.getJobProgression();
|
||||
int numjobs = progression.size();
|
||||
|
||||
|
@ -125,7 +125,6 @@ public class BlockProtectionManager {
|
||||
locations = new ConcurrentHashMap<>();
|
||||
tempCache.put(loc.getWorld(), locations);
|
||||
}
|
||||
CMIDebug.d("Cached");
|
||||
|
||||
locations.put(v, Bp);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ 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/*, preventCropResizePayment*/, payItemDurabilityLoss,
|
||||
boostedItemsInOffHand = false, boostedItemsInMainHand, boostedArmorItems, boostedItemsSlotSpecific, multiplyBoostedExtraValues, addPermissionBoost /*, preventCropResizePayment*/, payItemDurabilityLoss,
|
||||
applyToNegativeIncome, useMinimumOveralPayment, useMinimumOveralPoints, useMinimumOveralExp, useBreederFinder,
|
||||
CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
|
||||
LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAccountChat,
|
||||
@ -493,6 +493,10 @@ 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",
|
||||
"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?
|
||||
/*c.addComment("prevent-crop-resize-payment", "Do you want to prevent crop resizing payment when placing more cactus?",
|
||||
|
@ -42,8 +42,7 @@ public class NameTranslatorManager {
|
||||
|
||||
public String translate(String materialName, ActionType action, int id, String meta, String name) {
|
||||
// Translating name to user friendly
|
||||
if (materialName.toLowerCase().contains("arrow"))
|
||||
CMIDebug.d(materialName, meta, Util.getPotionByName(meta));
|
||||
|
||||
if (Jobs.getGCManager().UseCustomNames)
|
||||
switch (action) {
|
||||
case BREAK:
|
||||
|
@ -383,10 +383,29 @@ public class JobsPlayer {
|
||||
}
|
||||
|
||||
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))
|
||||
boost = v1;
|
||||
|
||||
|
@ -434,12 +434,9 @@ public final class JobsPaymentListener implements Listener {
|
||||
if (Jobs.getGCManager().disablePaymentIfRiding && player.isInsideVehicle())
|
||||
return;
|
||||
|
||||
CMIDebug.d("BlockBreakEvent2");
|
||||
|
||||
// check if in creative
|
||||
if (!payIfCreative(player))
|
||||
return;
|
||||
CMIDebug.d("BlockBreakEvent3");
|
||||
|
||||
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
|
||||
return;
|
||||
@ -1899,7 +1896,8 @@ public final class JobsPaymentListener implements Listener {
|
||||
}
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user