mirror of
https://github.com/songoda/EpicFurnaces.git
synced 2024-11-30 22:03:22 +01:00
Added protection plugin support.
This commit is contained in:
parent
87f565a093
commit
1cd742a5fb
@ -11,6 +11,7 @@ import com.songoda.core.database.SQLiteConnector;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.core.hooks.HologramManager;
|
||||
import com.songoda.core.hooks.ProtectionManager;
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import com.songoda.core.nms.nbt.NBTCore;
|
||||
import com.songoda.core.nms.nbt.NBTItem;
|
||||
@ -105,6 +106,9 @@ public class EpicFurnaces extends SongodaPlugin {
|
||||
// Register Hologram Plugin
|
||||
HologramManager.load(this);
|
||||
|
||||
// Load Protection hooks
|
||||
ProtectionManager.load(this);
|
||||
|
||||
// Setup Config
|
||||
Settings.setupConfig();
|
||||
this.setLocale(Settings.LANGUGE_MODE.getString(), false);
|
||||
|
@ -4,6 +4,7 @@ import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.core.hooks.ProtectionManager;
|
||||
import com.songoda.epicfurnaces.EpicFurnaces;
|
||||
import com.songoda.epicfurnaces.boost.BoostData;
|
||||
import com.songoda.epicfurnaces.furnace.levels.Level;
|
||||
@ -65,6 +66,12 @@ public class Furnace {
|
||||
if (placedBy == null) placedBy = player.getUniqueId();
|
||||
|
||||
if (!player.hasPermission("epicfurnaces.overview")) return;
|
||||
|
||||
if (Settings.USE_PROTECTION_PLUGINS.getBoolean() && !ProtectionManager.canInteract(player, location)) {
|
||||
player.sendMessage(plugin.getLocale().getMessage("event.general.protected").getPrefixedMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
guiManager.showGUI(player, new GUIOverview(plugin, this, player));
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,9 @@ public class Settings {
|
||||
"might leave a few spots. Minimum value is 16. To disable, just set",
|
||||
"this to a very high value, such as your worldborder size.");
|
||||
|
||||
public static final ConfigSetting USE_PROTECTION_PLUGINS = new ConfigSetting(config, "Main.Use Protection Plugins", true,
|
||||
"Should we use protection plugins?");
|
||||
|
||||
public static final ConfigSetting FURNACE_ITEM = new ConfigSetting(config, "Main.Remember Furnace Item Levels", true,
|
||||
"Should furnace levels be remembered when broken?");
|
||||
|
||||
|
@ -57,6 +57,7 @@ command:
|
||||
event:
|
||||
general:
|
||||
nopermission: '&cYou do not have permission to do that.'
|
||||
protected: '&cThis furnace is protected. You cannot access it.'
|
||||
upgrade:
|
||||
cannotafford: '&cYou cannot afford this upgrade.'
|
||||
success: '&7You successfully upgraded this furnace to &6level %level%&7!'
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: EpicFurnaces
|
||||
description: EpicFurnaces
|
||||
version: maven-version-number
|
||||
softdepend: [FabledSkyBlock, HolographicDisplays, PlotSquared, GriefPrevention, USkyBlock, SkyBlock, WorldGuard, Factions]
|
||||
softdepend: [FabledSkyBlock, HolographicDisplays, PlotSquared, GriefPrevention, USkyBlock, SkyBlock, WorldGuard, Factions, Lands, RedProtect, UltimateClaims, BentoBox]
|
||||
main: com.songoda.epicfurnaces.EpicFurnaces
|
||||
author: songoda
|
||||
api-version: 1.13
|
||||
|
Loading…
Reference in New Issue
Block a user