Skip to content

Commit

Permalink
Update to AuroraLib 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSzabo committed Nov 5, 2024
1 parent da85745 commit 2ef6471
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}

group = "gg.auroramc"
version = "1.3.4"
version = "1.3.5"

repositories {
mavenCentral()
Expand All @@ -40,7 +40,7 @@ repositories {

dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.3-R0.1-SNAPSHOT")
compileOnly("gg.auroramc:Aurora:1.6.0")
compileOnly("gg.auroramc:Aurora:2.0.0-SNAPSHOT")
compileOnly("gg.auroramc:AuroraLevels:1.5.1")
compileOnly("net.luckperms:api:5.4")
compileOnly("dev.aurelium:auraskills-api-bukkit:2.2.0")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gg/auroramc/quests/api/data/QuestData.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void removeQuestStartUnlock(String poolId, String questId) {
public void progress(String poolId, String questId, String taskId, double count) {
progression.computeIfAbsent(poolId, k -> Maps.newConcurrentMap())
.computeIfAbsent(questId, k -> Maps.newConcurrentMap())
.merge(taskId, count, Double::sum);
.merge(taskId, count, (a, b) -> Math.max(a + b, 0));
dirty.set(true);
}

Expand Down
14 changes: 6 additions & 8 deletions src/main/java/gg/auroramc/quests/listener/BuildingListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ public void onBlockPlace(BlockPlaceEvent event) {

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockBreak(RegionBlockBreakEvent event) {
OfflinePlayer player = event.getPlayerWhoPlaced();
Player player1 = event.getPlayerWhoBroke();


final Block block = event.getBlock();
if (player == null) return;
if (player.getUniqueId().equals(player1.getUniqueId())) {
AuroraQuests.getInstance().getQuestManager().progress(player1, TaskType.BUILD, -1, Map.of("type", TypeId.from(block.getType())));
Player player = event.getPlayerWhoBroke();
if (player.hasMetadata("NPC")) {
return;
}

final Block block = event.getBlock();
AuroraQuests.getInstance().getQuestManager().progress(player, TaskType.BUILD, -1, Map.of("type", TypeId.from(block.getType())));
}
}

0 comments on commit 2ef6471

Please sign in to comment.