mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Add config option for preventing enchantments on shop items
This commit is contained in:
parent
2cb31390d2
commit
b9f5b40b46
@ -102,7 +102,7 @@ public class GeneralConfigManager {
|
||||
BossBarEnabled = false, BossBarShowOnEachAction = false, BossBarsMessageByDefault = false, ExploreCompact, DBCleaningJobsUse, DBCleaningUsersUse,
|
||||
DisabledWorldsUse, UseAsWhiteListWorldList, PaymentMethodsMoney, PaymentMethodsPoints, PaymentMethodsExp, MythicMobsEnabled,
|
||||
LoggingUse, payForCombiningItems, BlastFurnacesReassign = false, SmokerReassign = false, payForStackedEntities, payForAbove = false,
|
||||
payForEachVTradeItem, allowEnchantingBoostedItems, bossBarAsync = false;
|
||||
payForEachVTradeItem, allowEnchantingBoostedItems, bossBarAsync = false, preventShopItemEnchanting;
|
||||
|
||||
public ItemStack guiBackButton, guiNextButton;
|
||||
public CMIMaterial guiFiller;
|
||||
@ -440,6 +440,9 @@ public class GeneralConfigManager {
|
||||
c.addComment("hide-jobsinfo-without-permission", "Hide jobs info from player if they lack the permission to join the job");
|
||||
hideJobsInfoWithoutPermission = c.get("hide-jobsinfo-without-permission", false);
|
||||
|
||||
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("enable-pay-near-spawner",
|
||||
"Option to allow payment to be made when killing mobs from a spawner.",
|
||||
"Use jobs.nearspawner.[amount] to define multiplayer. Example jobs.nearspawner.-0.5 will pay half of payment, jobs.nearspawner.-1 will not pay at all");
|
||||
|
@ -26,6 +26,7 @@ import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.gamingmesh.jobs.config.GeneralConfigManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -1082,6 +1083,9 @@ public final class JobsPaymentListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void PrepareAnvilEvent(final PrepareAnvilEvent event) {
|
||||
if (!Jobs.getGCManager().preventShopItemEnchanting)
|
||||
return;
|
||||
|
||||
if (!Jobs.getPlayerManager().containsItemBoostByNBT(event.getInventory().getContents()[0]))
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user