diff --git a/README.md b/README.md index 8008c865..dc2f04ac 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Template Paper Plugin +# Paper Template Plugin > A template repository for easily developing Minecraft Paper plugins. diff --git a/settings.gradle.kts b/settings.gradle.kts index b4a95734..632f8c3d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,6 +2,6 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } -val projectName = "Template Paper Plugin" +val projectName = "Paper Template Plugin" -rootProject.name = "template-paper-plugin" +rootProject.name = "paper-template-plugin" diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/TemplatePaperPlugin.java b/src/main/java/org/esoteric/minecraft/plugins/template/PaperTemplatePlugin.java similarity index 98% rename from src/main/java/org/esoteric/minecraft/plugins/template/TemplatePaperPlugin.java rename to src/main/java/org/esoteric/minecraft/plugins/template/PaperTemplatePlugin.java index 4be0e937..3c0dd424 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/TemplatePaperPlugin.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/PaperTemplatePlugin.java @@ -21,7 +21,7 @@ import org.esoteric.minecraft.plugins.template.language.Message; import org.esoteric.minecraft.plugins.template.resourcepack.ResourcePackManager; -public final class TemplatePaperPlugin extends JavaPlugin { +public final class PaperTemplatePlugin extends JavaPlugin { private FileManager fileManager; private PlayerDataManager playerDataManager; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/commands/GiveCustomItemCommand.java b/src/main/java/org/esoteric/minecraft/plugins/template/commands/GiveCustomItemCommand.java index 392e38a8..f6c98d9b 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/commands/GiveCustomItemCommand.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/commands/GiveCustomItemCommand.java @@ -7,7 +7,7 @@ import dev.jorel.commandapi.arguments.CustomArgument; import dev.jorel.commandapi.arguments.CustomArgument.CustomArgumentException; import dev.jorel.commandapi.arguments.StringArgument; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.custom.items.CustomItem; import org.esoteric.minecraft.plugins.template.language.Message; @@ -15,7 +15,7 @@ public class GiveCustomItemCommand extends CommandAPICommand { - public GiveCustomItemCommand(TemplatePaperPlugin plugin) { + public GiveCustomItemCommand(PaperTemplatePlugin plugin) { super("give-custom-item"); String customItemArgumentNodeName = "custom-item-id"; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/commands/PlaceCustomMultiblockCommand.java b/src/main/java/org/esoteric/minecraft/plugins/template/commands/PlaceCustomMultiblockCommand.java index 86279cd7..909b862d 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/commands/PlaceCustomMultiblockCommand.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/commands/PlaceCustomMultiblockCommand.java @@ -7,7 +7,7 @@ import dev.jorel.commandapi.arguments.CustomArgument; import dev.jorel.commandapi.arguments.CustomArgument.CustomArgumentException; import dev.jorel.commandapi.arguments.StringArgument; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.custom.multiblocks.CustomMultiblock; import org.esoteric.minecraft.plugins.template.language.Message; @@ -15,7 +15,7 @@ public class PlaceCustomMultiblockCommand extends CommandAPICommand { - public PlaceCustomMultiblockCommand(TemplatePaperPlugin plugin) { + public PlaceCustomMultiblockCommand(PaperTemplatePlugin plugin) { super("place-custom-multiblock"); String customMultiblockArgumentNodeName = "custom-multiblock-id"; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/commands/SetLanguageCommand.java b/src/main/java/org/esoteric/minecraft/plugins/template/commands/SetLanguageCommand.java index d109e5b4..1a02c594 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/commands/SetLanguageCommand.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/commands/SetLanguageCommand.java @@ -7,7 +7,7 @@ import dev.jorel.commandapi.arguments.CustomArgument.CustomArgumentException; import dev.jorel.commandapi.arguments.GreedyStringArgument; import net.kyori.adventure.text.Component; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.language.LanguageManager; import org.esoteric.minecraft.plugins.template.language.Message; import org.jetbrains.annotations.NotNull; @@ -16,7 +16,7 @@ public class SetLanguageCommand extends CommandAPICommand { - public SetLanguageCommand(@NotNull TemplatePaperPlugin plugin) { + public SetLanguageCommand(@NotNull PaperTemplatePlugin plugin) { super("set-language"); LanguageManager languageManager = plugin.getLanguageManager(); diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/commands/SpawnCustomMultientityCommand.java b/src/main/java/org/esoteric/minecraft/plugins/template/commands/SpawnCustomMultientityCommand.java index 4f58ff7e..46cce387 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/commands/SpawnCustomMultientityCommand.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/commands/SpawnCustomMultientityCommand.java @@ -7,7 +7,7 @@ import dev.jorel.commandapi.arguments.CustomArgument; import dev.jorel.commandapi.arguments.CustomArgument.CustomArgumentException; import dev.jorel.commandapi.arguments.StringArgument; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.custom.multientities.CustomMultientity; import org.esoteric.minecraft.plugins.template.language.Message; @@ -15,7 +15,7 @@ public class SpawnCustomMultientityCommand extends CommandAPICommand { - public SpawnCustomMultientityCommand(TemplatePaperPlugin plugin) { + public SpawnCustomMultientityCommand(PaperTemplatePlugin plugin) { super("spawn-custom-multientity"); String customMultientityArgumentNodeName = "custom-multientity-id"; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/custom/items/AbstractCustomItem.java b/src/main/java/org/esoteric/minecraft/plugins/template/custom/items/AbstractCustomItem.java index 4e4e24c1..16aae8fe 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/custom/items/AbstractCustomItem.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/custom/items/AbstractCustomItem.java @@ -6,12 +6,12 @@ import org.bukkit.event.Listener; import org.bukkit.inventory.ItemStack; import org.bukkit.persistence.PersistentDataType; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.jetbrains.annotations.NotNull; public abstract class AbstractCustomItem implements Listener { - private final TemplatePaperPlugin plugin; + private final PaperTemplatePlugin plugin; private final CustomItem itemId; private final Material material; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/custom/items/CustomItemManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/custom/items/CustomItemManager.java index 28f50b1e..818ba7f1 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/custom/items/CustomItemManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/custom/items/CustomItemManager.java @@ -1,22 +1,22 @@ package org.esoteric.minecraft.plugins.template.custom.items; import org.bukkit.entity.Player; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import java.util.HashMap; import java.util.Map; public class CustomItemManager { - private final TemplatePaperPlugin plugin; + private final PaperTemplatePlugin plugin; private final Map customItemMap = new HashMap<>(); - public TemplatePaperPlugin getPlugin() { + public PaperTemplatePlugin getPlugin() { return plugin; } - public CustomItemManager(TemplatePaperPlugin plugin) { + public CustomItemManager(PaperTemplatePlugin plugin) { this.plugin = plugin; } diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/custom/multiblocks/AbstractCustomMultiblock.java b/src/main/java/org/esoteric/minecraft/plugins/template/custom/multiblocks/AbstractCustomMultiblock.java index ef84d114..53af0991 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/custom/multiblocks/AbstractCustomMultiblock.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/custom/multiblocks/AbstractCustomMultiblock.java @@ -4,7 +4,7 @@ import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.event.Listener; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.util.types.BlockLocation; import org.jetbrains.annotations.NotNull; @@ -13,7 +13,7 @@ public abstract class AbstractCustomMultiblock implements Listener { - protected final TemplatePaperPlugin plugin; + protected final PaperTemplatePlugin plugin; private final List> multiblocks = new ArrayList<>(); diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/custom/multiblocks/CustomMultiblockManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/custom/multiblocks/CustomMultiblockManager.java index ca2c7f9d..eaccb140 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/custom/multiblocks/CustomMultiblockManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/custom/multiblocks/CustomMultiblockManager.java @@ -2,7 +2,7 @@ import com.google.gson.Gson; import org.bukkit.Location; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.jetbrains.annotations.NotNull; import java.io.*; @@ -14,7 +14,7 @@ public class CustomMultiblockManager { - private final TemplatePaperPlugin plugin; + private final PaperTemplatePlugin plugin; private final String multiblocksFileExtension = ".json"; private final String multiblocksResourceFilePath = "data" + File.separator + "multiblocks" + multiblocksFileExtension; @@ -23,11 +23,11 @@ public class CustomMultiblockManager { private final Map customMultiblockMap = new HashMap<>(); - public TemplatePaperPlugin getPlugin() { + public PaperTemplatePlugin getPlugin() { return plugin; } - public CustomMultiblockManager(@NotNull TemplatePaperPlugin plugin) { + public CustomMultiblockManager(@NotNull PaperTemplatePlugin plugin) { this.plugin = plugin; multiblocksFilePath = plugin.getDataFolder() + File.separator + multiblocksResourceFilePath; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/custom/multientities/AbstractCustomMultientity.java b/src/main/java/org/esoteric/minecraft/plugins/template/custom/multientities/AbstractCustomMultientity.java index 0fea50ad..939eb5d0 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/custom/multientities/AbstractCustomMultientity.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/custom/multientities/AbstractCustomMultientity.java @@ -5,14 +5,14 @@ import org.bukkit.entity.Entity; import org.bukkit.event.Listener; import org.bukkit.persistence.PersistentDataType; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.jetbrains.annotations.NotNull; import java.util.List; public abstract class AbstractCustomMultientity implements Listener { - protected final TemplatePaperPlugin plugin; + protected final PaperTemplatePlugin plugin; private final CustomMultientity entityId; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/custom/multientities/CustomMultientityManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/custom/multientities/CustomMultientityManager.java index c36700ed..b568eff1 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/custom/multientities/CustomMultientityManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/custom/multientities/CustomMultientityManager.java @@ -2,7 +2,7 @@ import org.bukkit.Location; import org.bukkit.entity.Entity; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import java.util.HashMap; import java.util.List; @@ -10,15 +10,15 @@ public class CustomMultientityManager { - private final TemplatePaperPlugin plugin; + private final PaperTemplatePlugin plugin; private final Map> customMultientityMap = new HashMap<>(); - public TemplatePaperPlugin getPlugin() { + public PaperTemplatePlugin getPlugin() { return plugin; } - public CustomMultientityManager(TemplatePaperPlugin plugin) { + public CustomMultientityManager(PaperTemplatePlugin plugin) { this.plugin = plugin; } diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/data/player/PlayerDataManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/data/player/PlayerDataManager.java index b008ce13..abd85a4e 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/data/player/PlayerDataManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/data/player/PlayerDataManager.java @@ -2,7 +2,7 @@ import com.google.gson.Gson; import org.bukkit.entity.Player; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.jetbrains.annotations.NotNull; import java.io.File; @@ -16,7 +16,7 @@ public class PlayerDataManager { - private final TemplatePaperPlugin plugin; + private final PaperTemplatePlugin plugin; private final String playerDataFilesExtension = ".json"; @@ -26,7 +26,7 @@ public class PlayerDataManager { private final Map playerData = new HashMap<>(); - public PlayerDataManager(@NotNull TemplatePaperPlugin plugin) { + public PlayerDataManager(@NotNull PaperTemplatePlugin plugin) { this.plugin = plugin; playerDataFolderPath = plugin.getDataPath() + File.separator + playerDataFolderName; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/file/FileManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/file/FileManager.java index 5fb131dc..ef06b52a 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/file/FileManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/file/FileManager.java @@ -1,15 +1,15 @@ package org.esoteric.minecraft.plugins.template.file; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import java.io.File; import java.io.IOException; public class FileManager { - private final TemplatePaperPlugin plugin; + private final PaperTemplatePlugin plugin; - public FileManager(TemplatePaperPlugin plugin) { + public FileManager(PaperTemplatePlugin plugin) { this.plugin = plugin; } diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/http/server/HttpServerManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/http/server/HttpServerManager.java index 5fa74dca..ebb47f5a 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/http/server/HttpServerManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/http/server/HttpServerManager.java @@ -4,7 +4,7 @@ import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; import org.bukkit.Bukkit; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.file.FileUtil; import org.esoteric.minecraft.plugins.template.http.server.event.listeners.PlayerJoinListener; import org.esoteric.minecraft.plugins.template.resourcepack.ResourcePackManager; @@ -18,7 +18,7 @@ public class HttpServerManager { - private TemplatePaperPlugin plugin; + private PaperTemplatePlugin plugin; private String hostName; private int port; @@ -40,7 +40,7 @@ public String getSocketAddress() { return getHostName() + ":" + getPort(); } - public HttpServerManager(@NotNull TemplatePaperPlugin plugin) { + public HttpServerManager(@NotNull PaperTemplatePlugin plugin) { if (plugin.getResourcePackManager().getResourcePackZipFile() == null) { return; } diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/http/server/event/listeners/PlayerJoinListener.java b/src/main/java/org/esoteric/minecraft/plugins/template/http/server/event/listeners/PlayerJoinListener.java index d58d77b0..8ce324a2 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/http/server/event/listeners/PlayerJoinListener.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/http/server/event/listeners/PlayerJoinListener.java @@ -6,7 +6,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.file.FileUtil; import org.esoteric.minecraft.plugins.template.http.server.HttpServerManager; import org.jetbrains.annotations.NotNull; @@ -17,7 +17,7 @@ public class PlayerJoinListener implements Listener { private ResourcePackInfo resourcePackInfo; - public PlayerJoinListener(@NotNull TemplatePaperPlugin plugin, @NotNull HttpServerManager httpServerManager) { + public PlayerJoinListener(@NotNull PaperTemplatePlugin plugin, @NotNull HttpServerManager httpServerManager) { resourcePackInfo = ResourcePackInfo.resourcePackInfo().hash(FileUtil.getSha1HexString(plugin.getResourcePackManager().getResourcePackZipFile())) .uri(URI.create("http://" + httpServerManager.getSocketAddress() + "/")).build(); } diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/language/LanguageManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/language/LanguageManager.java index e27646d0..d0078342 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/language/LanguageManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/language/LanguageManager.java @@ -7,7 +7,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.data.player.PlayerProfile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -20,7 +20,7 @@ public class LanguageManager { private final MiniMessage miniMessage = MiniMessage.miniMessage(); - private final TemplatePaperPlugin plugin; + private final PaperTemplatePlugin plugin; private final String languageMessageFilesExtension = ".yaml"; @@ -40,7 +40,7 @@ public Set getLanguages() { return languages.keySet(); } - public LanguageManager(@NotNull TemplatePaperPlugin plugin) { + public LanguageManager(@NotNull PaperTemplatePlugin plugin) { this.plugin = plugin; languagesFolderPath = plugin.getDataPath() + File.separator + languagesFolderName; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/resourcepack/ResourcePackManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/resourcepack/ResourcePackManager.java index 96a90f0c..ec87c781 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/resourcepack/ResourcePackManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/resourcepack/ResourcePackManager.java @@ -1,7 +1,7 @@ package org.esoteric.minecraft.plugins.template.resourcepack; import org.apache.commons.io.FileUtils; -import org.esoteric.minecraft.plugins.template.TemplatePaperPlugin; +import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.file.FileUtil; import java.io.File; @@ -9,9 +9,9 @@ public class ResourcePackManager { - private final TemplatePaperPlugin plugin; + private final PaperTemplatePlugin plugin; - private final String resourcePackResourceFolderName = String.join(" ", TemplatePaperPlugin.class.getSimpleName().split("(?=[A-Z])")) + " Resource Pack"; + private final String resourcePackResourceFolderName = String.join(" ", PaperTemplatePlugin.class.getSimpleName().split("(?=[A-Z])")) + " Resource Pack"; private final String resourcePackFileType = "application"; private final String resourcePackFileExtension = "zip"; @@ -46,7 +46,7 @@ public File getResourcePackZipFile() { return resourcePackZipFile; } - public ResourcePackManager(TemplatePaperPlugin plugin) { + public ResourcePackManager(PaperTemplatePlugin plugin) { this.plugin = plugin; saveResourcepackZipFile(); diff --git a/src/main/resources/Paper Template Plugin Resource Pack/pack.mcmeta b/src/main/resources/Paper Template Plugin Resource Pack/pack.mcmeta new file mode 100644 index 00000000..3c563f13 --- /dev/null +++ b/src/main/resources/Paper Template Plugin Resource Pack/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 34, + "description": "The resource pack for the Paper Template Plugin" + } +} diff --git a/src/main/resources/Template Paper Plugin Resource Pack/pack.mcmeta b/src/main/resources/Template Paper Plugin Resource Pack/pack.mcmeta deleted file mode 100644 index 5d1dce25..00000000 --- a/src/main/resources/Template Paper Plugin Resource Pack/pack.mcmeta +++ /dev/null @@ -1,6 +0,0 @@ -{ - "pack": { - "pack_format": 34, - "description": "The resource pack for the Template Paper Plugin" - } -}