papermc-skill 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/LICENSE +21 -0
  3. package/README.md +169 -0
  4. package/bin/cli.js +307 -0
  5. package/docs/01-modern-paper-architecture.md +172 -0
  6. package/docs/02-adventure-and-minimessage.md +160 -0
  7. package/docs/03-persistent-data-container.md +179 -0
  8. package/docs/04-commands-and-brigadier.md +157 -0
  9. package/docs/05-concurrency-and-folia.md +150 -0
  10. package/docs/06-events-and-listeners.md +163 -0
  11. package/docs/07-best-practices-and-perf.md +118 -0
  12. package/docs/08-gui-and-menus.md +198 -0
  13. package/docs/09-custom-items-and-combat.md +171 -0
  14. package/docs/10-database-and-storage.md +187 -0
  15. package/package.json +44 -0
  16. package/skills/paper-plugin-dev/SKILL.md +167 -0
  17. package/templates/paper-modern-template/.editorconfig +8 -0
  18. package/templates/paper-modern-template/.gradle/9.4.1/checksums/checksums.lock +0 -0
  19. package/templates/paper-modern-template/.gradle/9.4.1/checksums/md5-checksums.bin +0 -0
  20. package/templates/paper-modern-template/.gradle/9.4.1/checksums/sha1-checksums.bin +0 -0
  21. package/templates/paper-modern-template/.gradle/9.4.1/executionHistory/executionHistory.bin +0 -0
  22. package/templates/paper-modern-template/.gradle/9.4.1/executionHistory/executionHistory.lock +0 -0
  23. package/templates/paper-modern-template/.gradle/9.4.1/fileChanges/last-build.bin +0 -0
  24. package/templates/paper-modern-template/.gradle/9.4.1/fileHashes/fileHashes.bin +0 -0
  25. package/templates/paper-modern-template/.gradle/9.4.1/fileHashes/fileHashes.lock +0 -0
  26. package/templates/paper-modern-template/.gradle/9.4.1/fileHashes/resourceHashesCache.bin +0 -0
  27. package/templates/paper-modern-template/.gradle/9.4.1/gc.properties +0 -0
  28. package/templates/paper-modern-template/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  29. package/templates/paper-modern-template/.gradle/buildOutputCleanup/cache.properties +2 -0
  30. package/templates/paper-modern-template/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  31. package/templates/paper-modern-template/.gradle/file-system.probe +0 -0
  32. package/templates/paper-modern-template/.gradle/vcs-1/gc.properties +0 -0
  33. package/templates/paper-modern-template/build/classes/java/main/com/example/paperplugin/ExamplePaperPlugin.class +0 -0
  34. package/templates/paper-modern-template/build/classes/java/main/com/example/paperplugin/PaperPluginBootstrap.class +0 -0
  35. package/templates/paper-modern-template/build/classes/java/main/com/example/paperplugin/command/HelloCommand.class +0 -0
  36. package/templates/paper-modern-template/build/classes/java/main/com/example/paperplugin/data/PluginDataKeys.class +0 -0
  37. package/templates/paper-modern-template/build/classes/java/main/com/example/paperplugin/listener/PlayerEventListener.class +0 -0
  38. package/templates/paper-modern-template/build/classes/java/main/com/example/paperplugin/util/SchedulerAdapter.class +0 -0
  39. package/templates/paper-modern-template/build/tmp/compileJava/previous-compilation-data.bin +0 -0
  40. package/templates/paper-modern-template/build.gradle.kts +54 -0
  41. package/templates/paper-modern-template/gradle/wrapper/gradle-wrapper.jar +0 -0
  42. package/templates/paper-modern-template/gradle/wrapper/gradle-wrapper.properties +7 -0
  43. package/templates/paper-modern-template/gradlew +248 -0
  44. package/templates/paper-modern-template/gradlew.bat +93 -0
  45. package/templates/paper-modern-template/settings.gradle.kts +5 -0
  46. package/templates/paper-modern-template/src/main/java/com/example/paperplugin/ExamplePaperPlugin.java +35 -0
  47. package/templates/paper-modern-template/src/main/java/com/example/paperplugin/PaperPluginBootstrap.java +30 -0
  48. package/templates/paper-modern-template/src/main/java/com/example/paperplugin/command/HelloCommand.java +55 -0
  49. package/templates/paper-modern-template/src/main/java/com/example/paperplugin/data/PluginDataKeys.java +22 -0
  50. package/templates/paper-modern-template/src/main/java/com/example/paperplugin/listener/PlayerEventListener.java +61 -0
  51. package/templates/paper-modern-template/src/main/java/com/example/paperplugin/util/SchedulerAdapter.java +77 -0
  52. package/templates/paper-modern-template/src/main/resources/config.yml +10 -0
  53. package/templates/paper-modern-template/src/main/resources/paper-plugin.yml +9 -0
