mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-22 18:25:59 +01:00
Cache isPluginEnabled
This commit is contained in:
parent
cd8a53416c
commit
e3f5e62c74
@ -54,11 +54,13 @@ public class HopTask extends BukkitRunnable {
|
||||
|
||||
private final Map<InventoryHolder, ItemStack> blacklist = new HashMap<>();
|
||||
private final int hopTicks;
|
||||
private final boolean hasFabledSkyBlock;
|
||||
|
||||
public HopTask(EpicHoppers plug) {
|
||||
plugin = plug;
|
||||
this.hopTicks = Math.max(1, Setting.HOP_TICKS.getInt() / 2); // Purposeful integer division. Don't go below 1.
|
||||
this.runTaskTimer(plugin, 0, 2);
|
||||
this.hasFabledSkyBlock = Bukkit.getPluginManager().isPluginEnabled("FabledSkyBlock");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -244,7 +246,7 @@ public class HopTask extends BukkitRunnable {
|
||||
}
|
||||
|
||||
// Support for FabledSkyBlock stackables.
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("FabledSkyBlock")) {
|
||||
if (this.hasFabledSkyBlock) {
|
||||
StackableManager stackableManager = SkyBlock.getInstance().getStackableManager();
|
||||
if (stackableManager != null && stackableManager.isStacked(pointingLocation)) {
|
||||
Stackable stackable = stackableManager.getStack(pointingLocation, pointingLocation.getBlock().getType());
|
||||
|
Loading…
Reference in New Issue
Block a user