Skip to content

Commit

Permalink
Added Syncronised Access
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachesMLG committed Aug 12, 2023
1 parent 593d48e commit 6d3c4dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
implementation("org.jetbrains:annotations:24.0.1")
implementation("com.j256.ormlite:ormlite-core:6.1")
implementation("com.j256.ormlite:ormlite-jdbc:6.1")
implementation("com.iridium:IridiumTeams:2.1.2")
implementation("com.iridium:IridiumTeams:2.1.4")

// Other dependencies that are not required or already available at runtime
compileOnly("org.projectlombok:lombok:1.18.26")
Expand All @@ -45,7 +45,7 @@ tasks {

shadowJar {
fun relocate(origin: String) =
relocate(origin, "com.iridium.iridiumskyblock.dependencies${origin.substring(origin.lastIndexOf('.'))}")
relocate(origin, "com.iridium.iridiumskyblock.dependencies${origin.substring(origin.lastIndexOf('.'))}")

// Remove the archive classifier suffix
archiveClassifier.set("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void deleteTeam(Island island, User user) {
}

@Override
public boolean getTeamPermission(Island island, int rank, String permission) {
public synchronized boolean getTeamPermission(Island island, int rank, String permission) {
if (rank == Rank.OWNER.getId()) return true;
return IridiumSkyblock.getInstance().getDatabaseManager().getPermissionsTableManager().getEntry(new TeamPermission(island, permission, rank, true))
.map(TeamPermission::isAllowed)
Expand Down Expand Up @@ -320,7 +320,7 @@ public synchronized TeamSetting getTeamSetting(Island island, String settingKey)
}

@Override
public TeamEnhancement getTeamEnhancement(Island island, String enhancementName) {
public synchronized TeamEnhancement getTeamEnhancement(Island island, String enhancementName) {
Optional<TeamEnhancement> teamEnhancement = IridiumSkyblock.getInstance().getDatabaseManager().getEnhancementTableManager().getEntry(new TeamEnhancement(island, enhancementName, 0));
if (teamEnhancement.isPresent()) {
return teamEnhancement.get();
Expand Down Expand Up @@ -435,7 +435,7 @@ public List<TeamMission> getTeamMissions(Island island) {
}

@Override
public TeamMission getTeamMission(Island island, String missionName) {
public synchronized TeamMission getTeamMission(Island island, String missionName) {
Mission mission = IridiumSkyblock.getInstance().getMissions().missions.get(missionName);
LocalDateTime localDateTime = IridiumSkyblock.getInstance().getMissionManager().getExpirationTime(mission == null ? MissionType.ONCE : mission.getMissionType(), LocalDateTime.now());

Expand All @@ -452,7 +452,7 @@ public TeamMission getTeamMission(Island island, String missionName) {
}

@Override
public TeamMissionData getTeamMissionData(TeamMission teamMission, int missionIndex) {
public synchronized TeamMissionData getTeamMissionData(TeamMission teamMission, int missionIndex) {
Optional<TeamMissionData> teamMissionData = IridiumSkyblock.getInstance().getDatabaseManager().getTeamMissionDataTableManager().getEntry(new TeamMissionData(teamMission, missionIndex));
if (teamMissionData.isPresent()) {
return teamMissionData.get();
Expand Down

0 comments on commit 6d3c4dc

Please sign in to comment.