diff --git a/EpicHoppers-API/pom.xml b/EpicHoppers-API/pom.xml
index 2ad216f..deb0feb 100644
--- a/EpicHoppers-API/pom.xml
+++ b/EpicHoppers-API/pom.xml
@@ -7,10 +7,11 @@
com.craftaro
EpicHoppers-Parent
- 5.0.0-SNAPSHOT
+ 5.0.0-SNAPSHOT-b5
../pom.xml
EpicHoppers-API
+ 1.0.0-SNAPSHOT
diff --git a/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/EpicHoppersApi.java b/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/EpicHoppersApi.java
index f99a3ab..e133db7 100644
--- a/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/EpicHoppersApi.java
+++ b/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/EpicHoppersApi.java
@@ -1,8 +1,8 @@
package com.craftaro.epichoppers;
+import com.craftaro.core.database.DataManager;
import com.craftaro.epichoppers.boost.BoostManager;
import com.craftaro.epichoppers.containers.ContainerManager;
-import com.craftaro.epichoppers.database.DataManager;
import com.craftaro.epichoppers.hopper.teleport.TeleportHandler;
import com.craftaro.epichoppers.player.PlayerDataManager;
import com.craftaro.epichoppers.hopper.levels.LevelManager;
@@ -16,20 +16,16 @@ public class EpicHoppersApi {
private final ContainerManager containerManager;
private final TeleportHandler teleportHandler;
private final PlayerDataManager playerDataManager;
- private final DataManager dataManager;
-
private EpicHoppersApi(LevelManager levelManager,
BoostManager boostManager,
ContainerManager containerManager,
TeleportHandler teleportHandler,
- PlayerDataManager playerDataManager,
- DataManager dataManager) {
+ PlayerDataManager playerDataManager) {
this.levelManager = levelManager;
this.boostManager = boostManager;
this.containerManager = containerManager;
this.teleportHandler = teleportHandler;
this.playerDataManager = playerDataManager;
- this.dataManager = dataManager;
}
public LevelManager getLevelManager() {
@@ -52,22 +48,14 @@ public PlayerDataManager getPlayerDataManager() {
return this.playerDataManager;
}
- /**
- * TODO: The DataManager probably shouldn't be exposed to the API.
- */
- @ApiStatus.Internal
- public DataManager getDataManager() {
- return this.dataManager;
- }
-
public static EpicHoppersApi getApi() {
return instance;
}
- static void initApi(LevelManager levelManager, BoostManager boostManager, ContainerManager containerManager, TeleportHandler teleportHandler, PlayerDataManager playerDataManager, DataManager dataManager) {
+ static void initApi(LevelManager levelManager, BoostManager boostManager, ContainerManager containerManager, TeleportHandler teleportHandler, PlayerDataManager playerDataManager) {
if (instance != null) {
throw new IllegalStateException(EpicHoppersApi.class.getSimpleName() + " already initialized");
}
- instance = new EpicHoppersApi(levelManager, boostManager, containerManager, teleportHandler, playerDataManager, dataManager);
+ instance = new EpicHoppersApi(levelManager, boostManager, containerManager, teleportHandler, playerDataManager);
}
}
diff --git a/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/boost/BoostData.java b/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/boost/BoostData.java
index 7011c45..f472a6a 100644
--- a/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/boost/BoostData.java
+++ b/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/boost/BoostData.java
@@ -3,52 +3,23 @@
import java.util.Objects;
import java.util.UUID;
-public class BoostData {
- private final int multiplier;
- private final long endTime;
- private final UUID player;
-
- public BoostData(int multiplier, long endTime, UUID player) {
- this.multiplier = multiplier;
- this.endTime = endTime;
- this.player = player;
- }
-
- public int getMultiplier() {
- return this.multiplier;
- }
-
- public UUID getPlayer() {
- return this.player;
- }
-
- public long getEndTime() {
- return this.endTime;
- }
-
- @Override
- public int hashCode() {
- int result = 31 * this.multiplier;
-
- result = 31 * result + (this.player == null ? 0 : this.player.hashCode());
- result = 31 * result + (int) (this.endTime ^ (this.endTime >>> 32));
-
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof BoostData)) {
- return false;
- }
-
- BoostData other = (BoostData) obj;
- return this.multiplier == other.multiplier &&
- this.endTime == other.endTime &&
- Objects.equals(this.player, other.player);
- }
-
+public interface BoostData {
+
+ /**
+ * Gets the multiplier of the boost
+ * @return The multiplier
+ */
+ int getMultiplier();
+
+ /**
+ * Gets the player's uuid who has the boost
+ * @return The player's uuid
+ */
+ public UUID getPlayer();
+
+ /**
+ * Gets the end time of the boost
+ * @return The end time
+ */
+ public long getEndTime();
}
diff --git a/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/database/DataManager.java b/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/database/DataManager.java
deleted file mode 100644
index c6a0552..0000000
--- a/EpicHoppers-API/src/main/java/com/craftaro/epichoppers/database/DataManager.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.craftaro.epichoppers.database;
-
-import com.craftaro.epichoppers.boost.BoostData;
-import com.craftaro.epichoppers.hopper.Hopper;
-import com.craftaro.epichoppers.hopper.ItemType;
-import com.craftaro.epichoppers.hopper.LinkType;
-import org.bukkit.Location;
-import org.bukkit.inventory.ItemStack;
-
-import java.util.List;
-import java.util.Map;
-import java.util.function.Consumer;
-
-public interface DataManager {
- void createBoost(BoostData boostData);
-
- void getBoosts(Consumer> callback);
-
- void deleteBoost(BoostData boostData);
-
- void createLink(Hopper hopper, Location location, LinkType type);
-
- void updateItems(Hopper hopper, ItemType type, List items);
-
- void deleteLink(Hopper hopper, Location location);
-
- void deleteLinks(Hopper hopper);
-
- void createHoppers(List hoppers);
-
- void createHopper(Hopper hopper);
-
- void updateHopper(Hopper hopper);
-
- void deleteHopper(Hopper hopper);
-
- void getHoppers(Consumer