Advertisement
Nessiesson

Untitled

Nov 13th, 2017
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. package net.minecraft.command.server;
  2.  
  3. import net.minecraft.command.CommandBase;
  4. import net.minecraft.command.CommandException;
  5. import net.minecraft.command.ICommandSender;
  6. import net.minecraft.entity.player.EntityPlayerMP;
  7. import net.minecraft.server.MinecraftServer;
  8. import net.minecraft.util.text.TextComponentTranslation;
  9.  
  10. public class CommandLeaveServer extends CommandBase {
  11.  
  12. public String getName()
  13. {
  14. return "l";
  15. }
  16.  
  17. public String getUsage(ICommandSender sender)
  18. {
  19. return "command.usage.l";
  20. }
  21.  
  22. public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
  23. {
  24. EntityPlayerMP player = getCommandSenderAsPlayer(sender);
  25. player.connection.disconnect(new TextComponentTranslation("You've left the server."));
  26. }
  27.  
  28. public boolean checkPermission(MinecraftServer server, ICommandSender sender) {
  29. return true;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement