mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-15 03:51:28 +01:00
Add BentoBox compatibility
This commit is contained in:
parent
588dcbd6a3
commit
818ecf3d9a
@ -13,6 +13,7 @@ import com.songoda.core.database.SQLiteConnector;
|
|||||||
import com.songoda.core.gui.GuiManager;
|
import com.songoda.core.gui.GuiManager;
|
||||||
import com.songoda.core.hooks.EntityStackerManager;
|
import com.songoda.core.hooks.EntityStackerManager;
|
||||||
import com.songoda.core.hooks.HologramManager;
|
import com.songoda.core.hooks.HologramManager;
|
||||||
|
import com.songoda.core.hooks.ProtectionManager;
|
||||||
import com.songoda.core.hooks.WorldGuardHook;
|
import com.songoda.core.hooks.WorldGuardHook;
|
||||||
import com.songoda.core.utils.TextUtils;
|
import com.songoda.core.utils.TextUtils;
|
||||||
import com.songoda.ultimatestacker.commands.CommandConvert;
|
import com.songoda.ultimatestacker.commands.CommandConvert;
|
||||||
@ -170,6 +171,10 @@ public class UltimateStacker extends SongodaPlugin {
|
|||||||
spawnerFile.load();
|
spawnerFile.load();
|
||||||
spawnerFile.saveChanges();
|
spawnerFile.saveChanges();
|
||||||
|
|
||||||
|
if (Bukkit.getPluginManager().isPluginEnabled("BentoBox")) {
|
||||||
|
ProtectionManager.load(Bukkit.getPluginManager().getPlugin("BentoBox"));
|
||||||
|
}
|
||||||
|
|
||||||
this.spawnerStackManager = new SpawnerStackManager();
|
this.spawnerStackManager = new SpawnerStackManager();
|
||||||
this.entityStackManager = new EntityStackManager(this);
|
this.entityStackManager = new EntityStackManager(this);
|
||||||
this.blockStackManager = new BlockStackManager();
|
this.blockStackManager = new BlockStackManager();
|
||||||
|
@ -2,6 +2,8 @@ package com.songoda.ultimatestacker.listeners;
|
|||||||
|
|
||||||
import com.songoda.core.compatibility.CompatibleHand;
|
import com.songoda.core.compatibility.CompatibleHand;
|
||||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
|
import com.songoda.core.hooks.ProtectionManager;
|
||||||
|
import com.songoda.core.hooks.protection.BentoBoxProtection;
|
||||||
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||||
import com.songoda.ultimatestacker.UltimateStacker;
|
import com.songoda.ultimatestacker.UltimateStacker;
|
||||||
import com.songoda.ultimatestacker.events.SpawnerBreakEvent;
|
import com.songoda.ultimatestacker.events.SpawnerBreakEvent;
|
||||||
@ -46,10 +48,18 @@ public class BlockListeners implements Listener {
|
|||||||
if (event.useInteractedBlock() == Event.Result.DENY) return;
|
if (event.useInteractedBlock() == Event.Result.DENY) return;
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if (block == null) return;
|
||||||
|
|
||||||
|
if (!ProtectionManager.canInteract(player, block.getLocation()) || !ProtectionManager.canBreak(player, block.getLocation())) {
|
||||||
|
if (!player.isOp()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CompatibleHand hand = CompatibleHand.getHand(event);
|
CompatibleHand hand = CompatibleHand.getHand(event);
|
||||||
ItemStack inHand = hand.getItem(player);
|
ItemStack inHand = hand.getItem(player);
|
||||||
|
|
||||||
if (block == null) return;
|
|
||||||
|
|
||||||
if (Settings.STACK_BLOCKS.getBoolean()) {
|
if (Settings.STACK_BLOCKS.getBoolean()) {
|
||||||
BlockStackManager blockStackManager = plugin.getBlockStackManager();
|
BlockStackManager blockStackManager = plugin.getBlockStackManager();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: UltimateStacker
|
name: UltimateStacker
|
||||||
description: UltimateStacker
|
description: UltimateStacker
|
||||||
version: maven-version-number
|
version: maven-version-number
|
||||||
softdepend: [MythicMobs, HolographicDisplays, Holograms, CMI, WorldGuard, EpicSpawners, mcMMO, WildStacker, StackMob]
|
softdepend: [MythicMobs, HolographicDisplays, Holograms, CMI, WorldGuard, EpicSpawners, mcMMO, WildStacker, StackMob, BentoBox]
|
||||||
loadbefore: [WorldGuard]
|
loadbefore: [WorldGuard]
|
||||||
main: com.songoda.ultimatestacker.UltimateStacker
|
main: com.songoda.ultimatestacker.UltimateStacker
|
||||||
author: songoda
|
author: songoda
|
||||||
|
Loading…
Reference in New Issue
Block a user