Skip to content

Commit

Permalink
fix: remove references to old material + make translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Nov 18, 2024
1 parent 10618e2 commit 2cd6452
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import javax.inject.Singleton;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;

Expand Down
9 changes: 7 additions & 2 deletions lang/src/main/resources/lang/en_GB.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion spigot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2cd6452

Please sign in to comment.