Skip to content

Commit

Permalink
Update to v2.6d
Browse files Browse the repository at this point in the history
  • Loading branch information
Efnilite committed Oct 15, 2021
1 parent e4700b0 commit bae7710
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>dev.efnilite</groupId>
<artifactId>WITP</artifactId>
<version>2.6c</version>
<version>2.6d</version>
<build>
<plugins>
<plugin>
Expand Down
41 changes: 20 additions & 21 deletions src/main/java/dev/efnilite/witp/generator/DefaultGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,31 +168,23 @@ public void run() {

latestLocation = current.getLocation();

List<String> locations = new ArrayList<>(buildLog.keySet());
if (!Option.ALL_POINTS) {
addPoint();
} else if (score == 0) {
addPoint();
}

List<String> locations = new ArrayList<>(buildLog.keySet()); // delete blocks
int lastIndex = locations.indexOf(last) + 1;
int size = locations.size();
if (Option.ALL_POINTS) {
if (score == 0) {
score++;
totalScore++;
score();
checkRewards();
}
for (int i = lastIndex; i < size; i++) {
Block block = Util.parseLocation(locations.get(i)).getBlock();
if (block.getType() != Material.AIR) {
score++;
totalScore++;
score();
checkRewards();
block.setType(Material.AIR);
for (int i = lastIndex; i < size; i++) {
Block block = Util.parseLocation(locations.get(i)).getBlock();
if (block.getType() != Material.AIR) {
if (Option.ALL_POINTS) {
addPoint();
}
block.setType(Material.AIR);
}
} else {
score++;
totalScore++;
score();
checkRewards();
}

new PlayerScoreEvent(player).call();
Expand All @@ -213,6 +205,13 @@ public void run() {
Tasks.defaultSyncRepeat(task, Option.GENERATOR_CHECK);
}

private void addPoint() {
score++;
totalScore++;
score();
checkRewards();
}

private void checkRewards() {
// Rewards
HashMap<Integer, List<String>> scores = Option.REWARDS_SCORES;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'WITP'
description: 'Automatically generating, infinitely long parkour plugin. The sky, and your time, is the limit. The further you go, the harder it gets. Should be a walk in the park, right?'
author: Efnilite, Ice_Pancake
version: 2.6c
version: 2.6d
api-version: 1.16
main: dev.efnilite.witp.WITP
softdepend: [Vault, PlaceholderAPI, ProtocolAPI, Multiverse-Core, WVoidGen, VoidGen]
Expand Down

0 comments on commit bae7710

Please sign in to comment.