mirror of
https://e.coding.net/circlecloud/Soulbound.git
synced 2024-11-22 01:49:09 +00:00
add language file message.yml...
Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
parent
0f4babe423
commit
9293ec35d5
@ -1,7 +1,12 @@
|
|||||||
package com.me.tft_02.soulbound;
|
package com.me.tft_02.soulbound;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
@ -32,11 +37,21 @@ public class Soulbound extends JavaPlugin {
|
|||||||
// Checks for hooking into other plugins
|
// Checks for hooking into other plugins
|
||||||
public static boolean epicBossRecodedEnabled = false;
|
public static boolean epicBossRecodedEnabled = false;
|
||||||
public static boolean loreLocksEnabled = false;
|
public static boolean loreLocksEnabled = false;
|
||||||
public static boolean mythicDropsEnabled = false;
|
|
||||||
|
|
||||||
// Update Check
|
// Update Check
|
||||||
private boolean updateAvailable;
|
private boolean updateAvailable;
|
||||||
|
|
||||||
|
public File msgfile;
|
||||||
|
public FileConfiguration msgConfig;
|
||||||
|
|
||||||
|
public void onLoad() {
|
||||||
|
saveDefaultConfig();
|
||||||
|
this.saveResource("message.yml", false);
|
||||||
|
msgfile = new File(this.getDataFolder(), "message.yml");
|
||||||
|
msgConfig = Loadcfg(msgfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run things on enable.
|
* Run things on enable.
|
||||||
*/
|
*/
|
||||||
@ -107,5 +122,43 @@ public class Soulbound extends JavaPlugin {
|
|||||||
Config.getInstance();
|
Config.getInstance();
|
||||||
ItemsConfig.getInstance();
|
ItemsConfig.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FileConfiguration Loadcfg(File cfgfile) {
|
||||||
|
if (!cfgfile.exists()) {
|
||||||
|
saveResource(cfgfile.getName(), false);
|
||||||
|
return YamlConfiguration.loadConfiguration(cfgfile);
|
||||||
|
} else {
|
||||||
|
return YamlConfiguration.loadConfiguration(cfgfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadConfig(FileConfiguration cfg, File cfgfile)
|
||||||
|
throws FileNotFoundException, IOException,
|
||||||
|
InvalidConfigurationException {
|
||||||
|
if (!cfgfile.exists()) {
|
||||||
|
saveResource(cfgfile.getName(), false);
|
||||||
|
cfg.load(cfgfile);
|
||||||
|
} else {
|
||||||
|
cfg.load(cfgfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Savecfg(FileConfiguration cfg, File cfgfile) {
|
||||||
|
try {
|
||||||
|
// cfg.saveToString();
|
||||||
|
cfg.save(cfgfile);
|
||||||
|
} catch (IOException e) {
|
||||||
|
getLogger().info("配置文件" + cfgfile.getName() + "已保存!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getmessage(String path) {
|
||||||
|
String message = this.msgConfig.getString(path).replaceAll("&", "§");
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getlang(String type) {
|
||||||
|
return this.getmessage("Message." + type);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,8 @@ public class BindCommand implements CommandExecutor {
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (!args[1].equalsIgnoreCase("inventory")) {
|
if (!args[1].equalsIgnoreCase("inventory")) {
|
||||||
sender.sendMessage(ChatColor.RED + "Proper usage: " + ChatColor.GREEN + "/bind <player> inventory");
|
sender.sendMessage(Soulbound.p.getlang("BIND_INVENTORY"));
|
||||||
|
//sender.sendMessage(ChatColor.RED + "Proper usage: " + ChatColor.GREEN + "/bind <player> inventory");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,14 +66,16 @@ public class BindCommand implements CommandExecutor {
|
|||||||
ItemStack itemInHand = player.getItemInHand();
|
ItemStack itemInHand = player.getItemInHand();
|
||||||
|
|
||||||
if ((itemInHand.getType() == Material.AIR) || ItemUtils.isSoulbound(itemInHand)) {
|
if ((itemInHand.getType() == Material.AIR) || ItemUtils.isSoulbound(itemInHand)) {
|
||||||
sender.sendMessage(ChatColor.GRAY + "You can't " + soulbound + ChatColor.GRAY + "this item.");
|
sender.sendMessage(Soulbound.p.getlang("CAN_NOT_BIND"));
|
||||||
|
//sender.sendMessage(ChatColor.GRAY + "You can't " + soulbound + ChatColor.GRAY + "this item.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemUtils.soulbindItem(target, itemInHand);
|
ItemUtils.soulbindItem(target, itemInHand);
|
||||||
|
|
||||||
if (ItemUtils.isSoulbound(itemInHand) && Config.getInstance().getFeedbackEnabled()) {
|
if (ItemUtils.isSoulbound(itemInHand) && Config.getInstance().getFeedbackEnabled()) {
|
||||||
sender.sendMessage(ChatColor.GRAY + "Item is now " + soulbound + ChatColor.GRAY + "to " + ChatColor.DARK_AQUA + target.getName());
|
sender.sendMessage(Soulbound.p.getlang("BINDED").replace("%target%", target.getName()));
|
||||||
|
//sender.sendMessage(ChatColor.GRAY + "Item is now " + soulbound + ChatColor.GRAY + "to " + ChatColor.DARK_AQUA + target.getName());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -85,7 +88,10 @@ public class BindCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Config.getInstance().getFeedbackEnabled()) {
|
if (Config.getInstance().getFeedbackEnabled()) {
|
||||||
player.sendMessage(ChatColor.GRAY + "All items in " + ChatColor.DARK_AQUA + target.getName() + ChatColor.GRAY + "'s inventory are now " + soulbound + ChatColor.GRAY + "to " + ChatColor.DARK_AQUA + target.getName());
|
player.sendMessage(Soulbound.p.getlang("BIND_FULL_INEVNTORY").
|
||||||
|
replace("%player%", player.getName()).
|
||||||
|
replace("%target%", target.getName()));
|
||||||
|
//player.sendMessage(ChatColor.GRAY + "All items in " + ChatColor.DARK_AQUA + player.getName() + ChatColor.GRAY + "'s inventory are now " + soulbound + ChatColor.GRAY + "to " + ChatColor.DARK_AQUA + target.getName());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.me.tft_02.soulbound.commands;
|
package com.me.tft_02.soulbound.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@ -8,6 +7,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import com.me.tft_02.soulbound.Soulbound;
|
||||||
import com.me.tft_02.soulbound.util.CommandUtils;
|
import com.me.tft_02.soulbound.util.CommandUtils;
|
||||||
import com.me.tft_02.soulbound.util.ItemUtils;
|
import com.me.tft_02.soulbound.util.ItemUtils;
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ public class BindOnEquipCommand implements CommandExecutor {
|
|||||||
ItemStack itemInHand = player.getItemInHand();
|
ItemStack itemInHand = player.getItemInHand();
|
||||||
|
|
||||||
if ((itemInHand.getType() == Material.AIR) || ItemUtils.isSoulbound(itemInHand)) {
|
if ((itemInHand.getType() == Material.AIR) || ItemUtils.isSoulbound(itemInHand)) {
|
||||||
player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Soulbound " + ChatColor.GRAY + "this item.");
|
player.sendMessage(Soulbound.p.getlang("CAN_NOT_BIND"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,10 +37,12 @@ public class BindOnEquipCommand implements CommandExecutor {
|
|||||||
ItemUtils.boeItem(itemInHand);
|
ItemUtils.boeItem(itemInHand);
|
||||||
|
|
||||||
if (ItemUtils.isBindOnEquip(itemInHand)) {
|
if (ItemUtils.isBindOnEquip(itemInHand)) {
|
||||||
player.sendMessage(ChatColor.GRAY + "Item is now " + ChatColor.DARK_RED + "Bind on Equip");
|
player.sendMessage(Soulbound.p.getlang("BIND_ON_EQUIP"));
|
||||||
|
//player.sendMessage(ChatColor.GRAY + "Item is now " + ChatColor.DARK_RED + "Bind on Equip");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(ChatColor.RED + "Cannot mark this item as " + ChatColor.DARK_RED + "Bind on Equip");
|
player.sendMessage(Soulbound.p.getlang("CAN_NOT_BIND_ON_EQUIP"));
|
||||||
|
//player.sendMessage(ChatColor.RED + "Cannot mark this item as " + ChatColor.DARK_RED + "Bind on Equip");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.me.tft_02.soulbound.commands;
|
package com.me.tft_02.soulbound.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@ -8,6 +7,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import com.me.tft_02.soulbound.Soulbound;
|
||||||
import com.me.tft_02.soulbound.util.CommandUtils;
|
import com.me.tft_02.soulbound.util.CommandUtils;
|
||||||
import com.me.tft_02.soulbound.util.ItemUtils;
|
import com.me.tft_02.soulbound.util.ItemUtils;
|
||||||
|
|
||||||
@ -29,13 +29,15 @@ public class BindOnPickupCommand implements CommandExecutor {
|
|||||||
ItemStack itemInHand = player.getItemInHand();
|
ItemStack itemInHand = player.getItemInHand();
|
||||||
|
|
||||||
if ((itemInHand.getType() == Material.AIR) || ItemUtils.isSoulbound(itemInHand)) {
|
if ((itemInHand.getType() == Material.AIR) || ItemUtils.isSoulbound(itemInHand)) {
|
||||||
player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Soulbound " + ChatColor.GRAY + "this item.");
|
sender.sendMessage(Soulbound.p.getlang("CAN_NOT_BIND_ON_PICKUP"));
|
||||||
|
//player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Soulbound " + ChatColor.GRAY + "this item.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemUtils.unbindItem(itemInHand);
|
ItemUtils.unbindItem(itemInHand);
|
||||||
ItemUtils.bopItem(itemInHand);
|
ItemUtils.bopItem(itemInHand);
|
||||||
player.sendMessage(ChatColor.GRAY + "Item is now " + ChatColor.DARK_RED + "Bind on pickup");
|
sender.sendMessage(Soulbound.p.getlang("BIND_ON_PICKUP"));
|
||||||
|
//player.sendMessage(ChatColor.GRAY + "Item is now " + ChatColor.DARK_RED + "Bind on pickup");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.me.tft_02.soulbound.commands;
|
package com.me.tft_02.soulbound.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@ -8,6 +7,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import com.me.tft_02.soulbound.Soulbound;
|
||||||
import com.me.tft_02.soulbound.util.CommandUtils;
|
import com.me.tft_02.soulbound.util.CommandUtils;
|
||||||
import com.me.tft_02.soulbound.util.ItemUtils;
|
import com.me.tft_02.soulbound.util.ItemUtils;
|
||||||
|
|
||||||
@ -29,14 +29,15 @@ public class BindOnUseCommand implements CommandExecutor {
|
|||||||
ItemStack itemInHand = player.getItemInHand();
|
ItemStack itemInHand = player.getItemInHand();
|
||||||
|
|
||||||
if ((itemInHand.getType() == Material.AIR) || ItemUtils.isSoulbound(itemInHand)) {
|
if ((itemInHand.getType() == Material.AIR) || ItemUtils.isSoulbound(itemInHand)) {
|
||||||
player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Soulbound " + ChatColor.GRAY + "this item.");
|
sender.sendMessage(Soulbound.p.getlang("CAN_NOT_BIND_ON_USE"));
|
||||||
|
//player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Soulbound " + ChatColor.GRAY + "this item.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemUtils.unbindItem(itemInHand);
|
ItemUtils.unbindItem(itemInHand);
|
||||||
ItemUtils.bouItem(itemInHand);
|
ItemUtils.bouItem(itemInHand);
|
||||||
player.sendMessage(ChatColor.GRAY + "Item is now " + ChatColor.DARK_RED + "Bind on Use");
|
sender.sendMessage(Soulbound.p.getlang("BIND_ON_USE"));
|
||||||
|
//player.sendMessage(ChatColor.GRAY + "Item is now " + ChatColor.DARK_RED + "Bind on Use");
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -14,7 +14,7 @@ public class SoulboundCommand implements CommandExecutor {
|
|||||||
String label, String[] args) {
|
String label, String[] args) {
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 0:
|
case 0:
|
||||||
sender.sendMessage("Soulbound version "
|
sender.sendMessage(Soulbound.p.getlang("VERSION")
|
||||||
+ Soulbound.p.getDescription().getVersion());
|
+ Soulbound.p.getDescription().getVersion());
|
||||||
return printUsage(sender);
|
return printUsage(sender);
|
||||||
case 1:
|
case 1:
|
||||||
@ -43,7 +43,8 @@ public class SoulboundCommand implements CommandExecutor {
|
|||||||
|
|
||||||
private boolean helpPages(CommandSender sender, String[] args) {
|
private boolean helpPages(CommandSender sender, String[] args) {
|
||||||
if (!(sender instanceof Player)) {
|
if (!(sender instanceof Player)) {
|
||||||
sender.sendMessage("Can't use this from the console, sorry!");
|
sender.sendMessage(Soulbound.p.getlang("CAN_NOT_USE_ON_CONSOLE"));
|
||||||
|
//sender.sendMessage("Can't use this from the console, sorry!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (args.length >= 2 && Integer.parseInt(args[1]) > 0) {
|
if (args.length >= 2 && Integer.parseInt(args[1]) > 0) {
|
||||||
@ -57,78 +58,102 @@ public class SoulboundCommand implements CommandExecutor {
|
|||||||
int maxPages = 2;
|
int maxPages = 2;
|
||||||
int nextPage = page + 1;
|
int nextPage = page + 1;
|
||||||
if (page > maxPages) {
|
if (page > maxPages) {
|
||||||
sender.sendMessage(ChatColor.RED + "This page does not exist."
|
sender.sendMessage(Soulbound.p.getlang("PAGE_NOT_EXIST".
|
||||||
+ ChatColor.GOLD + " /help [0-" + maxPages + "]");
|
replace("%maxPages%", maxPages+"")));
|
||||||
|
//sender.sendMessage(ChatColor.RED + "This page does not exist."
|
||||||
|
//+ ChatColor.GOLD + " /help [0-" + maxPages + "]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String dot = ChatColor.DARK_RED + "* ";
|
//String dot = ChatColor.DARK_RED + "* ";
|
||||||
sender.sendMessage(ChatColor.GRAY + "-----[ " + ChatColor.GOLD
|
// sender.sendMessage(ChatColor.GRAY + "-----[ " + ChatColor.GOLD
|
||||||
+ "Soulbound Help" + ChatColor.GRAY + " ]----- Page " + page
|
// + "Soulbound Help" + ChatColor.GRAY + " ]----- Page " + page
|
||||||
+ "/" + maxPages);
|
// + "/" + maxPages);
|
||||||
|
sender.sendMessage(Soulbound.p.getlang("HELP_TITLE").
|
||||||
|
replace("%page%", page+"").
|
||||||
|
replace("%maxPages%", maxPages+"")
|
||||||
|
);
|
||||||
if (page == 1) {
|
if (page == 1) {
|
||||||
sender.sendMessage(ChatColor.GOLD + "How does it work?");
|
sender.sendMessage(Soulbound.p.getlang("HOW_DOES_IT_WORK"));
|
||||||
sender.sendMessage(dot
|
sender.sendMessage(Soulbound.p.getlang("HOW_DOES_IT_WORK_1"));
|
||||||
+ ChatColor.GRAY
|
sender.sendMessage(Soulbound.p.getlang("HOW_DOES_IT_WORK_2"));
|
||||||
+ "Soulbound items are special items which are bound to a sender.");
|
sender.sendMessage(Soulbound.p.getlang("HOW_DOES_IT_WORK_3"));
|
||||||
sender.sendMessage(dot
|
sender.sendMessage(Soulbound.p.getlang("HOW_DOES_IT_WORK_4"));
|
||||||
+ ChatColor.GRAY
|
sender.sendMessage(Soulbound.p.getlang("HOW_DOES_IT_WORK_5"));
|
||||||
+ "Players are prevented from doing certain actions with Soulbound items, such as:");
|
sender.sendMessage(Soulbound.p.getlang("HOW_DOES_IT_WORK_6"));
|
||||||
sender.sendMessage(dot
|
|
||||||
+ ChatColor.GRAY
|
// sender.sendMessage(ChatColor.GOLD + "How does it work?");
|
||||||
+ "dropping them on the ground, storing them in chests or giving them to other players.");
|
// sender.sendMessage(dot
|
||||||
sender.sendMessage(dot
|
// + ChatColor.GRAY
|
||||||
+ ChatColor.GRAY
|
// + "Soulbound items are special items which are bound to a sender.");
|
||||||
+ "Items marked as 'Bind on Pickup' will get Soulbound as soon as they get picked up.");
|
// sender.sendMessage(dot
|
||||||
sender.sendMessage(dot
|
// + ChatColor.GRAY
|
||||||
+ ChatColor.GRAY
|
// + "Players are prevented from doing certain actions with Soulbound items, such as:");
|
||||||
+ "Items marked as 'Bind on Use' will get Soulbound as soon as they get used.");
|
// sender.sendMessage(dot
|
||||||
sender.sendMessage(dot
|
// + ChatColor.GRAY
|
||||||
+ ChatColor.GRAY
|
// + "dropping them on the ground, storing them in chests or giving them to other players.");
|
||||||
+ "Items marked as 'Bind on Equip' will get Soulbound as soon as they get equipped.");
|
// sender.sendMessage(dot
|
||||||
|
// + ChatColor.GRAY
|
||||||
|
// + "Items marked as 'Bind on Pickup' will get Soulbound as soon as they get picked up.");
|
||||||
|
// sender.sendMessage(dot
|
||||||
|
// + ChatColor.GRAY
|
||||||
|
// + "Items marked as 'Bind on Use' will get Soulbound as soon as they get used.");
|
||||||
|
// sender.sendMessage(dot
|
||||||
|
// + ChatColor.GRAY
|
||||||
|
// + "Items marked as 'Bind on Equip' will get Soulbound as soon as they get equipped.");
|
||||||
}
|
}
|
||||||
if (page == 2) {
|
if (page == 2) {
|
||||||
sender.sendMessage(ChatColor.GOLD + "Commands:");
|
sender.sendMessage(Soulbound.p.getlang("CMD"));
|
||||||
if (sender.hasPermission("soulbound.commands.bindonpickup")) {
|
//sender.sendMessage(ChatColor.GOLD + "Commands:");
|
||||||
sender.sendMessage(dot + ChatColor.GREEN + "/soulbound"
|
if (sender.hasPermission("soulbound.commands.bind")) {
|
||||||
+ ChatColor.GRAY + " Check the status of the plugin.");
|
sender.sendMessage(Soulbound.p.getlang("CMDVERSION"));
|
||||||
|
//sender.sendMessage(dot + ChatColor.GREEN + "/soulbound"
|
||||||
|
//+ ChatColor.GRAY + " Check the status of the plugin.");
|
||||||
}
|
}
|
||||||
if (sender.hasPermission("soulbound.commands.bind")) {
|
if (sender.hasPermission("soulbound.commands.bind")) {
|
||||||
sender.sendMessage(dot + ChatColor.GREEN + "/bind <sender>"
|
sender.sendMessage(Soulbound.p.getlang("CMD_BIND"));
|
||||||
+ ChatColor.GRAY
|
//sender.sendMessage(dot + ChatColor.GREEN + "/bind <sender>"
|
||||||
+ " Soulbound the item currently in hand.");
|
//+ ChatColor.GRAY
|
||||||
sender.sendMessage(dot + ChatColor.GREEN
|
//+ " Soulbound the item currently in hand.");
|
||||||
+ "/bind <sender> inventory" + ChatColor.GRAY
|
sender.sendMessage(Soulbound.p.getlang("CMD_BIND_FULL_INVENTORY"));
|
||||||
+ " Soulbound an entire inventory.");
|
//sender.sendMessage(dot + ChatColor.GREEN
|
||||||
|
//+ "/bind <sender> inventory" + ChatColor.GRAY
|
||||||
|
//+ " Soulbound an entire inventory.");
|
||||||
}
|
}
|
||||||
if (sender.hasPermission("soulbound.commands.bindonpickup")) {
|
if (sender.hasPermission("soulbound.commands.bindonpickup")) {
|
||||||
sender.sendMessage(dot + ChatColor.GREEN + "/bindonpickup"
|
sender.sendMessage(Soulbound.p.getlang("CMD_BIND_ON_PICKUP"));
|
||||||
+ ChatColor.GRAY
|
//sender.sendMessage(dot + ChatColor.GREEN + "/bindonpickup"
|
||||||
+ " Mark the item in hand as 'Bind on Pickup'");
|
//+ ChatColor.GRAY
|
||||||
|
//+ " Mark the item in hand as 'Bind on Pickup'");
|
||||||
}
|
}
|
||||||
if (sender.hasPermission("soulbound.commands.bindonuse")) {
|
if (sender.hasPermission("soulbound.commands.bindonuse")) {
|
||||||
sender.sendMessage(dot + ChatColor.GREEN + "/bindonuse"
|
sender.sendMessage(Soulbound.p.getlang("CMD_BIND_ON_USE"));
|
||||||
+ ChatColor.GRAY
|
//sender.sendMessage(dot + ChatColor.GREEN + "/bindonuse"
|
||||||
+ " Mark the item in hand as 'Bind on Use'");
|
//+ ChatColor.GRAY
|
||||||
|
//+ " Mark the item in hand as 'Bind on Use'");
|
||||||
}
|
}
|
||||||
if (sender.hasPermission("soulbound.commands.bindonequip")) {
|
if (sender.hasPermission("soulbound.commands.bindonequip")) {
|
||||||
sender.sendMessage(dot + ChatColor.GREEN + "/bindonequip"
|
sender.sendMessage(Soulbound.p.getlang("CMD_BIND_ON_EQUIP"));
|
||||||
+ ChatColor.GRAY
|
//sender.sendMessage(dot + ChatColor.GREEN + "/bindonequip"
|
||||||
+ " Mark the item in hand as 'Bind on Equip'");
|
//+ ChatColor.GRAY
|
||||||
|
//+ " Mark the item in hand as 'Bind on Equip'");
|
||||||
}
|
}
|
||||||
if (sender.hasPermission("soulbound.commands.unbind")) {
|
if (sender.hasPermission("soulbound.commands.unbind")) {
|
||||||
sender.sendMessage(dot + ChatColor.GREEN + "/unbind"
|
sender.sendMessage(Soulbound.p.getlang("CMD_UNBIND"));
|
||||||
+ ChatColor.GRAY + " Unbind the item in hand.");
|
//sender.sendMessage(dot + ChatColor.GREEN + "/unbind"
|
||||||
|
//+ ChatColor.GRAY + " Unbind the item in hand.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nextPage <= maxPages) {
|
if (nextPage <= maxPages) {
|
||||||
sender.sendMessage(ChatColor.GOLD + "Type /soulbound help "
|
sender.sendMessage(Soulbound.p.getlang("CMD_NEXT").replace("%nextPage%", nextPage+""));
|
||||||
+ nextPage + " for more");
|
//sender.sendMessage(ChatColor.GOLD + "Type /soulbound help "
|
||||||
|
//+ nextPage + " for more");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean printUsage(CommandSender sender) {
|
private boolean printUsage(CommandSender sender) {
|
||||||
sender.sendMessage("Usage: /soulbound [reload | help]");
|
sender.sendMessage(Soulbound.p.getlang("CMD_USE"));
|
||||||
|
//sender.sendMessage("Usage: /soulbound [reload | help]");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.me.tft_02.soulbound.commands;
|
package com.me.tft_02.soulbound.commands;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@ -8,6 +7,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import com.me.tft_02.soulbound.Soulbound;
|
||||||
import com.me.tft_02.soulbound.util.CommandUtils;
|
import com.me.tft_02.soulbound.util.CommandUtils;
|
||||||
import com.me.tft_02.soulbound.util.ItemUtils;
|
import com.me.tft_02.soulbound.util.ItemUtils;
|
||||||
|
|
||||||
@ -29,16 +29,18 @@ public class UnbindCommand implements CommandExecutor {
|
|||||||
ItemStack itemInHand = player.getItemInHand();
|
ItemStack itemInHand = player.getItemInHand();
|
||||||
|
|
||||||
if ((itemInHand.getType() == Material.AIR) || !ItemUtils.isSoulbound(itemInHand)) {
|
if ((itemInHand.getType() == Material.AIR) || !ItemUtils.isSoulbound(itemInHand)) {
|
||||||
player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Unbind " + ChatColor.GRAY + "this item.");
|
player.sendMessage(Soulbound.p.getlang("CAN_NOT_UNBIND"));
|
||||||
|
//player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Unbind " + ChatColor.GRAY + "this item.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ItemUtils.unbindItem(itemInHand)==null ){
|
if (ItemUtils.unbindItem(itemInHand)==null ){
|
||||||
player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Unbind " + ChatColor.GRAY + "this item.");
|
player.sendMessage(Soulbound.p.getlang("CAN_NOT_UNBIND"));
|
||||||
|
//player.sendMessage(ChatColor.GRAY + "You can't " + ChatColor.GOLD + "Unbind " + ChatColor.GRAY + "this item.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
player.sendMessage(Soulbound.p.getlang("UNBINDED"));
|
||||||
player.sendMessage(ChatColor.GRAY + "Item no longer Soulbound.");
|
//player.sendMessage(ChatColor.GRAY + "Item no longer Soulbound.");
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
33
src/message.yml
Normal file
33
src/message.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#提示消息
|
||||||
|
Message:
|
||||||
|
CAN_NOT_BIND: '你不能&c绑定&8这个物品'
|
||||||
|
BINDED: '&8物品已经&a绑定&8到玩家&c%target%'
|
||||||
|
BIND_FULL_INEVNTORY: '&a玩家&c%player%&a背包内的所有物品已绑定到玩家&6%target%'
|
||||||
|
BIND_INVENTORY: '&4你可能需要的命令: &a/bind <player> inventory'
|
||||||
|
BIND_ON_EQUIP: '&8当前物品已标记为 &4装备后绑定'
|
||||||
|
CAN_NOT_BIND_ON_EQUIP: '&8当前物品不能标记为 &4装备后绑定'
|
||||||
|
BIND_ON_PICKUP: '&8当前物品已标记为 &4拾取后绑定'
|
||||||
|
CAN_NOT_BIND_ON_PICKUP: '&8当前物品不能标记为 &4拾取后绑定'
|
||||||
|
BIND_ON_USE: '&8当前物品已标记为 &4使用后绑定'
|
||||||
|
CAN_NOT_BIND_ON_USE: '&8当前物品不能标记为 &4使用后绑定'
|
||||||
|
VERSION: "灵魂绑定(喵♂呜 修改、汉化) 版本号:"
|
||||||
|
CAN_NOT_USE_ON_CONSOLE: '抱歉 此命令不能在控制台使用'
|
||||||
|
PAGE_NOT_EXIST: '&c帮助页面不存在 请输入 /Soulbound help [0-%maxPages%]'
|
||||||
|
HELP_TITLE: '&8--[ &灵魂绑定 帮助 -汉化by:邱 -修改by:喵♂呜 &8 ]-- 页面 %page%/%maxPages%'
|
||||||
|
HOW_DOES_IT_WORK: '&4* 它是如何工作的?'
|
||||||
|
HOW_DOES_IT_WORK_1: '&4* 灵魂绑定的物品只有自己才能使用。'
|
||||||
|
HOW_DOES_IT_WORK_2: '&4* 绑定后的物品,某些行为将会被阻止:'
|
||||||
|
HOW_DOES_IT_WORK_3: '&4* 扔在地上、或者放到箱子里让其他玩家拿。'
|
||||||
|
HOW_DOES_IT_WORK_4: '&4* 标记为 '拾取后绑定' 的物品,一旦被玩家捡起来就会立即绑定成为该玩家的物品。'
|
||||||
|
HOW_DOES_IT_WORK_5: '&4* 标记为 '使用后绑定' 的物品,只要拿在手中左键或者右键就会立即绑定成为该玩家的物品。'
|
||||||
|
HOW_DOES_IT_WORK_6: '&4* 装备后绑定' 的物品,装备到身上后就能立即绑定成为该玩家的物品。'
|
||||||
|
CMD: '&6指令:'
|
||||||
|
CMDVERSION: '&4* &a/soulbound &8查看插件版本。'
|
||||||
|
CMD_BIND: '&4* &a/bind <sender> &8绑定手上的物品。'
|
||||||
|
CMD_BIND_FULL_INVENTORY: '&4* &a/bind <sender> inventory &8绑定玩家背包里的所有物品。'
|
||||||
|
CMD_BIND_ON_EQUIP: '&4* &a/bindonequip &8将当前物品标记为 &4装备后绑定'
|
||||||
|
CMD_BIND_ON_PICKUP: '&4* &a/bindonpickup &8将当前物品标记为 &4拾取后绑定'
|
||||||
|
CMD_BIND_ON_USE: '&4* &a/bindonuse &8将当前物品标记为 &4使用后绑定'
|
||||||
|
CMD_UNBIND: '&4* &a/unbind &8解除手中物品的绑定。'
|
||||||
|
CMD_NEXT: '&6使用 /soulbound help %nextPage% 查看更多'
|
||||||
|
CMD_USE: '使用: /soulbound [reload | help]'
|
Loading…
Reference in New Issue
Block a user