Skip to content

Commit 4c9eb20

Browse files
committed
Fix PlaceholderAPI integration. v1.0.1 Update!
1 parent 569bd41 commit 4c9eb20

7 files changed

Lines changed: 14 additions & 10 deletions

File tree

doublejump-api/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group = "com.github.imdmk"
2-
version = "1.0.0"
2+
version = "1.0.1"
33

44
repositories {
55
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")

doublejump-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = "com.github.imdmk"
8-
version = "1.0.0"
8+
version = "1.0.1"
99

1010
repositories {
1111
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") // SpigotMC

doublejump-plugin/src/main/java/com/github/imdmk/doublejump/jump/feature/item/JumpItemService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
public class JumpItemService {
2121

22-
@Inject private JumpConfig jumpConfig;
22+
@Inject private JumpConfig config;
2323

2424
/**
2525
* Checks whether the provided item matches the configured jump item.
@@ -84,8 +84,8 @@ public boolean isJumpItem(@Nullable ItemStack compare) {
8484
*
8585
* @return the jump {@link ItemStack}
8686
*/
87-
public JumpItem getJumpItem() {
88-
return this.jumpConfig.item.item;
87+
public @NotNull JumpItem getJumpItem() {
88+
return this.config.item.item;
8989
}
9090

9191
/**
@@ -94,7 +94,7 @@ public JumpItem getJumpItem() {
9494
* @return {@code true} if enabled, {@code false} otherwise
9595
*/
9696
public boolean isEnabled() {
97-
return this.jumpConfig.item.enabled;
97+
return this.config.item.enabled;
9898
}
9999

100100
/**
@@ -104,6 +104,6 @@ public boolean isEnabled() {
104104
* @return {@code true} if enabled and matches the given usage mode
105105
*/
106106
public boolean isEnabled(@NotNull ItemUsage usage) {
107-
return this.isEnabled() && this.jumpConfig.item.usageMode.equals(usage);
107+
return this.isEnabled() && this.config.item.usageMode.equals(usage);
108108
}
109109
}

doublejump-plugin/src/main/java/com/github/imdmk/doublejump/jump/feature/placeholder/JumpAllowedPlaceholder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
public class JumpAllowedPlaceholder extends PluginPlaceholder {
1313

14-
private static final String PLACEHOLDER_IDENTIFIER = "doublejump_allowed";
14+
private static final String PLACEHOLDER_IDENTIFIER = "doublejump-allowed";
1515

1616
@Inject private JumpConfig config;
1717
@Inject private JumpPlayerCache cache;

doublejump-plugin/src/main/java/com/github/imdmk/doublejump/jump/feature/placeholder/JumpCooldownPlaceholder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
public class JumpCooldownPlaceholder extends PluginPlaceholder {
2121

22-
private static final String PLACEHOLDER_IDENTIFIER = "doublejump_cooldown";
22+
private static final String PLACEHOLDER_IDENTIFIER = "doublejump-cooldown";
2323

2424
@Inject private JumpConfig config;
2525
@Inject private JumpPlayerCache cache;

doublejump-plugin/src/main/java/com/github/imdmk/doublejump/jump/feature/placeholder/JumpPlaceholderConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public class JumpPlaceholderConfig extends OkaeriConfig {
1111
})
1212
public boolean enabled = true;
1313

14+
@Comment("# Text to display when the player's doublejump mode is deactivated.")
15+
public String jumpDisabledText = "doublejump disabled";
16+
1417
@Comment({
1518
"# Text to display when the player's cooldown has expired or is not set.",
1619
"# Example: 'ready', 'now', '✓'"

doublejump-plugin/src/main/java/com/github/imdmk/doublejump/util/DurationUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public final class DurationUtil {
2323
.withUnit("y", ChronoUnit.YEARS);
2424

2525
private static final long MILLIS_PER_TICK = 50L;
26+
private static final long ONE_SECOND_IN_MILLIS = 1000L;
2627

2728
private DurationUtil() {
2829
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated.");
@@ -36,7 +37,7 @@ private DurationUtil() {
3637
* @return a formatted string or {@code "<1s"}
3738
*/
3839
public static @NotNull String format(@NotNull Duration duration) {
39-
if (!isValid(duration)) {
40+
if (duration.toMillis() < ONE_SECOND_IN_MILLIS || !isValid(duration)) {
4041
return "<1s";
4142
}
4243

0 commit comments

Comments
 (0)