CommandTest.java 965 B

123456789101112131415161718192021222324252627282930313233343536
  1. package me.km.commands;
  2. import me.km.KajetansMod;
  3. import me.km.api.GlobalText;
  4. import me.km.api.Module;
  5. import me.km.api.ModuleCommand;
  6. import me.km.permissions.Permissions;
  7. import net.minecraft.command.ICommandSender;
  8. import net.minecraft.entity.player.EntityPlayer;
  9. public class CommandTest extends ModuleCommand
  10. {
  11. public CommandTest(Module m)
  12. {
  13. super("test", m);
  14. super.setDescription("Für Tests");
  15. super.setUsage("/test");
  16. super.setPermission(Permissions.TEST);
  17. }
  18. @Override
  19. public boolean execute(ICommandSender cs, String[] arg)
  20. {
  21. if(!(cs instanceof EntityPlayer))
  22. {
  23. this.getModule().send(cs, GlobalText.onlyPlayer());
  24. return true;
  25. }
  26. this.getModule().send(cs, "Das ist ein Test.");
  27. KajetansMod.scheduler.scheduleTask(() ->
  28. {
  29. this.getModule().send(cs, "TIMERTEST");
  30. }, 100);
  31. return true;
  32. }
  33. }