plots.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. event.load("block_click");
  2. event.load("explosion");
  3. all_signs_tag = block.getTag("minecraft:all_signs");
  4. msg.string("dev", "§bPlots §rloaded.");
  5. @wait
  6. wait();
  7. ignoreGoto(event);
  8. goto("wait");
  9. @explosion
  10. entity_loc = entity.getLocation(entity);
  11. plot_list = plot.get(entity_loc);
  12. plot_amount = list.getSize(plot_list);
  13. for(i = 0; i < plot_amount; i++) {
  14. plot = list.getIndex(plot_list, i);
  15. if(plot.isExplosive(plot)) {
  16. cancel = false;
  17. } else {
  18. cancel = true;
  19. break;
  20. }
  21. }
  22. // no explosions in crea world
  23. world_name = world.getName(loc.getWorld(entity_loc));
  24. if(world.isCreativeName(world_name)) {
  25. goto("wait");
  26. }
  27. // if no plot exists allow explosions
  28. if(plot_amount == 0) {
  29. cancel = false;
  30. }
  31. goto("wait");
  32. @block_click
  33. if(action != "RIGHT_CLICK_BLOCK") {
  34. goto("wait");
  35. }
  36. if(!block.hasTag(block, all_signs_tag)) {
  37. goto("wait");
  38. }
  39. plot_list = plot.get(block.getLocation(block));
  40. plot_amount = list.getSize(plot_list);
  41. for(i = 0; i < plot_amount; i++) {
  42. plot = list.getIndex(plot_list, i);
  43. if(plot.hasDisabledSigns(plot)) {
  44. cancel = true;
  45. break;
  46. } else {
  47. cancel = false;
  48. }
  49. }
  50. //Kein Grundstück existiert
  51. if(plot_amount == 0) {
  52. cancel = false;
  53. }
  54. goto("wait");