mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-31 21:37:57 +01:00
Option to disable jobs shop
This commit is contained in:
parent
2346e7d623
commit
5ecb3456a3
@ -2,35 +2,40 @@ package com.gamingmesh.jobs.commands.list;
|
|||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
import com.gamingmesh.jobs.commands.Cmd;
|
import com.gamingmesh.jobs.commands.Cmd;
|
||||||
|
|
||||||
import net.Zrips.CMILib.Locale.LC;
|
import net.Zrips.CMILib.Locale.LC;
|
||||||
import net.Zrips.CMILib.Messages.CMIMessages;
|
|
||||||
|
|
||||||
public class shop implements Cmd {
|
public class shop implements Cmd {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
|
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
|
||||||
|
|
||||||
if (!(sender instanceof Player)) {
|
if (!Jobs.getGCManager().jobsshopenabled) {
|
||||||
CMIMessages.sendMessage(sender, LC.info_Ingame);
|
LC.info_FeatureNotEnabled.sendMessage(sender);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length != 0 && args.length != 1) {
|
if (!(sender instanceof Player)) {
|
||||||
Jobs.getCommandManager().sendUsage(sender, "shop");
|
LC.info_Ingame.sendMessage(sender);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int page = 1;
|
if (args.length != 0 && args.length != 1) {
|
||||||
if (args.length == 1)
|
Jobs.getCommandManager().sendUsage(sender, "shop");
|
||||||
try {
|
return true;
|
||||||
page = Integer.parseInt(args[0]);
|
}
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
Jobs.getShopManager().openShopGui((Player) sender, page);
|
int page = 1;
|
||||||
return true;
|
if (args.length == 1)
|
||||||
|
try {
|
||||||
|
page = Integer.parseInt(args[0]);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
Jobs.getShopManager().openShopGui((Player) sender, page);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ public class GeneralConfigManager {
|
|||||||
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, addPermissionBoost,
|
boostedItemsInOffHand = false, boostedItemsInMainHand, boostedArmorItems, boostedItemsSlotSpecific, multiplyBoostedExtraValues, addPermissionBoost,
|
||||||
highestPermissionBoost /*, preventCropResizePayment*/,
|
highestPermissionBoost,
|
||||||
payItemDurabilityLoss,
|
payItemDurabilityLoss,
|
||||||
applyToNegativeIncome, useMinimumOveralPayment, useMinimumOveralPoints, useMinimumOveralExp, useBreederFinder,
|
applyToNegativeIncome, useMinimumOveralPayment, useMinimumOveralPoints, useMinimumOveralExp, useBreederFinder,
|
||||||
CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
|
CancelCowMilking, fixAtMaxLevel, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
|
||||||
@ -110,6 +110,8 @@ public class GeneralConfigManager {
|
|||||||
DisabledWorldsUse, UseAsWhiteListWorldList, MythicMobsEnabled,
|
DisabledWorldsUse, UseAsWhiteListWorldList, MythicMobsEnabled,
|
||||||
LoggingUse, payForCombiningItems, BlastFurnacesReassign = false, SmokerReassign = false, payForStackedEntities, payForAbove = false,
|
LoggingUse, payForCombiningItems, BlastFurnacesReassign = false, SmokerReassign = false, payForStackedEntities, payForAbove = false,
|
||||||
payForEachVTradeItem, allowEnchantingBoostedItems, bossBarAsync = false, preventShopItemEnchanting;
|
payForEachVTradeItem, allowEnchantingBoostedItems, bossBarAsync = false, preventShopItemEnchanting;
|
||||||
|
|
||||||
|
public boolean jobsshopenabled;
|
||||||
|
|
||||||
public ItemStack guiInfoButton;
|
public ItemStack guiInfoButton;
|
||||||
public int InfoButtonSlot = 9;
|
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");
|
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);
|
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",
|
c.addComment("enable-pay-near-spawner",
|
||||||
"Option to allow payment to be made when killing mobs from a spawner.",
|
"Option to allow payment to be made when killing mobs from a spawner.",
|
||||||
|
Loading…
Reference in New Issue
Block a user