Skip to content

Commit 948efe6

Browse files
author
Xyness
committed
1.11.8.1
1 parent 5426486 commit 948efe6

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

src/main/java/fr/xyness/SCS/Listeners/ClaimGuiEvents.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,7 @@ public void onInventoryClose(InventoryCloseEvent event) {
8585
Inventory inv = event.getInventory();
8686
InventoryHolder holder = inv.getHolder();
8787
if(holder instanceof ClaimConfirmationGui) {
88-
if(instance.isFolia()) {
89-
Bukkit.getAsyncScheduler().runDelayed(instance, task -> ClaimCommand.isOnCreate.remove(player), 500, TimeUnit.MILLISECONDS);
90-
} else {
91-
Bukkit.getScheduler().runTaskLaterAsynchronously(instance, () -> ClaimCommand.isOnCreate.remove(player), 10L);
92-
}
88+
instance.executeAsyncLater(() -> ClaimCommand.isOnCreate.remove(player), 500);
9389
}
9490
}
9591

src/main/java/fr/xyness/SCS/SimpleClaimSystem.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.Set;
2424
import java.util.UUID;
2525
import java.util.concurrent.CompletableFuture;
26+
import java.util.concurrent.TimeUnit;
2627
import java.util.function.Consumer;
2728

2829
import org.bukkit.Bukkit;
@@ -111,7 +112,7 @@ public class SimpleClaimSystem extends JavaPlugin {
111112
private SimpleClaimSystem instance;
112113

113114
/** The version of the plugin */
114-
private String Version = "1.11.8";
115+
private String Version = "1.11.8.1";
115116

116117
/** Data source for database connections */
117118
private HikariDataSource dataSource;
@@ -1408,6 +1409,19 @@ public void executeAsync(Runnable gTask) {
14081409
}
14091410
}
14101411

1412+
/**
1413+
* Executes a task asynchronously.
1414+
*
1415+
* @param gTask The task to execute
1416+
*/
1417+
public void executeAsyncLater(Runnable gTask, long delay) {
1418+
if (isFolia) {
1419+
Bukkit.getAsyncScheduler().runDelayed(instance, task -> gTask.run(), delay, TimeUnit.MILLISECONDS);
1420+
} else {
1421+
Bukkit.getScheduler().runTaskLaterAsynchronously(instance, gTask, (delay/1000)*20);
1422+
}
1423+
}
1424+
14111425
/**
14121426
* Executes a task synchronously.
14131427
*

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: SimpleClaimSystem
2-
version: 1.11.8
2+
version: 1.11.8.1
33
main: fr.xyness.SCS.SimpleClaimSystem
44
authors: [Xyness]
55
softdepend: [PlaceholderAPI, WorldGuard, Vault, dynmap, BlueMap, pl3xmap, GriefPrevention]

version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.11.8
1+
1.11.8.1

0 commit comments

Comments
 (0)