teleporter.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. dispenser_mat = material.get("DISPENSER");
  2. shroomlight_mat = material.get("SHROOMLIGHT");
  3. air_mat = material.getAir();
  4. tinted_glass_mat = material.get("TINTED_GLASS");
  5. gear = customitem.getGear();
  6. slabs_tag = block.getTag("minecraft:slabs");
  7. logs_tag = block.getTag("minecraft:logs");
  8. planks_tag = block.getTag("minecraft:planks");
  9. teleporter.setLayout();
  10. tp_list = list.new();
  11. tp_map = map.new();
  12. tp_set = set.new();
  13. piston_sound = sound.get("block.piston.extend");
  14. adv_tp_sound = sound.get("block.portal.travel");
  15. sound_category_ambient = sound.getCategory("AMBIENT");
  16. overworld = world.getOverWorld();
  17. random_tp_loc = loc.new(overworld, 134, 79, 5);
  18. event.load("block_click");
  19. msg.string("dev", "§bTeleporter §rloaded.");
  20. @main
  21. wait();
  22. ignoreGoto(event);
  23. goto("main");
  24. @block_click
  25. if(block == null) {
  26. goto("main");
  27. }
  28. if(slot.isOffHand(hand)) {
  29. goto("main");
  30. }
  31. block_loc = block.getLocation(block);
  32. if(block.getType(block) == dispenser_mat && action == "LEFT_CLICK_BLOCK") {
  33. if(!teleporter.isLayout(block_loc)) {
  34. goto("main");
  35. }
  36. list = list.new();
  37. list.add(list, text.new("Teleport"));
  38. list.add(list, text.new(world.getName(loc.getWorld(block_loc))));
  39. list.add(list, text.new(string.number(loc.getX(block_loc))));
  40. list.add(list, text.new(string.number(loc.getY(block_loc))));
  41. list.add(list, text.new(string.number(loc.getZ(block_loc))));
  42. tp_item = customitem.create("GEAR", 1, null, list);
  43. player.giveItem(player, tp_item);
  44. goto("main");
  45. }
  46. if(block.getType(block) == shroomlight_mat && action == "RIGHT_CLICK_BLOCK") {
  47. if(!teleporter.isLayout(block_loc)) {
  48. goto("main");
  49. }
  50. player_uuid = player.getUuid(player);
  51. clicked = map.getOrDefault(tp_map, player_uuid, 0);
  52. now_time = time.getMillis();
  53. if(now_time - clicked < 5000) {
  54. msg.prefix(player, "§5Teleport", "Wait 5 seconds!");
  55. goto("main");
  56. }
  57. map.add(tp_map, player_uuid, now_time);
  58. //Random-Teleport
  59. if(block_loc == random_tp_loc) {
  60. /*if(!player.isOnAdventure(player)) {
  61. if(!player.hasClearInventory(player)) {
  62. msg.prefix(player, "§5Adventure", "Your inventory needs to be empty!");
  63. goto("main");
  64. }*/
  65. disp_loc = loc.mod(block_loc, 0, 4, 0);
  66. alpha = math.random(0, 360);
  67. alpha *= math.pi() / 180;
  68. x = math.round(math.sin(alpha) * 5000) + 0.5;
  69. z = math.round(math.cos(alpha) * 5000) + 0.5;
  70. tp_loc = loc.getHighestPoint(loc.new(world.getOverWorld(), x, 0, z));
  71. setTpWallX(disp_loc, tinted_glass_mat);
  72. sound.spawn(disp_loc, piston_sound, sound_category_ambient);
  73. player_uuid = player.getUuid(player);
  74. array = array.new(4);
  75. array[0] = player_uuid;
  76. array[1] = disp_loc;
  77. array[2] = tp_loc;
  78. //array[3] = true;
  79. array[3] = false;
  80. list.add(tp_list, array);
  81. set.add(tp_set, player_uuid);
  82. sgoto(30, "tp_ticker");
  83. //}
  84. goto("main");
  85. }
  86. //Normaler Teleport
  87. temp = false;
  88. disp_loc = loc.mod(block_loc, 0, 4, 0);
  89. disp_block = block.get(disp_loc);
  90. inv = block.getInventory(disp_block);
  91. inv_size = inv.getSize(inv);
  92. for(i = 0; i < inv_size; i++) {
  93. item = inv.getItem(inv, i);
  94. if(customitem.isGear(item)) {
  95. temp = true;
  96. break;
  97. }
  98. }
  99. if(!temp) {
  100. msg.prefix(player, "§5Teleport", "No receiver found!");
  101. goto("main");
  102. }
  103. lore_list = item.getLore(item);
  104. if(list.getSize(lore_list) != 5) {
  105. msg.prefix(player, "§5Teleport", "No receiver found!");
  106. goto("main");
  107. }
  108. name = string.text(list.getIndex(lore_list, 0));
  109. if(string.removeFormat(name) != "Teleport") {
  110. msg.prefix(player, "§5Teleport", "No receiver found!");
  111. goto("main");
  112. }
  113. teleporter_world = loc.getWorld(disp_loc);
  114. if(!world.isSurvName(world.getName(teleporter_world))) {
  115. msg.prefix(player, "§5Teleport", "Not allowed in this world!");
  116. goto("main");
  117. }
  118. world = world.get(string.text(list.getIndex(lore_list, 1)));
  119. x = read.number(string.text(list.getIndex(lore_list, 2)));
  120. y = read.number(string.text(list.getIndex(lore_list, 3)));
  121. z = read.number(string.text(list.getIndex(lore_list, 4)));
  122. tp_loc = loc.new(world, x, y, z);
  123. if(!teleporter.isLayout(tp_loc)) {
  124. msg.prefix(player, "§5Teleport", "No receiver found!");
  125. goto("main");
  126. }
  127. loc.add(tp_loc, 0.5, -3, 0.5);
  128. setTpWallX(disp_loc, tinted_glass_mat);
  129. sound.spawn(disp_loc, piston_sound, sound_category_ambient);
  130. array = array.new(4);
  131. array[0] = player.getUuid(player);
  132. array[1] = disp_loc;
  133. array[2] = tp_loc;
  134. array[3] = false;
  135. list.add(tp_list, array);
  136. sgoto(30, "tp_ticker");
  137. }
  138. goto("main");
  139. @tp_ticker
  140. array = list.getIndex(tp_list, 0);
  141. list.removeIndex(tp_list, 0);
  142. block_loc = array[1];
  143. list.add(tp_list, array);
  144. setTpWallFull(block_loc, tinted_glass_mat);
  145. sound.spawn(block_loc, piston_sound, sound_category_ambient);
  146. sgoto(30, "tp_final");
  147. goto("main");
  148. @tp_final
  149. array = list.getIndex(tp_list, 0);
  150. list.removeIndex(tp_list, 0);
  151. player_uuid = array[0];
  152. block_loc = array[1];
  153. tp_loc = array[2];
  154. adventure = array[3];
  155. set.remove(tp_set, player_uuid);
  156. sound.spawn(block_loc, piston_sound, sound_category_ambient);
  157. setTpWallFull(block_loc, air_mat);
  158. player = player.get(player_uuid);
  159. if(player == null) {
  160. goto("main");
  161. }
  162. if(adventure) {
  163. //Party
  164. if(player.isInParty(player) && player.isPartyLeader(player)) {
  165. party_id = player.getPartyId(player);
  166. party_list = party.getList(party_id);
  167. iter = list.iterator(party_list);
  168. while(hasNext(iter)) {
  169. p = player.get(next(iter));
  170. p_name = player.getName(p);
  171. p_loc = entity.getLocation(p);
  172. if(!loc.isSameWorld(random_tp_loc, p_loc)) {
  173. msg.prefix(player, "§5Party", string.concat(p_name, "§c is in another world."));
  174. msg.prefix(p, "§5Party", "§cYou are in another world.");
  175. continue;
  176. }
  177. if(loc.distance(random_tp_loc, p_loc) > 5) {
  178. msg.prefix(player, "§5Party", string.concat(p_name, "§c is too far away."));
  179. msg.prefix(p, "§5Party", "§cYou are too far away.");
  180. continue;
  181. }
  182. if(player.hasMinigame(p)) {
  183. msg.prefix(player, "§5Party", string.concat(p_name, "§c is in a game."));
  184. msg.prefix(p, "§5Party", "§cYou are in a game.");
  185. continue;
  186. }
  187. if(player.hasQuest2(p)) {
  188. msg.prefix(player, "§5Party", string.concat(p_name, "§c is doing a quest."));
  189. msg.prefix(p, "§5Party", "§cYou are doing a quest.");
  190. continue;
  191. }
  192. if(player.isOnAdventure(p)) {
  193. msg.prefix(player, "§5Party", string.concat(p_name, "§c is already on an adventure."));
  194. msg.prefix(p, "§5Party", "§cYou are already on an adventure.");
  195. continue;
  196. }
  197. if(player.isAfk(p)) {
  198. msg.prefix(player, "§5Party", string.concat(p_name, "§c is afk."));
  199. msg.prefix(p, "§5Party", "§cYou are afk.");
  200. continue;
  201. }
  202. if(!player.hasClearInventory(p)) {
  203. msg.prefix(player, "§5Party", string.concat(p_name, "§c has no clear inventory."));
  204. msg.prefix(p, "§5Party", "§cYou have no clear inventory.");
  205. continue;
  206. }
  207. player.teleport(p, tp_loc, false);
  208. player.setAdventure(p, true);
  209. player.setAdventureStart(p, tp_loc);
  210. addAdventureDisplay(p, adventure_aim_loc);
  211. title.reset(p);
  212. title.setSub(p, "Have fun!");
  213. title.send(p, "§cAdventure");
  214. msg.prefix(p, "§5Adventure", "To complete your adventure, go to the survival spawn. You cannot teleport. If you die, you start again!");
  215. }
  216. goto("main");
  217. }
  218. if(!player.hasClearInventory(player)) {
  219. msg.prefix(player, "§5Adventure", "Your inventory needs to be empty!");
  220. goto("main");
  221. }
  222. player.teleport(player, tp_loc, false);
  223. player.setAdventure(player, true);
  224. player.setAdventureStart(player, tp_loc);
  225. addAdventureDisplay(player, adventure_aim_loc);
  226. sound.spawn(tp_loc, adv_tp_sound, sound_category_ambient);
  227. title.send(player, "§cAdventure", "Have fun!");
  228. msg.prefix(player, "§5Adventure", "To complete your adventure, go to the survival spawn. You cannot teleport. If you die, you start again!");
  229. goto("main");
  230. }
  231. player.teleport(player, tp_loc, false);
  232. sound.spawn(tp_loc, adv_tp_sound, sound_category_ambient);
  233. goto("main");
  234. function teleporter.setLayout() {
  235. a = array.new(58);
  236. a[0] = teleporter.getProp(0, 0, 0, null, $dispenser_mat);
  237. a[1] = teleporter.getProp(-1, 0, 0, $planks_tag, null);
  238. a[2] = teleporter.getProp(2, 0, 0, $planks_tag, null);
  239. a[3] = teleporter.getProp(-1, 0, -1, $planks_tag, null);
  240. a[4] = teleporter.getProp(0, 0, 2, $planks_tag, null);
  241. a[5] = teleporter.getProp(-1, 0, 0, $planks_tag, null);
  242. a[6] = teleporter.getProp(2, 0, 0, $planks_tag, null);
  243. a[7] = teleporter.getProp(0, 0, -2, $planks_tag, null);
  244. a[8] = teleporter.getProp(-2, 0, 0, $planks_tag, null);
  245. a[9] = teleporter.getProp(-1, 0, 0, $slabs_tag, null);
  246. a[10] = teleporter.getProp(0, 0, 1, $slabs_tag, null);
  247. a[11] = teleporter.getProp(0, 0, 1, $slabs_tag, null);
  248. a[12] = teleporter.getProp(1, 0, 1, $slabs_tag, null);
  249. a[13] = teleporter.getProp(1, 0, 0, $slabs_tag, null);
  250. a[14] = teleporter.getProp(1, 0, 0, $slabs_tag, null);
  251. a[15] = teleporter.getProp(1, 0, -1, $slabs_tag, null);
  252. a[16] = teleporter.getProp(0, 0, -1, $slabs_tag, null);
  253. a[17] = teleporter.getProp(0, 0, -1, $slabs_tag, null);
  254. a[18] = teleporter.getProp(-1, 0, -1, $slabs_tag, null);
  255. a[19] = teleporter.getProp(-1, 0, 0, $slabs_tag, null);
  256. a[20] = teleporter.getProp(-1, 0, 0, $slabs_tag, null);
  257. a[21] = teleporter.getProp(1, 1, 2, null, $shroomlight_mat);
  258. a[22] = teleporter.getProp(-2, -2, -2, $logs_tag, null);
  259. a[23] = teleporter.getProp(0, -1, 0, $logs_tag, null);
  260. a[24] = teleporter.getProp(0, -1, 0, $logs_tag, null);
  261. a[25] = teleporter.getProp(0, -1, 0, $logs_tag, null);
  262. a[26] = teleporter.getProp(0, 0, 4, $logs_tag, null);
  263. a[27] = teleporter.getProp(0, 1, 0, $logs_tag, null);
  264. a[28] = teleporter.getProp(0, 1, 0, $logs_tag, null);
  265. a[29] = teleporter.getProp(0, 1, 0, $logs_tag, null);
  266. a[30] = teleporter.getProp(4, 0, 0, $logs_tag, null);
  267. a[30] = teleporter.getProp(0, -1, 0, $logs_tag, null);
  268. a[31] = teleporter.getProp(0, -1, 0, $logs_tag, null);
  269. a[32] = teleporter.getProp(0, -1, 0, $logs_tag, null);
  270. a[33] = teleporter.getProp(0, 0, -4, $logs_tag, null);
  271. a[34] = teleporter.getProp(0, 1, 0, $logs_tag, null);
  272. a[35] = teleporter.getProp(0, 1, 0, $logs_tag, null);
  273. a[36] = teleporter.getProp(0, 1, 0, $logs_tag, null);
  274. a[37] = teleporter.getProp(1, -3, 0, $planks_tag, null);
  275. a[38] = teleporter.getProp(1, 0, 0, $planks_tag, null);
  276. a[39] = teleporter.getProp(1, 0, 0, $planks_tag, null);
  277. a[40] = teleporter.getProp(1, 0, 1, $planks_tag, null);
  278. a[41] = teleporter.getProp(0, 0, 1, $planks_tag, null);
  279. a[42] = teleporter.getProp(0, 0, 1, $planks_tag, null);
  280. a[43] = teleporter.getProp(-1, 0, 1, $planks_tag, null);
  281. a[44] = teleporter.getProp(-1, 0, 0, $planks_tag, null);
  282. a[45] = teleporter.getProp(-1, 0, 0, $planks_tag, null);
  283. a[46] = teleporter.getProp(-1, 0, -1, $planks_tag, null);
  284. a[47] = teleporter.getProp(0, 0, -1, $planks_tag, null);
  285. a[48] = teleporter.getProp(0, 0, -1, $planks_tag, null);
  286. a[49] = teleporter.getProp(1, 0, 0, $planks_tag, null);
  287. a[50] = teleporter.getProp(1, 0, 0, $planks_tag, null);
  288. a[51] = teleporter.getProp(1, 0, 0, $planks_tag, null);
  289. a[52] = teleporter.getProp(0, 0, 1, $planks_tag, null);
  290. a[53] = teleporter.getProp(0, 0, 1, $planks_tag, null);
  291. a[54] = teleporter.getProp(-1, 0, 0, $planks_tag, null);
  292. a[55] = teleporter.getProp(-1, 0, 0, $planks_tag, null);
  293. a[56] = teleporter.getProp(0, 0, -1, $planks_tag, null);
  294. a[57] = teleporter.getProp(1, 0, 0, null, $shroomlight_mat);
  295. setScriptVar("tp_layout", a);
  296. }
  297. function teleporter.getLayout() {
  298. return getScriptVar("tp_layout");
  299. }
  300. function teleporter.getProp(x, y, z, block_tag, block_mat) {
  301. a = array.new(5);
  302. a[0] = x;
  303. a[1] = y;
  304. a[2] = z;
  305. a[3] = block_tag;
  306. a[4] = block_mat;
  307. return a;
  308. }
  309. function teleporter.isLayout(clicked_loc) {
  310. clicked_mat = block.getType(block.get(clicked_loc));
  311. if(clicked_mat == $shroomlight_mat) {
  312. clicked_loc = loc.mod(clicked_loc, 0, 4, 0);
  313. }
  314. disp_block = block.get(clicked_loc);
  315. disp_mat = block.getType(block.get(clicked_loc));
  316. if(disp_mat != $dispenser_mat) {
  317. return false;
  318. }
  319. if(block.getDirectionalFace(disp_block) != "DOWN") {
  320. return false;
  321. }
  322. layout = teleporter.getLayout();
  323. loc = loc.mod(clicked_loc, 0, 0 ,0);
  324. for(i = 0; i < array.getSize(layout); i++) {
  325. a = layout[i];
  326. loc.add(loc, a[0], a[1], a[2]);
  327. tag = a[3];
  328. mat = a[4];
  329. block = block.get(loc);
  330. if(mat == null) {
  331. if(!block.hasTag(block, tag)) {
  332. return false;
  333. }
  334. } else {
  335. if(block.getType(block) != mat) {
  336. return false;
  337. }
  338. }
  339. }
  340. return true;
  341. }
  342. function setTpWallX(chest_loc, item_type) {
  343. block.setMaterial(block.get(loc.mod(chest_loc, 2, -1, -1)), item_type);
  344. //block.setMaterial(block.get(loc.mod(chest_loc, 2, -1, 0)), item_type);
  345. block.setMaterial(block.get(loc.mod(chest_loc, 2, -1, 1)), item_type);
  346. block.setMaterial(block.get(loc.mod(chest_loc, -2, -1, -1)), item_type);
  347. //block.setMaterial(block.get(loc.mod(chest_loc, -2, -1, 0)), item_type);
  348. block.setMaterial(block.get(loc.mod(chest_loc, -2, -1, 1)), item_type);
  349. block.setMaterial(block.get(loc.mod(chest_loc, -1, -1, 2)), item_type);
  350. //block.setMaterial(block.get(loc.mod(chest_loc, 0, -1, 2)), item_type);
  351. block.setMaterial(block.get(loc.mod(chest_loc, 1, -1, 2)), item_type);
  352. block.setMaterial(block.get(loc.mod(chest_loc, -1, -1, -2)), item_type);
  353. //block.setMaterial(block.get(loc.mod(chest_loc, 0, -1, -2)), item_type);
  354. block.setMaterial(block.get(loc.mod(chest_loc, 1, -1, -2)), item_type);
  355. //block.setMaterial(block.get(loc.mod(chest_loc, 2, -2, -1)), item_type);
  356. block.setMaterial(block.get(loc.mod(chest_loc, 2, -2, 0)), item_type);
  357. //block.setMaterial(block.get(loc.mod(chest_loc, 2, -2, 1)), item_type);
  358. //block.setMaterial(block.get(loc.mod(chest_loc, -2, -2, -1)), item_type);
  359. block.setMaterial(block.get(loc.mod(chest_loc, -2, -2, 0)), item_type);
  360. //block.setMaterial(block.get(loc.mod(chest_loc, -2, -2, 1)), item_type);
  361. //block.setMaterial(block.get(loc.mod(chest_loc, -1, -2, 2)), item_type);
  362. block.setMaterial(block.get(loc.mod(chest_loc, 0, -2, 2)), item_type);
  363. //block.setMaterial(block.get(loc.mod(chest_loc, 1, -2, 2)), item_type);
  364. //block.setMaterial(block.get(loc.mod(chest_loc, -1, -2, -2)), item_type);
  365. block.setMaterial(block.get(loc.mod(chest_loc, 0, -2, -2)), item_type);
  366. //block.setMaterial(block.get(loc.mod(chest_loc, 1, -2, -2)), item_type);
  367. block.setMaterial(block.get(loc.mod(chest_loc, 2, -3, -1)), item_type);
  368. //block.setMaterial(block.get(loc.mod(chest_loc, 2, -3, 0)), item_type);
  369. block.setMaterial(block.get(loc.mod(chest_loc, 2, -3, 1)), item_type);
  370. block.setMaterial(block.get(loc.mod(chest_loc, -2, -3, -1)), item_type);
  371. //block.setMaterial(block.get(loc.mod(chest_loc, -2, -3, 0)), item_type);
  372. block.setMaterial(block.get(loc.mod(chest_loc, -2, -3, 1)), item_type);
  373. block.setMaterial(block.get(loc.mod(chest_loc, -1, -3, 2)), item_type);
  374. //block.setMaterial(block.get(loc.mod(chest_loc, 0, -3, 2)), item_type);
  375. block.setMaterial(block.get(loc.mod(chest_loc, 1, -3, 2)), item_type);
  376. block.setMaterial(block.get(loc.mod(chest_loc, -1, -3, -2)), item_type);
  377. //block.setMaterial(block.get(loc.mod(chest_loc, 0, -3, -2)), item_type);
  378. block.setMaterial(block.get(loc.mod(chest_loc, 1, -3, -2)), item_type);
  379. }
  380. function setTpWallFull(chest_loc, item_type) {
  381. block.setMaterial(block.get(loc.mod(chest_loc, 2, -1, -1)), item_type);
  382. block.setMaterial(block.get(loc.mod(chest_loc, 2, -1, 0)), item_type);
  383. block.setMaterial(block.get(loc.mod(chest_loc, 2, -1, 1)), item_type);
  384. block.setMaterial(block.get(loc.mod(chest_loc, -2, -1, -1)), item_type);
  385. block.setMaterial(block.get(loc.mod(chest_loc, -2, -1, 0)), item_type);
  386. block.setMaterial(block.get(loc.mod(chest_loc, -2, -1, 1)), item_type);
  387. block.setMaterial(block.get(loc.mod(chest_loc, -1, -1, 2)), item_type);
  388. block.setMaterial(block.get(loc.mod(chest_loc, 0, -1, 2)), item_type);
  389. block.setMaterial(block.get(loc.mod(chest_loc, 1, -1, 2)), item_type);
  390. block.setMaterial(block.get(loc.mod(chest_loc, -1, -1, -2)), item_type);
  391. block.setMaterial(block.get(loc.mod(chest_loc, 0, -1, -2)), item_type);
  392. block.setMaterial(block.get(loc.mod(chest_loc, 1, -1, -2)), item_type);
  393. block.setMaterial(block.get(loc.mod(chest_loc, 2, -2, -1)), item_type);
  394. block.setMaterial(block.get(loc.mod(chest_loc, 2, -2, 0)), item_type);
  395. block.setMaterial(block.get(loc.mod(chest_loc, 2, -2, 1)), item_type);
  396. block.setMaterial(block.get(loc.mod(chest_loc, -2, -2, -1)), item_type);
  397. block.setMaterial(block.get(loc.mod(chest_loc, -2, -2, 0)), item_type);
  398. block.setMaterial(block.get(loc.mod(chest_loc, -2, -2, 1)), item_type);
  399. block.setMaterial(block.get(loc.mod(chest_loc, -1, -2, 2)), item_type);
  400. block.setMaterial(block.get(loc.mod(chest_loc, 0, -2, 2)), item_type);
  401. block.setMaterial(block.get(loc.mod(chest_loc, 1, -2, 2)), item_type);
  402. block.setMaterial(block.get(loc.mod(chest_loc, -1, -2, -2)), item_type);
  403. block.setMaterial(block.get(loc.mod(chest_loc, 0, -2, -2)), item_type);
  404. block.setMaterial(block.get(loc.mod(chest_loc, 1, -2, -2)), item_type);
  405. block.setMaterial(block.get(loc.mod(chest_loc, 2, -3, -1)), item_type);
  406. block.setMaterial(block.get(loc.mod(chest_loc, 2, -3, 0)), item_type);
  407. block.setMaterial(block.get(loc.mod(chest_loc, 2, -3, 1)), item_type);
  408. block.setMaterial(block.get(loc.mod(chest_loc, -2, -3, -1)), item_type);
  409. block.setMaterial(block.get(loc.mod(chest_loc, -2, -3, 0)), item_type);
  410. block.setMaterial(block.get(loc.mod(chest_loc, -2, -3, 1)), item_type);
  411. block.setMaterial(block.get(loc.mod(chest_loc, -1, -3, 2)), item_type);
  412. block.setMaterial(block.get(loc.mod(chest_loc, 0, -3, 2)), item_type);
  413. block.setMaterial(block.get(loc.mod(chest_loc, 1, -3, 2)), item_type);
  414. block.setMaterial(block.get(loc.mod(chest_loc, -1, -3, -2)), item_type);
  415. block.setMaterial(block.get(loc.mod(chest_loc, 0, -3, -2)), item_type);
  416. block.setMaterial(block.get(loc.mod(chest_loc, 1, -3, -2)), item_type);
  417. }
  418. function removeAdventureDisplay(player) {
  419. //display.remove(player, 10);
  420. }
  421. function addAdventureDisplay(player, location) {
  422. x = string.number(loc.getX(location));
  423. y = string.number(loc.getY(location));
  424. z = string.number(loc.getZ(location));
  425. //display.add(player, 10, string.concat("§2Adventure Target: §r", x, " ", y, " ", z));
  426. }