Creepinson

Untitled

Feb 19th, 2017
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. package me.creepinson.commands;
  2.  
  3. import java.util.List;
  4.  
  5. import me.creepinson.Main.Main;
  6. import me.creepinson.entities.EntityPlayerClone;
  7. import me.creepinson.lib.RefStrings;
  8. import net.minecraft.command.CommandException;
  9. import net.minecraft.command.ICommand;
  10. import net.minecraft.command.ICommandSender;
  11. import net.minecraft.entity.Entity;
  12. import net.minecraft.entity.EntityList;
  13. import net.minecraft.server.MinecraftServer;
  14. import net.minecraft.util.math.BlockPos;
  15. import net.minecraft.util.text.TextComponentTranslation;
  16. import net.minecraft.world.World;
  17.  
  18. public class CommandClone implements ICommand
  19. {
  20.  
  21.  
  22. protected EntityPlayerClone cloneEntity;
  23.  
  24. public CommandClone()
  25. {
  26.  
  27.  
  28. }
  29.  
  30.  
  31. @Override
  32. public String getCommandName()
  33. {
  34. return "clone";
  35. }
  36.  
  37. @Override
  38. public String getCommandUsage(ICommandSender var1)
  39. {
  40. return "clone";
  41. }
  42.  
  43. @Override
  44. public List getCommandAliases()
  45. {
  46. return null;
  47.  
  48. }
  49.  
  50. public void processCommand(ICommandSender sender, String[] argString)
  51. {
  52. World world = sender.getEntityWorld();
  53.  
  54. if (world.isRemote)
  55. {
  56. System.out.println("Not processing on Client side");
  57. }
  58. else
  59. {
  60. System.out.println("Processing on Server side");
  61. if(argString.length == 0)
  62. {
  63. sender.addChatMessage(new TextComponentTranslation("Invalid argument"));
  64. return;
  65. }
  66. else if(argString[0].equalsIgnoreCase("player") || argString[0].equalsIgnoreCase("p")){
  67. if(argString[1].equalsIgnoreCase(null));
  68. {
  69.  
  70. sender.addChatMessage(new TextComponentTranslation("Please Specify a Username!"));
  71. }
  72.  
  73. if(argString[1].equalsIgnoreCase("")){
  74. cloneEntity.getLocationSkin(argString[1]);
  75. world.spawnEntityInWorld(cloneEntity);
  76. sender.addChatMessage(new TextComponentTranslation("Cloned Player: " + argString[1]));
  77.  
  78. }
  79. }
  80. }
  81.  
  82.  
  83.  
  84. }
  85.  
  86.  
  87. public boolean canCommandSenderUseCommand(ICommandSender var1)
  88. {
  89. return true;
  90. }
  91.  
  92. public List addTabCompletionOptions(ICommandSender var1, String[] var2)
  93. {
  94. // TODO Auto-generated method stub
  95. return null;
  96. }
  97.  
  98. @Override
  99. public boolean isUsernameIndex(String[] var1, int var2)
  100. {
  101. // TODO Auto-generated method stub
  102. return false;
  103. }
  104.  
  105.  
  106. @Override
  107. public int compareTo(ICommand o) {
  108.  
  109. return 0;
  110. }
  111.  
  112.  
  113. @Override
  114. public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
  115. // TODO Auto-generated method stub
  116.  
  117. }
  118.  
  119.  
  120. @Override
  121. public boolean checkPermission(MinecraftServer server, ICommandSender sender) {
  122. // TODO Auto-generated method stub
  123. return false;
  124. }
  125.  
  126.  
  127. @Override
  128. public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args,
  129. BlockPos pos) {
  130. // TODO Auto-generated method stub
  131. return null;
  132. }
  133. }
Add Comment
Please, Sign In to add comment