Skip to content

Commit

Permalink
feat: support folia
Browse files Browse the repository at this point in the history
  • Loading branch information
NCT-skyouo committed Sep 29, 2024
1 parent 55c3d7e commit a4d5224
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ compileJava.options.encoding = 'UTF-8'

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

repositories {
mavenCentral()
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots' }
maven { url 'https://repo.papermc.io/repository/maven-public/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
maven { url 'https://repo.skriptlang.org/releases' }
Expand All @@ -23,7 +23,7 @@ repositories {
}

dependencies {
implementation 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
implementation 'io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT'
implementation ('com.github.SkriptLang:Skript:2.7.3') {
transitive = false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.apickledwalrus.skriptplaceholders.placeholder;

import ch.njol.skript.Skript;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public boolean load() {
if (Bukkit.isPrimaryThread()) {
registry.registerPlaceholder(plugin, placeholder, this);
} else {
Bukkit.getScheduler().runTask(SkriptPlaceholders.getInstance(),
() -> registry.registerPlaceholder(plugin, placeholder, this)
Bukkit.getGlobalRegionScheduler().run(SkriptPlaceholders.getInstance(),
(ignored) -> registry.registerPlaceholder(plugin, placeholder, this)
);
}

Expand All @@ -136,8 +136,8 @@ public void unload() {
if (Bukkit.isPrimaryThread()) {
registry.unregisterPlaceholder(plugin, placeholder, this);
} else {
Bukkit.getScheduler().runTask(SkriptPlaceholders.getInstance(),
() -> registry.unregisterPlaceholder(plugin, placeholder, this)
Bukkit.getGlobalRegionScheduler().run(SkriptPlaceholders.getInstance(),
(ignored) -> registry.unregisterPlaceholder(plugin, placeholder, this)
);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ version: @version@
authors: [APickledWalrus, Pikachu920]
description: Allows using and registering placeholders with PlaceholderAPI and MVdWPlaceholderAPI in Skript.
website: https://github.com/APickledWalrus/skript-placeholders
folia-supported: true
softdepend: [Skript, PlaceholderAPI, MVdWPlaceholderAPI]

0 comments on commit a4d5224

Please sign in to comment.