9 Commit-ok 0919a18109 ... 9500000f63

Szerző SHA1 Üzenet Dátum
  MasterCake 9500000f63 Merge pull request #113 from Stabrinai/master 5 hónapja
  MasterCake 7a1a8e79ca Merge branch 'master' into master 5 hónapja
  MasterCake 9d8d8605ae Merge pull request #114 from garbyexe/master 5 hónapja
  Garby 67d4698079 rollback to older versions 5 hónapja
  Garby eb59990572 can't forget the readme 5 hónapja
  Garby 0873d4207c bump version 5 hónapja
  Garby 27da9c71d5 update to java 21 and minecraft 1.20.6 5 hónapja
  Stabrinai b236a088cd Fix onSignChange() 8 hónapja
  Stabrinai 6f3bccd6d9 Support folia used Energie 8 hónapja

+ 8 - 3
Plugin/pom.xml

@@ -7,7 +7,7 @@
 	<parent>
 		<groupId>de.Linus122.TimeIsMoney</groupId>
 		<artifactId>parent</artifactId>
-		<version>1.9.10</version>
+		<version>1.9.11</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
@@ -76,7 +76,7 @@
 		<dependency>
 			<groupId>org.spigotmc</groupId>
 			<artifactId>spigot-api</artifactId>
-			<version>1.18-R0.1-SNAPSHOT</version>
+			<version>1.13.2-R0.1-SNAPSHOT</version>
 			<scope>provided</scope>
 		</dependency>
 		<dependency>
@@ -85,6 +85,11 @@
 			<version>1.7</version>
 			<scope>provided</scope>
 		</dependency>
+		<dependency>
+			<groupId>com.github.Euphillya</groupId>
+			<artifactId>Energie</artifactId>
+			<version>5659f25e22</version>
+		</dependency>
 		<dependency>
 			<groupId>net.ess3</groupId>
 			<artifactId>EssentialsX</artifactId>
@@ -111,7 +116,7 @@
 		<dependency>
 			<groupId>de.Linus122.TimeIsMoney</groupId>
 			<artifactId>Tools</artifactId>
-			<version>1.9.10</version>
+			<version>1.9.11</version>
 		</dependency>
         <dependency>
             <groupId>org.jetbrains</groupId>

+ 3 - 2
Plugin/src/main/java/de/Linus122/TimeIsMoney/ATM.java

@@ -12,6 +12,7 @@ import java.util.Map.Entry;
 import java.util.TreeMap;
 import java.util.UUID;
 
+import fr.euphyllia.energie.model.SchedulerType;
 import org.bukkit.Bukkit;
 import org.bukkit.Material;
 import org.bukkit.OfflinePlayer;
@@ -237,7 +238,7 @@ public class ATM implements Listener, CommandExecutor {
 	/**
 	 * Checks if the player has the specified amount of money in their bank.
 	 *
-	 * @param p The player to check the balance of.
+	 * @param player The player to check the balance of.
 	 * @param amount The amount of money.
 	 * @return True if the player has the specified amount of money, false otherwise.
 	 */
@@ -386,7 +387,7 @@ public class ATM implements Listener, CommandExecutor {
 		final Block b = e.getBlock();
 		
 		if (b.getState() instanceof Sign) {
-			plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
+			Main.scheduler.runDelayed(SchedulerType.SYNC, e.getBlock().getLocation(), task -> {
 				if (b.getState() instanceof Sign) {
 					Sign sign = (Sign) e.getBlock().getState();
 					if (sign.getLine(0).equalsIgnoreCase("[ATM]") 

+ 14 - 5
Plugin/src/main/java/de/Linus122/TimeIsMoney/Main.java

@@ -15,6 +15,9 @@ import java.util.stream.Collectors;
 
 import de.Linus122.TimeIsMoney.data.*;
 import de.Linus122.TimeIsMoney.tools.Utils;
+import fr.euphyllia.energie.Energie;
+import fr.euphyllia.energie.model.Scheduler;
+import fr.euphyllia.energie.model.SchedulerType;
 import org.bukkit.Bukkit;
 import org.bukkit.Location;
 import org.bukkit.Server;
@@ -47,6 +50,10 @@ public class Main extends JavaPlugin {
 	 * The economy being used by vault.
 	 */
 	static net.milkbowl.vault.economy.Economy economy = null;
+	/**
+	 * The scheduler being used by compatible with folia.
+	 */
+	public static Scheduler scheduler;
 	/**
 	 * The config version number.
 	 */
@@ -95,6 +102,7 @@ public class Main extends JavaPlugin {
 	@Override
 	public void onEnable() {
 
+		scheduler = new Energie(this).getScheduler(Energie.SchedulerSoft.MINECRAFT);
 		this.getCommand("timeismoney").setExecutor(new Cmd(this));
 		PL_VERSION = this.getDescription().getVersion();
 		
@@ -163,7 +171,8 @@ public class Main extends JavaPlugin {
 		if (Bukkit.getPluginManager().isPluginEnabled("Essentials") && this.getConfig().getBoolean("afk_use_essentials")) {
 			logger.info("Time is Money: Essentials found. Hook in it -> Will use Essentials's AFK feature if afk is enabled.");
 		}
-		new Metrics(this);
+		if (!Energie.isFolia())
+			new Metrics(this);
 		
 		logger.info(CC("&aTime is Money &2v" + PL_VERSION + " &astarted."));
 	}
@@ -172,7 +181,7 @@ public class Main extends JavaPlugin {
 		String intervalString = getConfig().getString("global_interval", getConfig().getInt("give_money_every_second") + "s");
 		int globalTimerSeconds = Utils.parseTimeFormat(intervalString);
 
-		playtimeWatcherTask = Bukkit.getScheduler().runTaskTimer(this, () -> {
+		scheduler.runAtFixedRate(SchedulerType.SYNC, task -> {
 			for (Player player : Bukkit.getOnlinePlayers()) {
 				if (disabledWorlds.contains(player.getWorld().getName())) continue;
 				PlayerData playerData = this.pluginData.getPlayerData(player);
@@ -205,7 +214,7 @@ public class Main extends JavaPlugin {
 	 */
 	@Override
 	public void onDisable() {
-		playtimeWatcherTask.cancel();
+		scheduler.cancelAllTask();
 
 		this.pluginData.saveData();
 
@@ -473,7 +482,7 @@ public class Main extends JavaPlugin {
 	private void dispatchCommandSync(final String cmd) {
 		final Server server = this.getServer();
 		
-		this.getServer().getScheduler().runTask(this, () -> server.dispatchCommand(server.getConsoleSender(), cmd));
+		scheduler.runTask(SchedulerType.SYNC, task -> server.dispatchCommand(server.getConsoleSender(), cmd));
 	}
 	
 	/**
@@ -538,7 +547,7 @@ public class Main extends JavaPlugin {
 			
 			times--;
 			for (int i = 0; i < times; i++) {
-				Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> sendSingleActionbarMessage(player, applyPlaceholders(player, CC(message))), 20L * i);
+				scheduler.runDelayed(SchedulerType.SYNC, task -> sendSingleActionbarMessage(player, applyPlaceholders(player, CC(message))), 20L * i);
 			}
 		}
 	}

+ 5 - 0
Plugin/src/main/resources/plugin.yml

@@ -4,7 +4,12 @@ description: Gives money for online time
 author: Linus122
 website: "https://www.spigotmc.org/resources/time-is-money.12409/"
 main: de.Linus122.TimeIsMoney.Main
+<<<<<<< master
 api-version: 1.13
+folia-supported: true
+=======
+api-version: 1.13.2
+>>>>>>> master
 
 depend: [Vault]
 softdepend: [Essentials, PlaceholderAPI]

+ 1 - 1
README.md

@@ -7,7 +7,7 @@
 [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5ATDE93C6J3WE&source=url)
 
 ## Welcome to the TimeIsMoney GitHub repository!
-TimeIsMoney is a Spigot plugin compatible with Spigot versions 1.7 through 1.18.*, that gives players money for their time online!
+TimeIsMoney is a Spigot plugin compatible with Spigot versions 1.7 through 1.20.6, that gives players money for their time online!
 
 In order for everyone to have the best experience possible, we have a few guidelines that everyone must follow.    
 - For all things on GitHub, please make sure you follow the [code of conduct](CODE_OF_CONDUCT.md).  

+ 1 - 1
Tools/pom.xml

@@ -7,7 +7,7 @@
     <parent>
         <groupId>de.Linus122.TimeIsMoney</groupId>
         <artifactId>parent</artifactId>
-        <version>1.9.10</version>
+        <version>1.9.11</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

+ 1 - 1
pom.xml

@@ -6,7 +6,7 @@
 
     <groupId>de.Linus122.TimeIsMoney</groupId>
     <artifactId>parent</artifactId>
-    <version>1.9.10</version>
+    <version>1.9.11</version>
     <name>TimeIsMoney</name>
     <url>https://www.spigotmc.org/resources/time-is-money.12409/</url>
     <packaging>pom</packaging>