Skip to content

Commit

Permalink
fix: update task interval
Browse files Browse the repository at this point in the history
  • Loading branch information
iamtakagi committed Sep 13, 2024
1 parent a5968a2 commit f11df88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

<groupId>net.iamtakagi</groupId>
<artifactId>medaka</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>

<properties>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -38,7 +38,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -50,7 +50,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.9</version>
<version>1.12.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -108,8 +108,8 @@
</execution>
</executions>
<configuration>
<source>18</source>
<target>18</target>
<source>22</source>
<target>22</target>
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
Expand Down
18 changes: 4 additions & 14 deletions src/main/java/net/iamtakagi/medaka/Medaka.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,18 @@
import java.util.Map;
import java.util.UUID;

/**
* 外部提供される静的中核クラス
*/

public final class Medaka {

/**
* 現在プレイヤーが開いているメニューを格納する HashMap
* キーは Player UUID で管理される
*/

@Getter
private final static Map<UUID, Menu> currentlyOpenedMenus = new HashMap<>();

/**
* メニュー更新タスク
* なんかのときに使えそうなので、一応変数化して置いておく
*/
@Getter
private static BukkitTask menuUpdateTask;

/**
* 初期化処理を行う関数
* 外部から Medaka.init(org.bukkit.plugin.Plugin); を呼び出すことで処理される
* Medaka.init(org.bukkit.plugin.Plugin);
* @param plugin
*/
public static void init (Plugin plugin) {
Expand All @@ -38,7 +28,7 @@ public static void init (Plugin plugin) {
plugin.getServer().getPluginManager().registerEvents(new MenuListener(plugin), plugin);
plugin.getLogger().info("[medaka] イベントリスナーを登録しました");
plugin.getLogger().info("[medaka] MenuUpdateRunnable を起動しています...");
menuUpdateTask = plugin.getServer().getScheduler().runTaskTimer(plugin, new MenuUpdateRunnable(), 20L, 20L);
menuUpdateTask = plugin.getServer().getScheduler().runTaskTimer(plugin, new MenuUpdateRunnable(), 0L, 1L);
plugin.getLogger().info("[medaka] MenuUpdateRunnable を起動しました");
plugin.getLogger().info("[medaka] 初期化が完了しました");
}
Expand Down

0 comments on commit f11df88

Please sign in to comment.