CommandGrow.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package me.km.commands;
  2. import me.km.api.GlobalText;
  3. import me.km.api.Module;
  4. import me.km.api.ModuleCommand;
  5. import me.km.permissions.Permissions;
  6. import net.minecraft.command.ICommandSender;
  7. import net.minecraft.entity.player.EntityPlayer;
  8. public class CommandGrow extends ModuleCommand
  9. {
  10. public CommandGrow(Module m)
  11. {
  12. super("grow", m);
  13. super.setDescription("Lässt die Pflanzen in deiner Umgebung wachsen");
  14. super.setUsage("/grow");
  15. super.setPermission(Permissions.GROW);
  16. }
  17. @Override
  18. public boolean execute(ICommandSender cs, String[] arg)
  19. {
  20. if(!(cs instanceof EntityPlayer))
  21. {
  22. this.getModule().send(cs, GlobalText.onlyPlayer());
  23. return true;
  24. }
  25. // TODO
  26. /*Block l = ((EntityPlayer) cs).getLocation().getBlock();
  27. Block b;
  28. for(int x = -3; x < 4; x++)
  29. {
  30. for(int y = -3; y < 4; y++)
  31. {
  32. for(int z = -3; z < 4; z++)
  33. {
  34. b = l.getRelative(x, y, z);
  35. if(!(b.getState().getData() instanceof Crops))
  36. {
  37. continue;
  38. }
  39. if(((Crops) b.getState().getData()).getState() != CropState.RIPE)
  40. {
  41. BlockState state = b.getState();
  42. Crops crop = ((Crops) state.getData());
  43. crop.setState(CropState.RIPE);
  44. state.setData(crop);
  45. state.update();
  46. }
  47. }
  48. }
  49. }
  50. this.getModule().send(cs, "Die Pflanzen in deiner Umgebung sind gewachsen.");*/
  51. return true;
  52. }
  53. }