mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-28 01:10:52 +00:00
DERP
This commit is contained in:
parent
98de950ae2
commit
63680b4911
1 changed files with 6 additions and 7 deletions
|
@ -1,10 +1,9 @@
|
||||||
package com.earth2me.essentials.commands;
|
package com.earth2me.essentials.commands;
|
||||||
|
|
||||||
import static com.earth2me.essentials.I18n._;
|
import static com.earth2me.essentials.I18n._;
|
||||||
|
import com.earth2me.essentials.User;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class Commanddurability extends EssentialsCommand
|
public class Commanddurability extends EssentialsCommand
|
||||||
|
@ -18,25 +17,25 @@ public class Commanddurability extends EssentialsCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
ItemStack itemStack = ((Player)sender).getItemInHand();
|
ItemStack itemStack = user.getItemInHand();
|
||||||
maxuses = itemStack.getType().getMaxDurability();
|
maxuses = itemStack.getType().getMaxDurability();
|
||||||
durability = ((itemStack.getType().getMaxDurability() + 1) - itemStack.getDurability());
|
durability = ((itemStack.getType().getMaxDurability() + 1) - itemStack.getDurability());
|
||||||
if (itemStack.getType() != Material.AIR)
|
if (itemStack.getType() != Material.AIR)
|
||||||
{
|
{
|
||||||
if (maxuses != 0)
|
if (maxuses != 0)
|
||||||
{
|
{
|
||||||
sender.sendMessage(_("durability", Integer.toString(durability)));
|
user.sendMessage(_("durability", Integer.toString(durability)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sender.sendMessage(_("notATool"));
|
user.sendMessage(_("notATool"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sender.sendMessage(_("nothingInHand"));
|
user.sendMessage(_("nothingInHand"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue