From 0e3f48ee54c13acde2a236b2ad6cb24e29676ec6 Mon Sep 17 00:00:00 2001 From: montlikadani Date: Thu, 30 May 2019 15:03:12 +0200 Subject: [PATCH] Improve disposal, /bigtree and /fireball (#2461) @montlikadani * Allow the Disposal inventory title to be configurable * Add darkoak to `/bigtree`'s usage message * Allow potions to be fired with `/fireball` ## Commits * Update plugin.yml * Update Commanddisposal.java * Update messages.properties * Update Commandfireball.java * Update SignDisposal.java * Fix import * Remove colour code from disposal message --- .../com/earth2me/essentials/commands/Commanddisposal.java | 2 +- .../com/earth2me/essentials/commands/Commandfireball.java | 6 +++++- .../src/com/earth2me/essentials/signs/SignDisposal.java | 4 +++- Essentials/src/messages.properties | 1 + Essentials/src/plugin.yml | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddisposal.java b/Essentials/src/com/earth2me/essentials/commands/Commanddisposal.java index f4751e044..3239b5d80 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddisposal.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddisposal.java @@ -14,7 +14,7 @@ public class Commanddisposal extends EssentialsCommand { @Override protected void run(Server server, User user, String commandLabel, String[] args) throws Exception { user.sendMessage(tl("openingDisposal")); - user.getBase().openInventory(ess.getServer().createInventory(user.getBase(), 36, "Disposal")); + user.getBase().openInventory(ess.getServer().createInventory(user.getBase(), 36, tl("disposal"))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java index fcb77161d..0768aafcd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java @@ -34,6 +34,10 @@ public class Commandfireball extends EssentialsCommand { type = ThrownExpBottle.class; } else if (args[0].equalsIgnoreCase("large")) { type = LargeFireball.class; + } else if (args[0].equalsIgnoreCase("splashpotion")) { + type = SplashPotion.class; + } else if (args[0].equalsIgnoreCase("lingeringpotion")) { + type = LingeringPotion.class; } } final Vector direction = user.getBase().getEyeLocation().getDirection().multiply(speed); @@ -45,7 +49,7 @@ public class Commandfireball extends EssentialsCommand { @Override protected List getTabCompleteOptions(final Server server, final User user, final String commandLabel, final String[] args) { if (args.length == 1) { - return Lists.newArrayList("small", "arrow", "skull", "egg", "snowball", "expbottle", "large"); + return Lists.newArrayList("small", "arrow", "skull", "egg", "snowball", "expbottle", "large", "splashpotion", "lingeringpotion"); } else { return Collections.emptyList(); } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java index 7ede34ec9..e0de8e0c5 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java @@ -3,6 +3,8 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.User; import net.ess3.api.IEssentials; +import static com.earth2me.essentials.I18n.tl; + public class SignDisposal extends EssentialsSign { public SignDisposal() { @@ -11,7 +13,7 @@ public class SignDisposal extends EssentialsSign { @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { - player.getBase().openInventory(ess.getServer().createInventory(player.getBase(), 36, "Disposal")); + player.getBase().openInventory(ess.getServer().createInventory(player.getBase(), 36, tl("disposal"))); return true; } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index c9e2e8b36..82e89dc10 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -97,6 +97,7 @@ destinationNotSet=Destination not set\! disabled=disabled disabledToSpawnMob=\u00a74Spawning this mob was disabled in the config file. disableUnlimited=\u00a76Disabled unlimited placing of\u00a7c {0} \u00a76for\u00a7c {1}\u00a76. +disposal=Disposal distance=\u00a76Distance\: {0} dontMoveMessage=\u00a76Teleportation will commence in\u00a7c {0}\u00a76. Don''t move. downloadingGeoIp=Downloading GeoIP database... this might take a while (country\: 1.7 MB, city\: 30MB) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index e62786c0c..5f73a1d1d 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -59,7 +59,7 @@ commands: aliases: [bcw,ebcw,bcastw,ebcastw,ebroadcastworld,shoutworld,eshoutworld] bigtree: description: Spawn a big tree where you are looking. - usage: / + usage: / aliases: [ebigtree,largetree,elargetree] burn: description: Set a player on fire.