@@ -0,0 +1,77 @@
1
+ package com.example.paperplugin.util;
2
+
3
+ import org.bukkit.Bukkit;
4
+ import org.bukkit.Location;
5
+ import org.bukkit.entity.Entity;
6
+ import org.bukkit.plugin.Plugin;
7
+
8
+ import java.util.concurrent.TimeUnit;
9
+
10
+ /**
11
+ * Adapter Scheduler yang secara transparan mendukung arsitektur Paper standar dan Folia (Regionized Threading).
12
+ */
13
+ public final class SchedulerAdapter {
14
+
15
+ private static final boolean IS_FOLIA = checkFolia();
16
+
17
+ private SchedulerAdapter() {
18
+ }
19
+
20
+ private static boolean checkFolia() {
21
+ try {
22
+ Class.forName("io.papermc.paper.threadedregions.RegionizedServer");
23
+ return true;
24
+ } catch (final ClassNotFoundException e) {
25
+ return false;
26
+ }
27
+ }
28
+
29
+ public static boolean isFolia() {
30
+ return IS_FOLIA;
31
+ }
32
+
33
+ /**
34
+ * Menjalankan runnable pada thread region lokasi tertentu.
35
+ */
36
+ public static void runAtLocation(final Plugin plugin, final Location location, final Runnable runnable) {
37
+ if (IS_FOLIA) {
38
+ Bukkit.getRegionScheduler().execute(plugin, location, runnable);
39
+ } else {
40
+ Bukkit.getScheduler().runTask(plugin, runnable);
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Menjalankan runnable pada thread yang memiliki entity tertentu.
46
+ */
47
+ public static void runAtEntity(final Plugin plugin, final Entity entity, final Runnable runnable) {
48
+ if (IS_FOLIA) {
49
+ entity.getScheduler().run(plugin, task -> runnable.run(), null);
50
+ } else {
51
+ Bukkit.getScheduler().runTask(plugin, runnable);
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Menjalankan runnable secara asynchronous (off-main-thread).
57
+ */
58
+ public static void runAsync(final Plugin plugin, final Runnable runnable) {
59
+ if (IS_FOLIA) {
60
+ Bukkit.getAsyncScheduler().runNow(plugin, task -> runnable.run());
61
+ } else {
62
+ Bukkit.getScheduler().runTaskAsynchronously(plugin, runnable);
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Menjalankan task delayed secara asynchronous.
68
+ */
69
+ public static void runAsyncDelayed(final Plugin plugin, final Runnable runnable, final long delay, final TimeUnit timeUnit) {
70
+ if (IS_FOLIA) {
71
+ Bukkit.getAsyncScheduler().runDelayed(plugin, task -> runnable.run(), delay, timeUnit);
72
+ } else {
73
+ final long ticks = delay * 20; // Aproksimasi detik ke tick jika detik
74
+ Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, runnable, ticks);
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,10 @@
1
+ # Konfigurasi Modern Paper Template Plugin
2
+ # Format teks menggunakan format Kyori MiniMessage
3
+
4
+ messages:
5
+ welcome: "<gradient:#00c6ff:#0072ff><bold>Selamat datang di server!</bold></gradient> Senang melihatmu bergabung, <yellow><player></yellow>."
6
+ first_join: "<rainbow><bold>MEMBER BARU!</bold></rainbow> Mari sambut <yellow><player></yellow> yang baru pertama kali bergabung!"
7
+ command_hello: "<green>Halo, <aqua><target></aqua>! Salam dari server Paper modern.</green>"
8
+
9
+ settings:
10
+ track_join_count: true
@@ -0,0 +1,9 @@
1
+ name: ModernPaperTemplate
2
+ version: '${version}'
3
+ main: com.example.paperplugin.ExamplePaperPlugin
4
+ bootstrapper: com.example.paperplugin.PaperPluginBootstrap
5
+ description: Template Modern Plugin Minecraft Paper Java
6
+ api-version: '1.21'
7
+ folia-supported: true
8
+ authors:
9
+ - Developer