Updates UltimateStacker Dependency+Implementation to API v1.0.0-SNAPSHOT

This commit is contained in:
Christian Koop 2023-08-15 19:02:31 +02:00
parent a259589897
commit 700b293f9c
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
3 changed files with 15 additions and 9 deletions

View File

@ -172,9 +172,9 @@
</dependency>
<dependency>
<groupId>com.songoda</groupId>
<artifactId>UltimateStacker</artifactId>
<version>2.1.1</version>
<groupId>com.craftaro</groupId>
<artifactId>UltimateStacker-API</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -1,18 +1,24 @@
package com.craftaro.skyblock.levelling.calculator.impl;
import com.craftaro.skyblock.levelling.calculator.SpawnerCalculator;
import com.songoda.ultimatestacker.UltimateStacker;
import com.songoda.ultimatestacker.stackable.spawner.SpawnerStack;
import com.craftaro.ultimatestacker.api.UltimateStackerApi;
import com.craftaro.ultimatestacker.api.stack.spawner.SpawnerStack;
import org.bukkit.Bukkit;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.plugin.Plugin;
public class UltimateStackerCalculator implements SpawnerCalculator {
@Override
public long getSpawnerAmount(CreatureSpawner spawner) {
if (!UltimateStacker.getInstance().getConfig().getBoolean("Spawners.Enabled")) {
if (!getUltimateStackerPlugin().getConfig().getBoolean("Spawners.Enabled")) {
return 0;
}
final SpawnerStack stack = UltimateStacker.getInstance().getSpawnerStackManager().getSpawner(spawner.getLocation());
final SpawnerStack stack = UltimateStackerApi.getSpawnerStackManager().getSpawner(spawner.getLocation());
return stack == null ? 0 : stack.getAmount();
}
private Plugin getUltimateStackerPlugin() {
return Bukkit.getPluginManager().getPlugin("UltimateStacker");
}
}

View File

@ -6,8 +6,8 @@ import com.craftaro.skyblock.island.IslandLevel;
import com.craftaro.skyblock.island.IslandManager;
import com.craftaro.skyblock.utils.version.CompatibleSpawners;
import com.craftaro.skyblock.world.WorldManager;
import com.songoda.ultimatestacker.events.SpawnerBreakEvent;
import com.songoda.ultimatestacker.events.SpawnerPlaceEvent;
import com.craftaro.ultimatestacker.api.events.spawner.SpawnerPlaceEvent;
import com.craftaro.ultimatestacker.api.events.spawner.SpawnerBreakEvent;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;