Skip to content

Commit

Permalink
Release v5.0.0-SNAPSHOT-b5. Updates to new db system, updates Ultimat…
Browse files Browse the repository at this point in the history
…eStacker compatiblility.
  • Loading branch information
ceze88 committed Aug 4, 2023
1 parent 332a058 commit 7a612f7
Show file tree
Hide file tree
Showing 35 changed files with 1,188 additions and 1,013 deletions.
3 changes: 2 additions & 1 deletion EpicHoppers-API/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
<parent>
<groupId>com.craftaro</groupId>
<artifactId>EpicHoppers-Parent</artifactId>
<version>5.0.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT-b5</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>EpicHoppers-API</artifactId>
<version>1.0.0-SNAPSHOT</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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() {
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

This file was deleted.

Loading

0 comments on commit 7a612f7

Please sign in to comment.