From e169f6298795cdd594ff2043ce5a7c95ec97b865 Mon Sep 17 00:00:00 2001 From: Slqmy <90862990+Slqmy@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:47:01 +0100 Subject: [PATCH] Make things more consistent --- .../commands/PlaceCustomMultiblockCommand.java | 2 +- .../SpawnCustomMultientityCommand.java | 18 +++++++++--------- .../AbstractCustomMultientity.java | 4 ++-- .../CustomMultientityManager.java | 10 +++++----- .../language/Message.java | 2 +- .../languages/English (United Kingdom).yaml | 2 +- .../languages/English (United States).yaml | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/net/slqmy/template_paper_plugin/commands/PlaceCustomMultiblockCommand.java b/src/main/java/net/slqmy/template_paper_plugin/commands/PlaceCustomMultiblockCommand.java index 0aaaccd1..236125a2 100644 --- a/src/main/java/net/slqmy/template_paper_plugin/commands/PlaceCustomMultiblockCommand.java +++ b/src/main/java/net/slqmy/template_paper_plugin/commands/PlaceCustomMultiblockCommand.java @@ -16,7 +16,7 @@ public class PlaceCustomMultiblockCommand extends CommandAPICommand { public PlaceCustomMultiblockCommand(TemplatePaperPlugin plugin) { - super("place"); + super("place-custom-multiblock"); String customMultiblockArgumentNodeName = "custom-multiblock-id"; diff --git a/src/main/java/net/slqmy/template_paper_plugin/commands/SpawnCustomMultientityCommand.java b/src/main/java/net/slqmy/template_paper_plugin/commands/SpawnCustomMultientityCommand.java index ed69ec2b..249d67b4 100644 --- a/src/main/java/net/slqmy/template_paper_plugin/commands/SpawnCustomMultientityCommand.java +++ b/src/main/java/net/slqmy/template_paper_plugin/commands/SpawnCustomMultientityCommand.java @@ -16,30 +16,30 @@ public class SpawnCustomMultientityCommand extends CommandAPICommand { public SpawnCustomMultientityCommand(TemplatePaperPlugin plugin) { - super("spawn"); + super("spawn-custom-multientity"); - String customEntityArgumentNodeName = "custom-entity-id"; + String customMultientityArgumentNodeName = "custom-multientity-id"; - String[] customEntityIds = Stream.of(CustomMultientity.values()).map((customEntity) -> customEntity.name()).toArray(String[]::new); + String[] customMultientityIds = Stream.of(CustomMultientity.values()).map((customMultientity) -> customMultientity.name()).toArray(String[]::new); - Argument customEntityArgument = new CustomArgument<>(new StringArgument(customEntityArgumentNodeName), (info) -> { + Argument customMultientityArgument = new CustomArgument<>(new StringArgument(customMultientityArgumentNodeName), (info) -> { String input = info.currentInput(); try { return CustomMultientity.valueOf(input); } catch (IllegalArgumentException exception) { - throw CustomArgumentException.fromAdventureComponent(plugin.getLanguageManager().getMessage(Message.UNKNOWN_CUSTOM_ENTITY, info.sender(), input)); + throw CustomArgumentException.fromAdventureComponent(plugin.getLanguageManager().getMessage(Message.UNKNOWN_CUSTOM_MULTIENTITY, info.sender(), input)); } - }).includeSuggestions(ArgumentSuggestions.strings(customEntityIds)); + }).includeSuggestions(ArgumentSuggestions.strings(customMultientityIds)); executesPlayer((info) -> { - CustomMultientity entity = (CustomMultientity) info.args().get(customEntityArgumentNodeName); + CustomMultientity multientity = (CustomMultientity) info.args().get(customMultientityArgumentNodeName); - plugin.getCustomMultientityManager().spawnEntity(entity, info.sender().getLocation()); + plugin.getCustomMultientityManager().spawnEntity(multientity, info.sender().getLocation()); }); withPermission(CommandPermission.OP); - withArguments(customEntityArgument); + withArguments(customMultientityArgument); register(plugin); } diff --git a/src/main/java/net/slqmy/template_paper_plugin/custom_multientity/AbstractCustomMultientity.java b/src/main/java/net/slqmy/template_paper_plugin/custom_multientity/AbstractCustomMultientity.java index b950ebc3..dcce3fe1 100644 --- a/src/main/java/net/slqmy/template_paper_plugin/custom_multientity/AbstractCustomMultientity.java +++ b/src/main/java/net/slqmy/template_paper_plugin/custom_multientity/AbstractCustomMultientity.java @@ -16,14 +16,14 @@ public abstract class AbstractCustomMultientity implements Lis private final CustomMultientity entityId; - protected AbstractCustomMultientity(TemplatePaperPlugin plugin, CustomMultientityManager customEntityManager, CustomMultientity entityId) { + protected AbstractCustomMultientity(TemplatePaperPlugin plugin, CustomMultientityManager customMultientityManager, CustomMultientity entityId) { this.plugin = plugin; this.entityId = entityId; Bukkit.getPluginManager().registerEvents(this, plugin); - customEntityManager.addCustomEntity(entityId, this); + customMultientityManager.addCustomEntity(entityId, this); } protected abstract List generateCustomEntity(Location spawnLocation); diff --git a/src/main/java/net/slqmy/template_paper_plugin/custom_multientity/CustomMultientityManager.java b/src/main/java/net/slqmy/template_paper_plugin/custom_multientity/CustomMultientityManager.java index 120deadd..0953b299 100644 --- a/src/main/java/net/slqmy/template_paper_plugin/custom_multientity/CustomMultientityManager.java +++ b/src/main/java/net/slqmy/template_paper_plugin/custom_multientity/CustomMultientityManager.java @@ -13,18 +13,18 @@ public class CustomMultientityManager { - private final Map> customEntityMap = new HashMap<>(); + private final Map> customMultientityMap = new HashMap<>(); public CustomMultientityManager(TemplatePaperPlugin plugin) { } - public void addCustomEntity(CustomMultientity itemId, AbstractCustomMultientity customItem) { - customEntityMap.put(itemId, customItem); + public void addCustomEntity(CustomMultientity itemId, AbstractCustomMultientity customMultientity) { + customMultientityMap.put(itemId, customMultientity); } - public AbstractCustomMultientity getAbstractCustomEntity(CustomMultientity itemId) { - return customEntityMap.get(itemId); + public AbstractCustomMultientity getAbstractCustomEntity(CustomMultientity entityId) { + return customMultientityMap.get(entityId); } public List spawnEntity(CustomMultientity entityId, Location location) { diff --git a/src/main/java/net/slqmy/template_paper_plugin/language/Message.java b/src/main/java/net/slqmy/template_paper_plugin/language/Message.java index 8af768c6..f1f1c77d 100644 --- a/src/main/java/net/slqmy/template_paper_plugin/language/Message.java +++ b/src/main/java/net/slqmy/template_paper_plugin/language/Message.java @@ -11,7 +11,7 @@ public enum Message { UNKNOWN_LANGUAGE(() -> false), UNKNOWN_CUSTOM_ITEM(() -> CustomItem.isEnabled()), - UNKNOWN_CUSTOM_ENTITY(() -> CustomMultientity.isEnabled()), + UNKNOWN_CUSTOM_MULTIENTITY(() -> CustomMultientity.isEnabled()), UNKNOWN_CUSTOM_MULTIBLOCK(() -> CustomMultiblock.isEnabled()); private final BooleanSupplier isMessageInUseSupplier; diff --git a/src/main/resources/languages/English (United Kingdom).yaml b/src/main/resources/languages/English (United Kingdom).yaml index 09fd8307..7c4cc11d 100644 --- a/src/main/resources/languages/English (United Kingdom).yaml +++ b/src/main/resources/languages/English (United Kingdom).yaml @@ -2,5 +2,5 @@ SET_LANGUAGE_SUCCESSFULLY: "Successfully set your language to {0} UNKNOWN_LANGUAGE: "Unsupported or unknown language: '{0}'." UNKNOWN_CUSTOM_ITEM: "Unknown custom item: '{0}'." -UNKNOWN_CUSTOM_ENTITY: "Unknown custom entity: '{0}'." +UNKNOWN_CUSTOM_MULTIENTITY: "Unknown custom multientity: '{0}'." UNKNOWN_CUSTOM_MULTIBLOCK: "Unknown custom multiblock: '{0}'." diff --git a/src/main/resources/languages/English (United States).yaml b/src/main/resources/languages/English (United States).yaml index 09fd8307..7c4cc11d 100644 --- a/src/main/resources/languages/English (United States).yaml +++ b/src/main/resources/languages/English (United States).yaml @@ -2,5 +2,5 @@ SET_LANGUAGE_SUCCESSFULLY: "Successfully set your language to {0} UNKNOWN_LANGUAGE: "Unsupported or unknown language: '{0}'." UNKNOWN_CUSTOM_ITEM: "Unknown custom item: '{0}'." -UNKNOWN_CUSTOM_ENTITY: "Unknown custom entity: '{0}'." +UNKNOWN_CUSTOM_MULTIENTITY: "Unknown custom multientity: '{0}'." UNKNOWN_CUSTOM_MULTIBLOCK: "Unknown custom multiblock: '{0}'."