diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b9a6a6..dc3eca7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: variables: name: "EpicBuckets" path: "/builds/Songoda/$name" - version: "1.4.4" + version: "1.5" build: stage: build diff --git a/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/file/ConfigManager.java b/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/file/ConfigManager.java index 643eeea..0ad90b2 100644 --- a/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/file/ConfigManager.java +++ b/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/file/ConfigManager.java @@ -234,6 +234,10 @@ public class ConfigManager { return (cooldowns.get(player.getUniqueId()) + cooldown) < System.currentTimeMillis(); } + public void updateCooldown(Player player) { + cooldowns.put(player.getUniqueId(), System.currentTimeMillis()); + } + public void createConfig(String name, boolean resource) { File f = new File(epicBuckets.getDataFolder(), name + ".yml"); configDatabase.put(name, new Config(f, resource)); diff --git a/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/hooks/HookFactions.java b/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/hooks/HookFactions.java index 7ba9125..9b0d2b9 100644 --- a/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/hooks/HookFactions.java +++ b/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/hooks/HookFactions.java @@ -1,5 +1,6 @@ package com.songoda.epicbuckets.hooks; +import com.songoda.epicbuckets.EpicBuckets; import com.songoda.epicbuckets.utils.hooks.ClaimableProtectionPluginHook; import me.markeh.factionsframework.FactionsFramework; import me.markeh.factionsframework.entities.FPlayer; @@ -28,7 +29,9 @@ public class HookFactions implements ClaimableProtectionPluginHook { FPlayer fPlayer = FPlayers.getBySender(player); Faction faction = Factions.getFactionAt(location); - return faction.isNone() || fPlayer.getFaction().equals(faction); + if (faction.isNone()) return EpicBuckets.getInstance().getConfigManager().isGensInWilderness(); + + return fPlayer.getFaction().equals(faction); } @Override diff --git a/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/listeners/GenbucketPlaceListener.java b/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/listeners/GenbucketPlaceListener.java index a538441..42a4f1e 100644 --- a/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/listeners/GenbucketPlaceListener.java +++ b/EpicBuckets-Plugin/src/main/java/com/songoda/epicbuckets/listeners/GenbucketPlaceListener.java @@ -85,6 +85,7 @@ public class GenbucketPlaceListener implements Listener { case HORIZONTAL: genbucket = new Horizontal(e.getPlayer(), e.getClickedBlock(), e.getBlockFace(), instance.getShopManager().getShop(nbtItem.getString("Shop")).getSubShop(nbtItem.getString("SubShop"))); } + instance.getConfigManager().updateCooldown(e.getPlayer()); if (!genbucket.calculateBlockFace()) { e.getPlayer().sendMessage(instance.getLocale().getMessage("event.genbucket.placedwrong").replace("%genbucket%", genbucket.getGenbucketType().name.toUpperCase() + " genbucket")); diff --git a/EpicBuckets-Plugin/src/main/resources/config.yml b/EpicBuckets-Plugin/src/main/resources/config.yml index 68d8d7b..ad31840 100644 --- a/EpicBuckets-Plugin/src/main/resources/config.yml +++ b/EpicBuckets-Plugin/src/main/resources/config.yml @@ -8,12 +8,6 @@ # https://www.spigotmc.org/resources/epicbuckets-the-most-powerful-genbucket-plugin.50944/ # Please use 1.13+ material names, the plugin auto converts them to your server version -FACTIONS-SUPPORT: false # MassiveCore and Factions/FactionsUUID/SavageFactions is needed - -WORLDGUARD-SUPPORT: false # WorldEdit and WorldGuard is needed - -GRIEFPREVENTION-SUPPORT: false # GriefPrevention is needed - ENABLE-GENS-IN-WILDERNESS: true CLOSE-GUI-AFTER-PURCHASE: false # Close the inventory after purchase