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

Option to disable jobs shop

This commit is contained in:
Zrips 2023-05-02 16:42:26 +03:00
parent 2346e7d623
commit 5ecb3456a3
2 changed files with 28 additions and 18 deletions

View File

@ -2,35 +2,40 @@ package com.gamingmesh.jobs.commands.list;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.commands.Cmd;
import net.Zrips.CMILib.Locale.LC;
import net.Zrips.CMILib.Messages.CMIMessages;
public class shop implements Cmd {
@Override
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
if (!(sender instanceof Player)) {
CMIMessages.sendMessage(sender, LC.info_Ingame);
return true;
}
if (!Jobs.getGCManager().jobsshopenabled) {
LC.info_FeatureNotEnabled.sendMessage(sender);
return true;
}
if (args.length != 0 && args.length != 1) {
Jobs.getCommandManager().sendUsage(sender, "shop");
return true;
}
if (!(sender instanceof Player)) {
LC.info_Ingame.sendMessage(sender);
return true;
}
int page = 1;
if (args.length == 1)
try {
page = Integer.parseInt(args[0]);
} catch (NumberFormatException e) {
}
if (args.length != 0 && args.length != 1) {
Jobs.getCommandManager().sendUsage(sender, "shop");
return true;
}
Jobs.getShopManager().openShopGui((Player) sender, page);
return true;
int page = 1;
if (args.length == 1)
try {
page = Integer.parseInt(args[0]);
} catch (NumberFormatException e) {
}
Jobs.getShopManager().openShopGui((Player) sender, page);
return true;
}
}

View File

@ -96,7 +96,7 @@ public class GeneralConfigManager {
PreventSlimeSplit, PreventMagmaCubeSplit, PreventHopperFillUps, PreventBrewingStandFillUps, informOnPaymentDisable,
BrowseUseNewLook, payExploringWhenGliding = false, resetExploringData = false, disablePaymentIfMaxLevelReached, disablePaymentIfRiding,
boostedItemsInOffHand = false, boostedItemsInMainHand, boostedArmorItems, boostedItemsSlotSpecific, multiplyBoostedExtraValues, addPermissionBoost,
highestPermissionBoost /*, preventCropResizePayment*/,
highestPermissionBoost,
payItemDurabilityLoss,
applyToNegativeIncome, useMinimumOveralPayment, useMinimumOveralPoints, useMinimumOveralExp, useBreederFinder,
CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
@ -110,6 +110,8 @@ public class GeneralConfigManager {
DisabledWorldsUse, UseAsWhiteListWorldList, MythicMobsEnabled,
LoggingUse, payForCombiningItems, BlastFurnacesReassign = false, SmokerReassign = false, payForStackedEntities, payForAbove = false,
payForEachVTradeItem, allowEnchantingBoostedItems, bossBarAsync = false, preventShopItemEnchanting;
public boolean jobsshopenabled;
public ItemStack guiInfoButton;
public int InfoButtonSlot = 9;
@ -450,6 +452,9 @@ public class GeneralConfigManager {
c.addComment("prevent-shop-item-enchanting", "Prevent players to enchant items from the shop in the anvil with enchanted books");
preventShopItemEnchanting = c.get("prevent-shop-item-enchanting", true);
c.addComment("jobs-shop-enabled", "Enables or disables jobs shop");
jobsshopenabled = c.get("jobs-shop-enabled", true);
c.addComment("enable-pay-near-spawner",
"Option to allow payment to be made when killing mobs from a spawner.",