Skip to content

Commit

Permalink
Fix issues with wrongly scheduled location calls
Browse files Browse the repository at this point in the history
  • Loading branch information
NahuLD committed Jun 28, 2024
1 parent 27e73bb commit cc661f7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 87 deletions.
79 changes: 0 additions & 79 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
plugins {
alias(libs.plugins.minotaur)
alias(libs.plugins.hangar)

`java-plugin`
}

Expand All @@ -14,79 +11,3 @@ val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)
subprojects.filter { it.name != "api" }.forEach {
it.project.version = rootProject.version
}

modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))

projectId.set(rootProject.name.lowercase())

versionType.set(if (isSnapshot) "beta" else "release")

versionName.set("${rootProject.name} ${rootProject.version}")
versionNumber.set(rootProject.version as String)

changelog.set(content)

uploadFile.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))

gameVersions.set(listOf(
"1.20.6"
))

loaders.add("paper")
loaders.add("purpur")
loaders.add("folia")

autoAddDependsOn.set(false)
detectLoaders.set(false)

/*dependencies {
optional.version("fancyholograms", "2.0.6")
}**/
}

hangarPublish {
publications.register("plugin") {
apiKey.set(System.getenv("HANGAR_KEY"))

id.set(rootProject.name.lowercase())

version.set(rootProject.version as String)

channel.set(if (isSnapshot) "Snapshot" else "Release")

changelog.set(content)

platforms {
paper {
jar.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))

platformVersions.set(listOf(
"1.20.6"
))

dependencies {
hangar("PlaceholderAPI") {
required = false
}

/*hangar("FancyHolograms") {
required = false
}**/

url("Oraxen", "https://www.spigotmc.org/resources/%E2%98%84%EF%B8%8F-oraxen-custom-items-blocks-emotes-furniture-resourcepack-and-gui-1-18-1-20-4.72448/") {
required = false
}

url("CMI", "https://www.spigotmc.org/resources/cmi-298-commands-insane-kits-portals-essentials-economy-mysql-sqlite-much-more.3742/") {
required = false
}

url("DecentHolograms", "https://www.spigotmc.org/resources/decentholograms-1-8-1-20-4-papi-support-no-dependencies.96927/") {
required = false
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ oraxen = "1.171.0"
annotations = "24.1.0"
crazycrates = "0.6"
gson = "2.10.1"
vital = "1.4"
vital = "1.5.9"

decentholograms = "2.8.8"
fancyholograms = "2.0.6"
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -909,12 +909,18 @@ public void cleanLocations() {

for (Block spawnedLocation : locations) {
if (spawnedLocation != null) {
if (!spawnedLocation.getChunk().isLoaded()) spawnedLocation.getChunk().load();
new FoliaRunnable(this.plugin.getServer().getRegionScheduler(), spawnedLocation.getLocation()) {
@Override
public void run() {
if (!spawnedLocation.getChunk().isLoaded()) spawnedLocation.getChunk().load();

spawnedLocation.setType(Material.AIR);
stopSignalFlare(spawnedLocation.getLocation());
spawnedLocation.setType(Material.AIR);
stopSignalFlare(spawnedLocation.getLocation());
}
}.run(this.plugin);

if (hasHologramPlugin()) this.hologramController.removeAllHolograms();

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.badbones69.crazyenvoys.api.objects.misc.Tier;
import com.badbones69.crazyenvoys.util.MsgUtils;
import com.ryderbelserion.vital.paper.enums.Support;
import com.ryderbelserion.vital.paper.util.scheduler.FoliaRunnable;
import me.clip.placeholderapi.PlaceholderAPI;
import org.bukkit.GameMode;
import org.bukkit.Material;
Expand Down Expand Up @@ -158,11 +159,16 @@ public void onPlayerClick(PlayerInteractEvent event) {
}
}

for (String cmd : prize.getCommands()) {
if (Support.placeholder_api.isEnabled()) cmd = PlaceholderAPI.setPlaceholders(player, cmd);
new FoliaRunnable(this.plugin.getServer().getGlobalRegionScheduler()) {
@Override
public void run() {
for (String cmd : prize.getCommands()) {
if (Support.placeholder_api.isEnabled()) cmd = PlaceholderAPI.setPlaceholders(player, cmd);

this.plugin.getServer().dispatchCommand(this.plugin.getServer().getConsoleSender(), cmd.replace("{player}", player.getName()).replaceAll("\\{tier}", quoteReplacement(prize.getDisplayName())));
}
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), cmd.replace("{player}", player.getName()).replaceAll("\\{tier}", quoteReplacement(prize.getDisplayName())));
}
}
}.run(this.plugin);

for (ItemStack item : prize.getItems()) {
if (prize.getDropItems()) {
Expand Down

0 comments on commit cc661f7

Please sign in to comment.