CommandQuestInfo.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package me.km.snuviscript;
  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 CommandQuestInfo extends ModuleCommand
  10. {
  11. public CommandQuestInfo(Module m)
  12. {
  13. super("questinfo", m);
  14. super.setDescription("Gibt dir Information über deine Quest");
  15. super.setUsage("/questinfo");
  16. super.setPermission(Permissions.QUESTINFO);
  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. EntityPlayer p = (EntityPlayer) cs;
  27. Script data = KajetansMod.scripts.getQuestData(p);
  28. if(data == null)
  29. {
  30. this.getModule().send(cs, "Du hast gerade keine Quest.");
  31. return true;
  32. }
  33. this.getModule().send(cs, data.getInfo());
  34. return true;
  35. }
  36. }