Skip to content

Commit

Permalink
Moved to a more robust folia wrapper
Browse files Browse the repository at this point in the history
Also added the first author to plugin.yml
  • Loading branch information
sarhatabaot committed Mar 12, 2024
1 parent 4713d65 commit 967ac51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ repositories {
maven("https://repo.codemc.org/repository/maven-public")
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://nexuslite.gcnt.net/repos/other/")
maven("https://mvn-repo.arim.space/lesser-gpl3/")
}

dependencies {
Expand All @@ -25,14 +26,14 @@ dependencies {
implementation(libs.nbt.api)
implementation(libs.bstats)
implementation(libs.acf.paper)
implementation(libs.folia.lib)
implementation(libs.more.paper)
implementation(libs.annotations)
}

bukkit {
main = "com.github.sarhatabaot.farmassistreboot.FarmAssistReboot"
name = "FarmAssistReboot"
authors = listOf("sarhatabaot")
authors = listOf("Friendly Baron","sarhatabaot")
website = "https://github.com/sarhatabaot/FarmAssistReboot"
description = "Allow players to auto-replant crops."
apiVersion = "1.13"
Expand Down Expand Up @@ -108,6 +109,7 @@ tasks {

shadowJar {
minimize()
archiveClassifier.set("")

relocate("org.bstats", "com.github.sarhatabaot.farmassistreboot.metrics")
relocate("co.aikar.commands", "com.github.sarhatabaot.farmassistreboot.acf")
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencyResolutionManagement {
library("bstats", "org.bstats:bstats-bukkit:3.0.2")
library("nbt-api", "de.tr7zw:item-nbt-api-plugin:2.12.2")
library("annotations", "org.jetbrains:annotations:24.1.0")
library("folia-lib", "com.tcoded:FoliaLib:0.2.5") //move to A248
library("more-paper", "space.arim.morepaperlib:morepaperlib:0.4.3")

version("plugin-yml", "0.6.0")
plugin("plugin-yml-bukkit", "net.minecrell.plugin-yml.bukkit").versionRef("plugin-yml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import com.github.sarhatabaot.farmassistreboot.listeners.JoinListener;
import com.github.sarhatabaot.farmassistreboot.listeners.PlayerInteractionListener;
import com.github.sarhatabaot.farmassistreboot.tasks.SimpleUpdateCheckerTask;
import com.tcoded.folialib.FoliaLib;
import lombok.Getter;
import lombok.Setter;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import space.arim.morepaperlib.MorePaperLib;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -25,7 +25,7 @@
*/
@Getter @Setter
public class FarmAssistReboot extends JavaPlugin {
private FoliaLib foliaLib = new FoliaLib(this);
private MorePaperLib paperLib = new MorePaperLib(this);
private LanguageManager languageManager;
private List<UUID> disabledPlayerList = new ArrayList<>();
private FarmAssistConfig assistConfig;
Expand All @@ -50,7 +50,7 @@ public void onEnable() {
registerListeners();
Util.init(this);
if (FarmAssistConfig.CHECK_FOR_UPDATES) {
foliaLib.getImpl().runAsync(new SimpleUpdateCheckerTask(this));
this.paperLib.scheduling().asyncScheduler().run(new SimpleUpdateCheckerTask(this));
}

new Metrics(this,3885);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static void replant(@NotNull Player player, Block block, int spot) {
debug("CONFIG:no-seeds: %b, PERMISSION:farmassist.no_seeds: %b", FarmAssistConfig.NO_SEEDS, player.hasPermission(Permissions.NO_SEEDS));
if (spot >= 0 || Util.checkNoSeeds(player)) {
removeOrSubtractItem(player, spot);
plugin.getFoliaLib().getImpl().runAtLocationLater(block.getLocation(), new ReplantTask(block,plugin), 5L);
plugin.getPaperLib().scheduling().regionSpecificScheduler(block.getLocation()).runDelayed(new ReplantTask(block,plugin), 5L);
}
}

Expand Down

0 comments on commit 967ac51

Please sign in to comment.