diff options
author | Iaccidentally <coryhuckaby@gmail.com> | 2012-11-14 15:16:39 -0500 |
---|---|---|
committer | Iaccidentally <coryhuckaby@gmail.com> | 2012-11-14 15:16:39 -0500 |
commit | e983cdf14d3de07f419262b6b6753adde116bd16 (patch) | |
tree | f3e0743ad28188fbc7ab44f823ba99ba9c0518a7 | |
parent | 9af7ab52ea8b149aeac68bdd6755070ea22ead3d (diff) | |
download | Essentials-e983cdf14d3de07f419262b6b6753adde116bd16.tar Essentials-e983cdf14d3de07f419262b6b6753adde116bd16.tar.gz Essentials-e983cdf14d3de07f419262b6b6753adde116bd16.tar.lz Essentials-e983cdf14d3de07f419262b6b6753adde116bd16.tar.xz Essentials-e983cdf14d3de07f419262b6b6753adde116bd16.zip |
Add feed sign
-rw-r--r-- | EssentialsSigns/src/net/ess3/signs/Signs.java | 24 | ||||
-rw-r--r-- | EssentialsSigns/src/net/ess3/signs/signs/SignFeed.java | 35 | ||||
-rw-r--r-- | pom.xml | 2 |
3 files changed, 49 insertions, 12 deletions
diff --git a/EssentialsSigns/src/net/ess3/signs/Signs.java b/EssentialsSigns/src/net/ess3/signs/Signs.java index a81bd2e55..6cf7aae54 100644 --- a/EssentialsSigns/src/net/ess3/signs/Signs.java +++ b/EssentialsSigns/src/net/ess3/signs/Signs.java @@ -1,22 +1,23 @@ package net.ess3.signs; -import net.ess3.signs.signs.SignMail; -import net.ess3.signs.signs.SignDisposal; +import net.ess3.signs.signs.SignBalance; import net.ess3.signs.signs.SignBuy; -import net.ess3.signs.signs.SignWarp; -import net.ess3.signs.signs.SignSpawnmob; -import net.ess3.signs.signs.SignTime; -import net.ess3.signs.signs.SignWeather; +import net.ess3.signs.signs.SignDisposal; import net.ess3.signs.signs.SignEnchant; -import net.ess3.signs.signs.SignHeal; +import net.ess3.signs.signs.SignFeed; import net.ess3.signs.signs.SignFree; -import net.ess3.signs.signs.SignInfo; -import net.ess3.signs.signs.SignBalance; -import net.ess3.signs.signs.SignSell; import net.ess3.signs.signs.SignGameMode; +import net.ess3.signs.signs.SignHeal; +import net.ess3.signs.signs.SignInfo; import net.ess3.signs.signs.SignKit; -import net.ess3.signs.signs.SignTrade; +import net.ess3.signs.signs.SignMail; import net.ess3.signs.signs.SignRepair; +import net.ess3.signs.signs.SignSell; +import net.ess3.signs.signs.SignSpawnmob; +import net.ess3.signs.signs.SignTime; +import net.ess3.signs.signs.SignTrade; +import net.ess3.signs.signs.SignWarp; +import net.ess3.signs.signs.SignWeather; public enum Signs @@ -25,6 +26,7 @@ public enum Signs BUY(new SignBuy()), DISPOSAL(new SignDisposal()), ENCHANT(new SignEnchant()), + FEED(new SignFeed()), FREE(new SignFree()), GAMEMODE(new SignGameMode()), HEAL(new SignHeal()), diff --git a/EssentialsSigns/src/net/ess3/signs/signs/SignFeed.java b/EssentialsSigns/src/net/ess3/signs/signs/SignFeed.java new file mode 100644 index 000000000..ab5151caf --- /dev/null +++ b/EssentialsSigns/src/net/ess3/signs/signs/SignFeed.java @@ -0,0 +1,35 @@ +package net.ess3.signs.signs; + +import static net.ess3.I18n._; +import net.ess3.api.ChargeException; +import net.ess3.api.IEssentials; +import net.ess3.api.IUser; +import net.ess3.economy.Trade; +import net.ess3.signs.EssentialsSign; + + +public class SignFeed extends EssentialsSign +{ + public SignFeed() + { + super("Feed"); + } + + @Override + protected boolean onSignCreate(final ISign sign, final IUser player, final String username, final IEssentials ess) throws SignException + { + validateTrade(sign, 1, ess); + return true; + } + + @Override + protected boolean onSignInteract(final ISign sign, final IUser player, final String username, final IEssentials ess) throws SignException, ChargeException + { + final Trade charge = getTrade(sign, 1, ess); + charge.isAffordableFor(player); + player.getPlayer().setFoodLevel(20); + player.sendMessage(_("feed")); + charge.charge(player); + return true; + } +} @@ -76,7 +76,7 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <bukkit.version>1.4.2-R0.3-SNAPSHOT</bukkit.version> + <bukkit.version>1.4.4-R0.1-SNAPSHOT</bukkit.version> <build.number>Unknown</build.number> <org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs> <org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>2</org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width> |