mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-13 04:36:44 +00:00
Merge branch 'refs/heads/master' into release
This commit is contained in:
commit
19b8031933
15 changed files with 47 additions and 27 deletions
|
@ -173,7 +173,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||||
final IText input = new TextInput(user, "motd", true, ess);
|
final IText input = new TextInput(user, "motd", true, ess);
|
||||||
final IText output = new KeywordReplacer(input, user, ess);
|
final IText output = new KeywordReplacer(input, user, ess);
|
||||||
final TextPager pager = new TextPager(output, true);
|
final TextPager pager = new TextPager(output, true);
|
||||||
pager.showPage("1", null, user);
|
pager.showPage("1", null, "motd", user);
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class Commandhelp extends EssentialsCommand
|
||||||
output = new KeywordReplacer(input, user, ess);
|
output = new KeywordReplacer(input, user, ess);
|
||||||
}
|
}
|
||||||
final TextPager pager = new TextPager(output);
|
final TextPager pager = new TextPager(output);
|
||||||
pager.showPage(pageStr, chapterPageStr, user);
|
pager.showPage(pageStr, chapterPageStr, "help", user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,6 +21,6 @@ public class Commandinfo extends EssentialsCommand
|
||||||
final IText input = new TextInput(sender, "info", true, ess);
|
final IText input = new TextInput(sender, "info", true, ess);
|
||||||
final IText output = new KeywordReplacer(input, sender, ess);
|
final IText output = new KeywordReplacer(input, sender, ess);
|
||||||
final TextPager pager = new TextPager(output);
|
final TextPager pager = new TextPager(output);
|
||||||
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, sender);
|
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, "info", sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,6 @@ public class Commandmotd extends EssentialsCommand
|
||||||
final IText input = new TextInput(sender, "motd", true, ess);
|
final IText input = new TextInput(sender, "motd", true, ess);
|
||||||
final IText output = new KeywordReplacer(input, sender, ess);
|
final IText output = new KeywordReplacer(input, sender, ess);
|
||||||
final TextPager pager = new TextPager(output);
|
final TextPager pager = new TextPager(output);
|
||||||
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, sender);
|
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, "motd", sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,6 @@ public class Commandrules extends EssentialsCommand
|
||||||
final IText input = new TextInput(sender, "rules", true, ess);
|
final IText input = new TextInput(sender, "rules", true, ess);
|
||||||
final IText output = new KeywordReplacer(input, sender, ess);
|
final IText output = new KeywordReplacer(input, sender, ess);
|
||||||
final TextPager pager = new TextPager(output);
|
final TextPager pager = new TextPager(output);
|
||||||
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, sender);
|
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, "rules", sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ public class Commandsell extends EssentialsCommand
|
||||||
|
|
||||||
//TODO: Prices for Enchantments
|
//TODO: Prices for Enchantments
|
||||||
final ItemStack ris = is.clone();
|
final ItemStack ris = is.clone();
|
||||||
is.setAmount(amount);
|
ris.setAmount(amount);
|
||||||
InventoryWorkaround.removeItem(user.getInventory(), true, ris);
|
InventoryWorkaround.removeItem(user.getInventory(), true, ris);
|
||||||
user.updateInventory();
|
user.updateInventory();
|
||||||
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
|
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
|
||||||
|
|
|
@ -116,11 +116,11 @@ public class Commandspawnmob extends EssentialsCommand
|
||||||
}
|
}
|
||||||
if (mobData != null)
|
if (mobData != null)
|
||||||
{
|
{
|
||||||
changeMobData(mob.name, spawnedMob, mobData, user);
|
changeMobData(mob.getType(), spawnedMob, mobData, user);
|
||||||
}
|
}
|
||||||
if (spawnedMount != null && mountData != null)
|
if (spawnedMount != null && mountData != null)
|
||||||
{
|
{
|
||||||
changeMobData(mobMount.name, spawnedMount, mountData, user);
|
changeMobData(mobMount.getType(), spawnedMount, mountData, user);
|
||||||
}
|
}
|
||||||
if (args.length == 2)
|
if (args.length == 2)
|
||||||
{
|
{
|
||||||
|
@ -151,11 +151,11 @@ public class Commandspawnmob extends EssentialsCommand
|
||||||
}
|
}
|
||||||
if (mobData != null)
|
if (mobData != null)
|
||||||
{
|
{
|
||||||
changeMobData(mob.name, spawnedMob, mobData, user);
|
changeMobData(mob.getType(), spawnedMob, mobData, user);
|
||||||
}
|
}
|
||||||
if (spawnedMount != null && mountData != null)
|
if (spawnedMount != null && mountData != null)
|
||||||
{
|
{
|
||||||
changeMobData(mobMount.name, spawnedMount, mountData, user);
|
changeMobData(mobMount.getType(), spawnedMount, mountData, user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
user.sendMessage(args[1] + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned"));
|
user.sendMessage(args[1] + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned"));
|
||||||
|
@ -179,9 +179,9 @@ public class Commandspawnmob extends EssentialsCommand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeMobData(String type, Entity spawned, String data, User user) throws Exception
|
private void changeMobData(CreatureType type, Entity spawned, String data, User user) throws Exception
|
||||||
{
|
{
|
||||||
if ("Slime".equalsIgnoreCase(type))
|
if (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -192,17 +192,17 @@ public class Commandspawnmob extends EssentialsCommand
|
||||||
throw new Exception(_("slimeMalformedSize"), e);
|
throw new Exception(_("slimeMalformedSize"), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (("Sheep".equalsIgnoreCase(type)
|
if ((type == CreatureType.SHEEP
|
||||||
|| "Cow".equalsIgnoreCase(type)
|
|| type == CreatureType.COW
|
||||||
|| "Chicken".equalsIgnoreCase(type)
|
|| type == CreatureType.CHICKEN
|
||||||
|| "Pig".equalsIgnoreCase(type)
|
|| type == CreatureType.PIG
|
||||||
|| "Wolf".equalsIgnoreCase(type))
|
|| type == CreatureType.WOLF)
|
||||||
&& data.equalsIgnoreCase("baby"))
|
&& data.equalsIgnoreCase("baby"))
|
||||||
{
|
{
|
||||||
((Animals)spawned).setAge(-24000);
|
((Animals)spawned).setAge(-24000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ("Sheep".equalsIgnoreCase(type))
|
if (type == CreatureType.SHEEP)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -221,7 +221,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||||
throw new Exception(_("sheepMalformedColor"), e);
|
throw new Exception(_("sheepMalformedColor"), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("Wolf".equalsIgnoreCase(type)
|
if (type == CreatureType.WOLF
|
||||||
&& data.toLowerCase(Locale.ENGLISH).startsWith("tamed"))
|
&& data.toLowerCase(Locale.ENGLISH).startsWith("tamed"))
|
||||||
{
|
{
|
||||||
final Wolf wolf = ((Wolf)spawned);
|
final Wolf wolf = ((Wolf)spawned);
|
||||||
|
@ -233,7 +233,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||||
((Animals)spawned).setAge(-24000);
|
((Animals)spawned).setAge(-24000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("Wolf".equalsIgnoreCase(type)
|
if (type == CreatureType.WOLF
|
||||||
&& data.toLowerCase(Locale.ENGLISH).startsWith("angry"))
|
&& data.toLowerCase(Locale.ENGLISH).startsWith("angry"))
|
||||||
{
|
{
|
||||||
((Wolf)spawned).setAngry(true);
|
((Wolf)spawned).setAngry(true);
|
||||||
|
@ -242,7 +242,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||||
((Animals)spawned).setAge(-24000);
|
((Animals)spawned).setAge(-24000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered"))
|
if (type == CreatureType.CREEPER && data.equalsIgnoreCase("powered"))
|
||||||
{
|
{
|
||||||
((Creeper)spawned).setPowered(true);
|
((Creeper)spawned).setPowered(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class TextPager
|
||||||
this.onePage = onePage;
|
this.onePage = onePage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showPage(final String pageStr, final String chapterPageStr, final CommandSender sender)
|
public void showPage(final String pageStr, final String chapterPageStr, final String commandName, final CommandSender sender)
|
||||||
{
|
{
|
||||||
List<String> lines = text.getLines();
|
List<String> lines = text.getLines();
|
||||||
List<String> chapters = text.getChapters();
|
List<String> chapters = text.getChapters();
|
||||||
|
@ -45,16 +45,20 @@ public class TextPager
|
||||||
page = 1;
|
page = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int start = onePage ? 0 : (page - 1) * 9;
|
final int start = onePage ? 0 : (page - 1) * 9;
|
||||||
|
final int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
|
||||||
if (!onePage)
|
if (!onePage)
|
||||||
{
|
{
|
||||||
int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
|
|
||||||
sender.sendMessage(_("infoPages", page, pages));
|
sender.sendMessage(_("infoPages", page, pages));
|
||||||
}
|
}
|
||||||
for (int i = start; i < lines.size() && i < start + (onePage ? 20 : 9); i++)
|
for (int i = start; i < lines.size() && i < start + (onePage ? 20 : 9); i++)
|
||||||
{
|
{
|
||||||
sender.sendMessage(lines.get(i));
|
sender.sendMessage(lines.get(i));
|
||||||
}
|
}
|
||||||
|
if (!onePage && page < pages)
|
||||||
|
{
|
||||||
|
sender.sendMessage(_("readNextPage", commandName, page + 1));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,15 +112,20 @@ public class TextPager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pages = end / 9 + (end % 9 > 0 ? 1 : 0);
|
||||||
if (!onePage)
|
if (!onePage)
|
||||||
{
|
{
|
||||||
int pages = end / 9 + (end % 9 > 0 ? 1 : 0);
|
|
||||||
sender.sendMessage(_("infoPages", page, pages));
|
sender.sendMessage(_("infoPages", page, pages));
|
||||||
}
|
}
|
||||||
for (int i = start; i < end && i < start + (onePage ? 20 : 9); i++)
|
for (int i = start; i < end && i < start + (onePage ? 20 : 9); i++)
|
||||||
{
|
{
|
||||||
sender.sendMessage(lines.get(i));
|
sender.sendMessage(lines.get(i));
|
||||||
}
|
}
|
||||||
|
if (!onePage && page < pages)
|
||||||
|
{
|
||||||
|
sender.sendMessage(_("readNextPage", commandName, page + 1));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,15 +164,19 @@ public class TextPager
|
||||||
}
|
}
|
||||||
final int start = chapterstart + (onePage ? 0 : chapterpage * 9);
|
final int start = chapterstart + (onePage ? 0 : chapterpage * 9);
|
||||||
|
|
||||||
|
final int page = chapterpage + 1;
|
||||||
|
final int pages = (chapterend - chapterstart) / 9 + ((chapterend - chapterstart) % 9 > 0 ? 1 : 0);
|
||||||
if (!onePage)
|
if (!onePage)
|
||||||
{
|
{
|
||||||
final int page = chapterpage + 1;
|
|
||||||
final int pages = (chapterend - chapterstart) / 9 + ((chapterend - chapterstart) % 9 > 0 ? 1 : 0);
|
|
||||||
sender.sendMessage(_("infoChapterPages", pageStr, page, pages));
|
sender.sendMessage(_("infoChapterPages", pageStr, page, pages));
|
||||||
}
|
}
|
||||||
for (int i = start; i < chapterend && i < start + (onePage ? 20 : 9); i++)
|
for (int i = start; i < chapterend && i < start + (onePage ? 20 : 9); i++)
|
||||||
{
|
{
|
||||||
sender.sendMessage(lines.get(i));
|
sender.sendMessage(lines.get(i));
|
||||||
}
|
}
|
||||||
|
if (!onePage && page < pages)
|
||||||
|
{
|
||||||
|
sender.sendMessage(_("readNextPage", commandName, pageStr + " " + (page + 1)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,6 +269,7 @@ powerToolsDisabled=All of your power tools have been disabled.
|
||||||
powerToolsEnabled=All of your power tools have been enabled.
|
powerToolsEnabled=All of your power tools have been enabled.
|
||||||
protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0}
|
protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0}
|
||||||
questionFormat=\u00a77[Question]\u00a7f {0}
|
questionFormat=\u00a77[Question]\u00a7f {0}
|
||||||
|
readNextPage=Type /{0} {1} to read the next page
|
||||||
reloadAllPlugins=\u00a77Reloaded all plugins.
|
reloadAllPlugins=\u00a77Reloaded all plugins.
|
||||||
repair=You have successfully repaired your: \u00a7e{0}.
|
repair=You have successfully repaired your: \u00a7e{0}.
|
||||||
repairAlreadyFixed=\u00a77This item does not need repairing.
|
repairAlreadyFixed=\u00a77This item does not need repairing.
|
||||||
|
|
|
@ -269,6 +269,7 @@ powerToolsDisabled= All of your power tools have been disabled.
|
||||||
powerToolsEnabled= All of your power tools have been enabled.
|
powerToolsEnabled= All of your power tools have been enabled.
|
||||||
protectionOwner=\u00a76[EssentialsProtect] Beskyttelses ejer: {0}
|
protectionOwner=\u00a76[EssentialsProtect] Beskyttelses ejer: {0}
|
||||||
questionFormat=\u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0}
|
questionFormat=\u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0}
|
||||||
|
readNextPage=Type /{0} {1} to read the next page
|
||||||
reloadAllPlugins=\u00a77Genindl\u00e6ste alle tilf\u00f8jelser.
|
reloadAllPlugins=\u00a77Genindl\u00e6ste alle tilf\u00f8jelser.
|
||||||
repair=You have successfully repaired your: \u00a7e{0}.
|
repair=You have successfully repaired your: \u00a7e{0}.
|
||||||
repairAlreadyFixed=\u00a77This item does not need repairing.
|
repairAlreadyFixed=\u00a77This item does not need repairing.
|
||||||
|
|
|
@ -269,6 +269,7 @@ powerToolsDisabled=Alle deine Powertools wurden deaktiviert.
|
||||||
powerToolsEnabled=Alle deine Powertools wurden aktiviert.
|
powerToolsEnabled=Alle deine Powertools wurden aktiviert.
|
||||||
protectionOwner=\u00a76[EssentialsProtect] Besitzer dieses Blocks: {0}
|
protectionOwner=\u00a76[EssentialsProtect] Besitzer dieses Blocks: {0}
|
||||||
questionFormat=\u00a77[Frage]\u00a7f {0}
|
questionFormat=\u00a77[Frage]\u00a7f {0}
|
||||||
|
readNextPage=Type /{0} {1} to read the next page
|
||||||
reloadAllPlugins=\u00a77Alle plugins neu geladen.
|
reloadAllPlugins=\u00a77Alle plugins neu geladen.
|
||||||
repair=Du hast erfolgreich deine {0} repariert.
|
repair=Du hast erfolgreich deine {0} repariert.
|
||||||
repairAlreadyFixed=\u00a77Dieser Gegenstand ben\u00f6tigt keine Reparatur.
|
repairAlreadyFixed=\u00a77Dieser Gegenstand ben\u00f6tigt keine Reparatur.
|
||||||
|
|
|
@ -269,6 +269,7 @@ powerToolsDisabled=All of your power tools have been enabled.
|
||||||
powerToolsEnabled=All of your power tools have been enabled.
|
powerToolsEnabled=All of your power tools have been enabled.
|
||||||
protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0}
|
protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0}
|
||||||
questionFormat=\u00a77[Question]\u00a7f {0}
|
questionFormat=\u00a77[Question]\u00a7f {0}
|
||||||
|
readNextPage=Type /{0} {1} to read the next page
|
||||||
reloadAllPlugins=\u00a77Reloaded all plugins.
|
reloadAllPlugins=\u00a77Reloaded all plugins.
|
||||||
repair=You have successfully repaired your: \u00a7e{0}.
|
repair=You have successfully repaired your: \u00a7e{0}.
|
||||||
repairAlreadyFixed=\u00a77This item does not need repairing.
|
repairAlreadyFixed=\u00a77This item does not need repairing.
|
||||||
|
|
|
@ -269,6 +269,7 @@ powerToolsDisabled=All of your power tools have been disabled.
|
||||||
powerToolsEnabled=All of your power tools have been enabled.
|
powerToolsEnabled=All of your power tools have been enabled.
|
||||||
protectionOwner=\u00a76[EssentialsProtect] Dueño de la proteccion: {0}
|
protectionOwner=\u00a76[EssentialsProtect] Dueño de la proteccion: {0}
|
||||||
questionFormat=\u00a77[Pregunta]\u00a7f {0}
|
questionFormat=\u00a77[Pregunta]\u00a7f {0}
|
||||||
|
readNextPage=Type /{0} {1} to read the next page
|
||||||
reloadAllPlugins=\u00a77Todos los plugins recargados.
|
reloadAllPlugins=\u00a77Todos los plugins recargados.
|
||||||
repair=Has reparado satisfactoriamente tu: \u00a7e{0}.
|
repair=Has reparado satisfactoriamente tu: \u00a7e{0}.
|
||||||
repairAlreadyFixed=\u00a77Este objeto no necesita de reparado.
|
repairAlreadyFixed=\u00a77Este objeto no necesita de reparado.
|
||||||
|
|
|
@ -269,6 +269,7 @@ powerToolsDisabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 retir\u
|
||||||
powerToolsEnabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 activ\u00e9es.
|
powerToolsEnabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 activ\u00e9es.
|
||||||
protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0}
|
protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0}
|
||||||
questionFormat=\u00a77[Question]\u00a7f {0}
|
questionFormat=\u00a77[Question]\u00a7f {0}
|
||||||
|
readNextPage=Type /{0} {1} to read the next page
|
||||||
reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es.
|
reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es.
|
||||||
repair=Vous avez r\u00e9par\u00e9 votre : \u00a7e{0}.
|
repair=Vous avez r\u00e9par\u00e9 votre : \u00a7e{0}.
|
||||||
repairAlreadyFixed=\u00a77Cet objet n''a pas besoin de r\u00e9paration.
|
repairAlreadyFixed=\u00a77Cet objet n''a pas besoin de r\u00e9paration.
|
||||||
|
|
|
@ -269,6 +269,7 @@ powerToolsDisabled=All of your power tools have been disabled.
|
||||||
powerToolsEnabled=All of your power tools have been enabled.
|
powerToolsEnabled=All of your power tools have been enabled.
|
||||||
protectionOwner=\u00a76[EssentialsProtect] Beschermingeigenaar: {0}
|
protectionOwner=\u00a76[EssentialsProtect] Beschermingeigenaar: {0}
|
||||||
questionFormat=\u00a77[Vraag]\u00a7f {0}
|
questionFormat=\u00a77[Vraag]\u00a7f {0}
|
||||||
|
readNextPage=Type /{0} {1} to read the next page
|
||||||
reloadAllPlugins=\u00a77Alle plugins zijn herladen.
|
reloadAllPlugins=\u00a77Alle plugins zijn herladen.
|
||||||
repair=You have successfully repaired your: \u00a7e{0}.
|
repair=You have successfully repaired your: \u00a7e{0}.
|
||||||
repairAlreadyFixed=\u00a77This item does not need repairing.
|
repairAlreadyFixed=\u00a77This item does not need repairing.
|
||||||
|
|
Loading…
Reference in a new issue