mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-22 10:15:43 +01:00
Added protection plugin support.
This commit is contained in:
parent
ce27044153
commit
2bdcf56b7f
@ -10,6 +10,7 @@ import com.songoda.core.database.DatabaseConnector;
|
||||
import com.songoda.core.database.SQLiteConnector;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.core.hooks.ProtectionManager;
|
||||
import com.songoda.core.locale.Locale;
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import com.songoda.core.nms.nbt.NBTItem;
|
||||
@ -99,6 +100,9 @@ public class EpicHoppers extends SongodaPlugin {
|
||||
// Load Economy
|
||||
EconomyManager.load();
|
||||
|
||||
// Load protection hook
|
||||
ProtectionManager.load(this);
|
||||
|
||||
// Setup Config
|
||||
Settings.setupConfig();
|
||||
this.setLocale(Settings.LANGUGE_MODE.getString(), false);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.songoda.epichoppers.listeners;
|
||||
|
||||
import com.songoda.core.hooks.ProtectionManager;
|
||||
import com.songoda.core.hooks.WorldGuardHook;
|
||||
import com.songoda.epichoppers.EpicHoppers;
|
||||
import com.songoda.epichoppers.hopper.Hopper;
|
||||
@ -64,6 +65,11 @@ public class InteractListeners implements Listener {
|
||||
if (WorldGuardHook.isInteractAllowed(event.getClickedBlock().getLocation()))
|
||||
return;
|
||||
|
||||
if (Settings.USE_PROTECTION_PLUGINS.getBoolean() && !ProtectionManager.canInteract(player, event.getClickedBlock().getLocation())) {
|
||||
player.sendMessage(instance.getLocale().getMessage("event.general.protected").getPrefixedMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("FabledSkyBlock")) {
|
||||
SkyBlock skyBlock = SkyBlock.getInstance();
|
||||
|
||||
|
@ -54,6 +54,9 @@ public class Settings {
|
||||
public static final ConfigSetting MAX_CHUNK = new ConfigSetting(config, "Main.Max Hoppers Per Chunk", -1,
|
||||
"The maximum amount of hoppers per chunk.");
|
||||
|
||||
public static final ConfigSetting USE_PROTECTION_PLUGINS = new ConfigSetting(config, "Main.Use Protection Plugins", true,
|
||||
"Should we use protection plugins?");
|
||||
|
||||
public static final ConfigSetting BLOCKBREAK_PARTICLE = new ConfigSetting(config, "Main.BlockBreak Particle Type", "LAVA",
|
||||
"The particle shown when the block break module performs a block break.");
|
||||
|
||||
|
@ -79,6 +79,7 @@ command:
|
||||
event:
|
||||
general:
|
||||
nopermission: '&cYou do not have permission to do that.'
|
||||
protected: '&cThis hopper is protected and you cannot access it.'
|
||||
upgrade:
|
||||
cannotafford: '&cYou cannot afford this upgrade.'
|
||||
success: '&7You successfully upgraded this hopper to &6level %level%&7!'
|
||||
|
Loading…
Reference in New Issue
Block a user