Advertisement
Shovelwarf_

Untitled

Nov 18th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. options:
  2. prefix : &c[&aWorld Regenerate&c]&r
  3. variables:
  4. {BlockType::*} = 0
  5. {BlockLoc::*) = 0
  6. {Count} = 0
  7. {DebugState.%player%} = 0
  8. on mine:
  9. set {BlockType::%{Count}%} to type of block
  10. set {BlockLoc::%{Count}%} to location of block
  11. if {DebugState.%event-player%} is 1:
  12. message "{@prefix} &cBlock Break:"
  13. message "{@prefix} &cType: %{BlockType::%{Count}%}%"
  14. message "{@prefix} &cLocation: %{BlockLoc::%{Count}%}%"
  15. message " "
  16. add 1 to {Count}
  17. on place:
  18. set {BlockType::%{Count}%} to air
  19. set {BlockLoc::%{Count}%} to location of block
  20. if {DebugState.%event-player%} is 1:
  21. message "{@prefix} &aBlock Place"
  22. message "{@prefix} &aType: %{BlockType::%{Count}%}%"
  23. message "{@prefix} &aLocation: %{BlockLoc::%{Count}%}%"
  24. message " "
  25. add 1 to {Count}
  26. command /worldregenerate <text>:
  27. description: To let you regenerate what you have placed or destroyed
  28. usage: &e/wrg help &afor more help
  29. aliases: /wr, /wrg
  30. trigger:
  31. if player has permission "WorldRegenerate.admin":
  32. if arg-1 is "reset" or "rs":
  33. set {_BlockLocTempCount} to 1
  34. loop {BlockLoc::*}:
  35. delete {BlockLoc::%{_BlockLocTempCount}%}
  36. delete {BlockType::%{_BlockLocTempCount}%}
  37. add 1 to {_BlockLocTempCount}
  38. set {Count} to 0
  39. message "{@prefix} &cYou resetted all data of block and they no longer can be regenerated."
  40. if arg-1 is "regen" or "regenerate" or "rg" or "r":
  41. broadcast "{@prefix} &aBlocks to regenerate: &e%{Count}%"
  42. loop {BlockLoc::*}:
  43. remove 1 from {Count}
  44. if {DebugState.%event-player%} is 1:
  45. broadcast " "
  46. broadcast "{@prefix} &aRegenerating..."
  47. broadcast "{@prefix} &aBlock Location: %{BlockLoc::%{Count}%}%"
  48. broadcast "{@prefix} &aBlock Type: %{BlockType::%{Count}%}%"
  49. broadcast " "
  50. set block at {BlockLoc::%{Count}%} to {BlockType::%{Count}%}
  51. set {_BlockLocRegenTempCount} to 1
  52. loop {BlockLoc::*}:
  53. delete {BlockLoc::%{_BlockLocRegenTempCount}%}
  54. delete {BlockType::%{_BlockLocRegenTempCount}%}
  55. add 1 to {_BlockLocRegenTempCount}
  56. set {Count} to 0
  57. broadcast "{@prefix} &aRegenerate complete."
  58. if arg-1 is "debug" or "d" or "db":
  59. if {DebugState.%event-player%} is 0:
  60. set {DebugState.%event-player%} to 1
  61. message "{@prefix} &aYou turned on debug mode."
  62. stop
  63. if {DebugState.%event-player%} is 1:
  64. set {DebugState.%event-player%} to 0
  65. message "{@prefix} &cYou turned off debug mode."
  66. stop
  67. if arg-1 is "help" or "h" or "hp":
  68. message " "
  69. message "&a=================================================="
  70. message "&eAuthor: i998979"
  71. message "&cMain Command:"
  72. message "&aPermission: &eWorldRegenerate.admin"
  73. message " &e/worldregenerate <argument>"
  74. message " &aAliases: /wr, /wrg, /rg"
  75. message "&cSub Commands:"
  76. message " &eregenerate:"
  77. message " &aAliases: regen, rg, r"
  78. message " &aUsage: To regenerate the block that broke or placed"
  79. message " &ereset:"
  80. message " &aAliases: rs"
  81. message " &aUsage: To reset the database of all block"
  82. message " &aand they will no longer can be regenerated"
  83. message " &edebug:"
  84. message " &aAliases: d"
  85. message " &aUsage: To turn on/off the debug message"
  86. message " &athat shows what block was placed, destroyed"
  87. message " &aand the location of it"
  88. message " &ehelp:"
  89. message " &aAliases: h"
  90. message " &aUsage: To show this help menu"
  91. message "&a=================================================="
  92. message " "
  93. else:
  94. message "{@prefix} &cYou are not allowed to perform this command."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement