diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java index a1f228aa..4da2bb18 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java @@ -21,9 +21,9 @@ public void onCommand(CommandSenderContainer sender, String[] args) { sender.sendMessage(Lang.translate("messageprefix.negative") + Lang.translate("command.playeronly")); } else { - player.giveWool("BLACK", "\u00A78Gateway Block Placer" - , "\u00A7rThis wool is made of a magical substance", - "\u00A7rRight Click: Place portal block"); + player.giveItem("BLACK_WOOL", "\u00A78Gateway Block Placer" + , "\u00A7r\u00A77This wool is made of a magical substance", + "\u00A7r\u00A7eRight Click\u00A77: Place portal block"); sender.sendMessage(Lang.translate("messageprefix.positive") + Lang.translate("command.gatewayblock")); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java index fdaa05c0..879b1ca8 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java @@ -21,9 +21,9 @@ public void onCommand(CommandSenderContainer sender, String[] args) { sender.sendMessage(Lang.translate("messageprefix.negative") + Lang.translate("command.playeronly")); } else { - player.giveWool("BLACK", "\u00A78End Portal Block Placer" - , "\u00A7rThis wool is made of a magical substance", - "\u00A7rRight Click: Place portal block"); + player.giveItem("BLACK_WOOL", "\u00A78End Portal Block Placer" + , "\u00A7r\u00A77This wool is made of a magical substance", + "\u00A7r\u00A7eRight Click\u00A77: Place portal block"); sender.sendMessage(Lang.translate("messageprefix.positive") + Lang.translate("command.endportalblock")); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java index 5c2a5762..6a5197dc 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java @@ -22,10 +22,10 @@ public void onCommand(CommandSenderContainer sender, String[] args) { sender.sendMessage(Lang.translate("messageprefix.negative") + Lang.translate("command.playeronly")); } else { - player.giveWool("PURPLE", "\u00A75Portal Block Placer" - , "\u00A7rThis wool is made of a magical substance", - "\u00A7rRight Click: Place portal block", - "\u00A7rLeft Click: Rotate portal block"); + player.giveItem("PURPLE_WOOL", "\u00A75Portal Block Placer" + , "\u00A7r\u00A77This wool is made of a magical substance", + "\u00A7r\u00A7e" + Lang.translate("items.interact.left") + "\u00A77: Rotate portal block", + "\u00A7r\u00A7e" + Lang.translate("items.interact.right") + "\u00A77: Place portal block"); sender.sendMessage(Lang.translate("messageprefix.positive") + Lang.translate("command.portalblock")); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java index 26dba145..5cade55c 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java @@ -23,7 +23,6 @@ public class RemoveSubCommand implements SubCommand { @Override public void onCommand(CommandSenderContainer sender, String[] args) { if(args.length > 1) { - // TODO sort portal services if(portalServices.removePortal(args[1], sender.getPlayerContainer())) { sender.sendMessage(Lang.translate("messageprefix.positive") + Lang.translate("command.remove.complete")); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java index 4a8af805..ce0f01df 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java @@ -25,8 +25,12 @@ public void onCommand(CommandSenderContainer sender, String[] args) { sender.sendMessage(Lang.translate("messageprefix.negative") + Lang.translate("command.playeronly")); } else { - player.giveItem(configRepo.getSelectorMaterial(), "\u00A7ePortal Region Selector" - , "\u00A7rThis wand with has the power to help", "\u00A7r create portals bistowed upon it!"); + player.giveItem(configRepo.getSelectorMaterial(), "\u00A7e" + Lang.translate("items.selector.name") + , "\u00A7r\u00A77This wand with has the power to help", + "\u00A7r\u00A77 create portals bistowed upon it!", + "", + "\u00A7r\u00A7e" + Lang.translate("items.interact.left") + "\u00A77: " + Lang.translateInsertVariables("items.selector.pos", "1"), + "\u00A7r\u00A7e" + Lang.translate("items.interact.right") + "\u00A77: " + Lang.translateInsertVariables("items.selector.pos", "2")); sender.sendMessage(Lang.translate("messageprefix.positive") + Lang.translate("command.selector")); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/PlayerContainer.java b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/PlayerContainer.java index 58507fbb..838e10a0 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/PlayerContainer.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/PlayerContainer.java @@ -40,7 +40,5 @@ public interface PlayerContainer { */ void sendFakeBlockWithData(BlockLocation blockPos, String material, byte data); - void giveWool(String dyeColor, String itemName, String... itemDescription); - void giveItem(String material, String itemName, String... itemDescription); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/services/PortalServices.java b/core/src/main/java/com/sekwah/advancedportals/core/services/PortalServices.java index 7e84e2c7..2783e3e0 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/services/PortalServices.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/services/PortalServices.java @@ -8,7 +8,6 @@ import javax.inject.Singleton; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.Map; diff --git a/lang/src/main/resources/lang/en_GB.lang b/lang/src/main/resources/lang/en_GB.lang index ef9bbbe2..4d6c907b 100644 --- a/lang/src/main/resources/lang/en_GB.lang +++ b/lang/src/main/resources/lang/en_GB.lang @@ -76,7 +76,7 @@ command.create.tags=&aTags: command.playeronly= Sorry but that command can only be run by a player. command.remove.noname= You need to give the name of the portal you want to remove. -command.remove.error= Removing the portal was blocked: +command.remove.error= There was a problem removing the portal: command.remove.noname=No portal by that name was found command.remove.invalidselection=The portal selection you had is no longer valid command.remove.noselection=You don't have a portal selected @@ -109,8 +109,13 @@ error.notplayer=Only players can do that. portal.selector.poschange=&eYou have selected pos%1$s X:%2$s Y:%3$s Z:%4$s -command.trans.help=Copy translation new default translation file +command.lang.help=Update the translation file command.version.help=Returns the current version of the plugin command.subcommand.nopermission= Sorry but you don't have permission for that, please use &e/%1$s help &cif you would like a list of possible sub commands. + +items.selector.name=Portal Region Selector +items.selector.pos=Select pos %1$s +items.interact.left=Left Click +items.interact.right=Right Click diff --git a/spigot/build.gradle b/spigot/build.gradle index ef8c7426..6ca71317 100644 --- a/spigot/build.gradle +++ b/spigot/build.gradle @@ -19,7 +19,8 @@ dependencies { implementation "org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT" implementation "net.md-5:bungeecord-api:1.16-R0.4" implementation group: 'com.google.inject', name: 'guice', version:'5.0.1' - compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT' + // Be careful to only use what you need to from paper, otherwise it will become incompatible with spigot. + //compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT' } jar { diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotPlayerContainer.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotPlayerContainer.java index 88237559..df2637c2 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotPlayerContainer.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotPlayerContainer.java @@ -83,15 +83,6 @@ public void sendFakeBlockWithData(BlockLocation blockPos, String material, byte } - public void giveWool(String dyeColor, String itemName, String... itemDescription) { - ItemStack regionselector = new Wool(DyeColor.valueOf(dyeColor)).toItemStack(1); - ItemMeta selectorname = regionselector.getItemMeta(); - selectorname.setDisplayName(itemName); - selectorname.setLore(Arrays.asList(itemDescription)); - regionselector.setItemMeta(selectorname); - this.player.getInventory().addItem(regionselector); - } - public void giveItem(String material, String itemName, String... itemDescription) { ItemStack regionselector = new ItemStack(Material.getMaterial(material)); ItemMeta selectorname = regionselector.getItemMeta();