Zeldaboy111

Tier I Anvil start ]|[ Skript #363

Nov 12th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.62 KB | None | 0 0
  1. #multiblock structure
  2. #rename function
  3.  
  4. #requires: SkQuery, SkRayFall, Skellett, SkBee, TuSKe
  5.  
  6.  
  7. options:
  8. logo: &6&lBS&8:&7
  9. tier1Furnace: "&8Furnace I"
  10.  
  11. function updateItemInSlot(furnaceId: Location, type: String, slot: Number, furnaceTier: String, typeId: integer):
  12. set {_typeLower} to {_type} in lower case
  13. loop {inventoryList.%{_furnaceId}%.furnace%{_furnaceTier}%::*}:
  14. set slot {_slot} of loop-value's current inventory to ("%{furnace%{_typeId}%.%{_furnaceId}%.contents.%{_typeLower}%}% %{furnace%{_typeId}%.%{_furnaceId}%.contents.%{_typeLower}%Type}%" parsed as an item)
  15. if {furnace%{_typeId}%.%{_furnaceId}%.contents.%{_typeLower}%} <= 0:
  16. set slot {_slot} of loop-value's current inventory to lime stained glass pane named "&a&l%{_type}%"
  17.  
  18. function updateItemAndRemoveFromLoop(p: Player, item: Item, slot: Number, furnaceTier: Integer, furnaceTierString: String, itemName: String, leftClick: Boolean):
  19. set {_nameLower} to {_itemName} in lower case
  20. set {_amount} to {furnace1.%{inventory.%{_p}%.current}%.contents.%{_nameLower}%}
  21. set {_removedAmount} to {_amount}
  22. if {_leftClick} is false:
  23. set {_removedAmount} to "%{_amount} / 2%" parsed as an integer
  24. if {_removedAmount} is {_amount}:
  25. set {_removedAmount} to 1
  26. add "%({_amount}-1) / 2%" parsed as an integer to {_removedAmount}
  27. set {_item} to "%{_amount} - {_removedAmount} + 1% %type of {_item}%" parsed as an item
  28. else:
  29. set {_item} to "%{_amount} - {_removedAmount}% %type of {_item}%" parsed as an item
  30.  
  31. set {_p}'s cursor slot to {_item}
  32. set {furnace1.%{inventory.%{_p}%.current}%.contents.%{_nameLower}%} to {_amount}-{_removedAmount}
  33. if {_amount}-{_removedAmount} <= 0:
  34. delete {furnace1.%{inventory.%{_p}%.current}%.contents.%{_nameLower}%Type}
  35. set slot ({_slot}) of {_p}'s current inventory to lime stained glass pane named "&a&l%{_itemName}%"
  36. if {_nameLower} is "ore" or "fuel":
  37. resetFuelIndicator({inventory.%{_p}%.current}, {_furnaceTierString})
  38. else:
  39. set slot ({_slot}) of {_p}'s current inventory to "%{_amount}-{_removedAmount}% %{furnace1.%{inventory.%{_p}%.current}%.contents.%{_nameLower}%Type}%" parsed as an item
  40.  
  41.  
  42. function updateInventoryFuelIndicator(furnaceId: Location, progressBar: Integer, furnaceTier: String):
  43. if {_progressBar} <= 4:
  44. if {_progressBar} >= 0:
  45. loop {inventoryList.%{_furnaceId}%.furnace%{_furnaceTier}%::*}:
  46. set slot 20+{_progressBar} of loop-value's current inventory to gray stained glass pane named "&f%20*({_progressBar}+1)%%%"
  47. if {_progressBar} > 0:
  48. set slot 20+{_progressBar}-1 of loop-value's current inventory to lime stained glass pane named "&f%20*{_progressBar}%%%"
  49. loop 4-{_progressBar} times:
  50. set slot 25-loop-value-2 of loop-value-1's current inventory to dark gray stained glass pane named "&f%100 - 20*((loop-value-2)-1)%%%"
  51.  
  52. function resetFuelIndicator(furnaceId: Location, furnaceTier: String):
  53. set {furnace1.%{_furnaceId}%.smeltTime} to 0
  54. loop {inventoryList.%{_furnaceId}%.furnace%{_furnaceTier}%::*}:
  55. loop 5 times:
  56. set slot 19 + loop-value-2 of loop-value-1's current inventory to gray stained glass pane named "&f%20*loop-value-2%%%"
  57. if {_furnaceTier} is " I":
  58. removeFurnaceFromLoop({_furnaceId}, 1)
  59. else:
  60. removeFurnaceFromLoop({_furnaceId}, 2)
  61.  
  62. function setIngotType(furnaceId: Location, tier: Number):
  63. delete {furnace%{_tier}%.%{_furnaceId}%.contents.ingotType}
  64. if {furnace%{_tier}%.%{_furnaceId}%.contents.ingotType} is set:
  65. stop
  66. set {_type} to "%{furnace%{_tier}%.%{_furnaceId}%.contents.oreType}%"
  67. if {_tier} is 2:
  68. if {_type} is "diamond ore", "emerald ore" or "nether quartz ore":
  69. replace all " ore" in {_type} with " ingot"
  70. {furnace%{_tier}%.%{_furnaceId}%.contents.ingotType}
  71. stop
  72. if "%{_type}%" is "iron ore", "gold ore", "lapis ore" or "redstone ore":
  73. replace "ore" in {_type} with "ingot"
  74. set {furnace%{_tier}%.%{_furnaceId}%.contents.ingotType} to {_type} parsed as an item
  75. else if {_type} is "coal ore":
  76. set {furnace%{_tier}%.%{_furnaceId}%.contents.ingotType} to coal
  77.  
  78. function removeFurnaceFromLoop(furnaceId: Location, typeId: integer):
  79. delete {furnace.%{_furnaceId}%.isAddedToLoop}
  80. remove {_furnaceId} from {furnace%{_typeId}%.loopList::*}
  81.  
  82.  
  83. function loop_furnace1():
  84. set {furnace1.looping} to false
  85. if {furnace1.looping} is not true:
  86. set {furnace1.looping} to true
  87. while {furnace1.looping} is true:
  88. if size of {furnace1.loopList::*} is 0:
  89. set {furnace1.looping} to false
  90. stop loop
  91. else:
  92. loop {furnace1.loopList::*}:
  93. if {furnace1.%loop-value%.contents.ore} < 1:
  94. updateInventoryFuelIndicator(loop-value, 0, " I")
  95. removeFurnaceFromLoop(loop-value, 1)
  96.  
  97. else:
  98. if {furnace1.%loop-value%.contents.fuelingTime} is not set:
  99. remove 1 from {furnace1.%loop-value%.contents.fuel}
  100. updateItemInSlot(loop-value, "Fuel", 40, " I", 1)
  101.  
  102. add 1 to {furnace1.%loop-value%.smeltTime}
  103. add 1 to {furnace1.%loop-value%.fuelingTime}
  104. if "%{furnace1.%loop-value%.smeltTime}/2.0%" doesn't contain ".":
  105. if {furnace1.%loop-value%.smeltTime}/2 > 4:
  106. updateInventoryFuelIndicator(loop-value, 0, " I")
  107. else:
  108. updateInventoryFuelIndicator(loop-value, "%{furnace1.%loop-value%.smeltTime}/2%" parsed as an integer, " I")
  109. if {furnace1.%loop-value%.smeltTime} > 9:
  110. delete {furnace1.%loop-value%.smeltTime}
  111. remove 1 from {furnace1.%loop-value%.contents.ore}
  112. add 1 to {furnace1.%loop-value%.contents.ingot}
  113. setIngotType(loop-value, 1)
  114. updateItemInSlot(loop-value, "Ore", 38, " I", 1)
  115. updateItemInSlot(loop-value, "Ingot", 42, " I", 1)
  116. updateInventoryFuelIndicator(loop-value, 0, " I")
  117.  
  118.  
  119. if {furnace1.%loop-value%.fuelingTime} >= {furnace1.%Loop-value%.fuelingTimeMax}:
  120. if {furnace1.%loop-value%.contents.fuel} <= 0:
  121. delete {furnace1.%loop-value%.smeltTime}
  122. removeFurnaceFromLoop(loop-value, 1)
  123. updateInventoryFuelIndicator(loop-value, 0, " I")
  124. else:
  125. delete {furnace1.%loop-value%.fuelingTime}
  126. wait 1 second
  127.  
  128. # Returns how many ticks an item gives fuel
  129. function getFuelingTime(type: Item) :: integer:
  130. if {_type} is lava:
  131. return 20000
  132. else if {_type} is block of coal:
  133. return 16000
  134. else if {_type} is dried kelp block:
  135. return 4000
  136. else if {_type} is blaze rod:
  137. return 2400
  138. else if {_type} is coal or charcoal:
  139. return 1600
  140. else if {_type} is any boat or scaffolding:
  141. return 1200
  142. else if {_type} is any log or any planks or any wood slab or oak wood stairs or spruce wood stairs or birch wood stairs or jungle wood stairs or acacia wood stairs or dark oak wood stairs or any wooden button or any wooden trapdoor or any fence gate or any fence or ladder or crafting table or cartography table or fletching table or smithing table or loom or bookshelf or lectern or composter or chest or trapped chest or barrel or daylight detector or jukebox or note block or red mushroom block or brown mushroom block or mushroom stem or banner or bow or fishing rod:
  143. return 300
  144. else if {_type} is any wooden door or any sign or wooden pickaxe or wooden shovel or wooden hoe or wooden axe or wooden sword:
  145. return 200
  146. else if {_type} is bowl or any sapling or stick or any wool:
  147. return 100
  148. else if {_type} is any carpet:
  149. return 67
  150. else if {_type} is bamboo:
  151. return 50
  152. return 0
  153.  
  154. # Returns if the item can be smelted in the furnace, every smelt takes 10 seconds in a normal furnace
  155. function canSmelt(type: Item, tier: Integer) :: boolean:
  156. if {_type} is iron ore or gold ore or lapis ore or redstone ore or coal ore:
  157. return true
  158. else if {_tier} is 2:
  159. if {_type} is diamond ore or emerald ore or nether quartz ore:
  160. return true
  161.  
  162. return false
  163.  
  164. function canSmeltInFurnace(p: Player, item: Item) :: boolean:
  165. set {_furnaceId} to {inventory.%{_p}%.current}
  166. if {furnace1.%{_furnaceId}%.contents.oreType} is set:
  167. if "%type of {_item}%" is not "%{furnace1.%{_furnaceId}%.contents.oreType}%":
  168. return false
  169. if {furnace1.%{_furnaceId}%.contents.ingotType} is set:
  170. send "true" to {_p}
  171. if type of {_item} is coal ore:
  172. if type of {furnace1.%{_furnaceId}%.contents.ingotType} is coal:
  173. return true
  174. set {_item} to "%type of {_item}%"
  175. replace all " ore" in {_item} with " ingot"
  176. if {_item} is not "%{furnace1.%{_furnaceId}%.contents.ingotType}%":
  177. return false
  178. return true
  179.  
  180.  
  181. function outlineGui(p: Player):
  182. loop 9 times:
  183. set slot loop-value - 1 of {_p}'s current inventory to gray stained glass pane named "&8"
  184. set slot 54-loop-value of {_p}'s current inventory to gray stained glass pane named "&8"
  185.  
  186. loop 5 times:
  187. set slot loop-value * 9 of {_p}'s current inventory to gray stained glass pane named "&8"
  188. set slot loop-value * 9-1 of {_p}'s current inventory to gray stained glass pane named "&8"
  189.  
  190. function openGuiOutlined(p: Player, loc: Location, rows: integer, name: String):
  191. open chest with {_rows} rows named {_name} to {_p}
  192. set {inventory.%{_p}%.name} to uncolored {_name}
  193. set {inventory.%{_p}%.current} to {_loc}
  194. add {_p} to {inventoryList.%{_loc}%.%{inventory.%{_p}%.name}%::*}
  195. wait 2 ticks
  196. outlineGui({_p})
  197.  
  198. function guiFurnace1(p: Player, loc: Location):
  199. openGuiOutlined({_p}, {_loc}, 6, {@tier1Furnace})
  200.  
  201. if {furnace1.%{_loc}%.contents.fuel} is not set:
  202. set {furnace1.%{_loc}%.contents.fuel} to 0
  203. if {furnace1.%{_loc}%.contents.ore} is not set:
  204. set {furnace1.%{_loc}%.contents.ore} to 0
  205. if {furnace1.%{_loc}%.contents.ingot} is not set:
  206. set {furnace1.%{_loc}%.contents.ingot} to 0
  207.  
  208. if {furnace1.%{_loc}%.contents.ingotType} is not set:
  209. set {furnace1.%{_loc}%.contents.ingot} to 0
  210. if {furnace1.%{_loc}%.contents.oreType} is not set:
  211. set {furnace1.%{_loc}%.contents.ore} to 0
  212. if {furnace1.%{_loc}%.contents.fuelType} is not set:
  213. set {furnace1.%{_loc}%.contents.fuel} to 0
  214.  
  215. set {furnace1.%{_loc}%.fuelingTimeMax} to 0
  216. if {furnace1.%{_loc}%.contents.fuelType} is set:
  217. set {furnace1.%{_loc}%.fuelingTimeMax} to getFuelingTime({furnace1.%{_loc}%.contents.fuelType}) / 20
  218.  
  219. set slot 38 of {_p}'s current inventory to lime stained glass pane named "&a&lOre"
  220. set slot 40 of {_p}'s current inventory to lime stained glass pane named "&a&lFuel"
  221. set slot 42 of {_p}'s current inventory to lime stained glass pane named "&a&lIngot"
  222.  
  223. if {furnace1.%{_loc}%.contents.ore} > 0:
  224. set slot 38 of {_p}'s current inventory to ("%{furnace1.%{_loc}%.contents.ore}% %{furnace1.%{_loc}%.contents.oreType}%" parsed as an item)
  225.  
  226. if {furnace1.%{_loc}%.contents.fuel} > 0:
  227. set slot 40 of {_p}'s current inventory to ("%{furnace1.%{_loc}%.contents.fuel}% %{furnace1.%{_loc}%.contents.fuelType}%" parsed as an item)
  228.  
  229. if {furnace1.%{_loc}%.contents.ingot} > 0:
  230. set slot 42 of {_p}'s current inventory to ("%{furnace1.%{_loc}%.contents.ingot}% %{furnace1.%{_loc}%.contents.ingotType}%" parsed as an item)
  231.  
  232. loop 5 times:
  233. set slot 19 + loop-value of {_p}'s current inventory to gray stained glass pane named "&f%20*loop-value%%%"
  234.  
  235. set {_progressBar} to "%{furnace1.%{_loc}%.smeltTime}/2.0%"
  236. if {_progressBar} contains ".":
  237. set {_progressBar::*} to {_progressBar} split at "."
  238. set {_progressBar} to {_progressBar::1}
  239.  
  240. loop ({_progressBar} parsed as an integer) times:
  241. set slot 20+loop-value -1 of {_p}'s current inventory to lime stained glass pane named "&f%20*loop-value%%%"
  242.  
  243. function openAnvilGui(p: Player):
  244. if {anvil.current.%{_p}%} is 1:
  245. open chest with 6 rows named "Anvil Tier I" to {_p}
  246. wait 2 ticks
  247. outlineGui({_p})
  248.  
  249. else if {anvil.curent.%{_p}%} is 2:
  250.  
  251. else if {anvil.current.%{_p}%} is 3:
  252.  
  253.  
  254. # U T I L I T I E S
  255.  
  256. function getNextNumber(base: number, addToDefault: number, max: number) :: number:
  257. set {_value} to {_base} + {_addToDefault}
  258. if {_value} > {_max}:
  259. set {_value} to {_addToDefault} - ({_max} - {_base})
  260.  
  261. return {_value}
  262.  
  263. function detectStair(facing: number, loc: Location, startValue: String) :: boolean:
  264. set {_list::*} to "westward red brick stair", "red brick stair", "eastward red brick stair" and "southward red brick stair"
  265. set {_dir} to {_facing}/2 + 1
  266.  
  267. if {_dir} > 4:
  268. remove 4 from {_dir}
  269.  
  270. if "%block at location of {_loc}%" is "%{_startValue}%%{_list::%{_dir}%}%":
  271. return true
  272. return false
  273.  
  274. function setItemInSlot(p: Player, type: String, slot: number, clickedItem: Item, item: Item, startLoop: Boolean, leftClick: Boolean):
  275. if {_type} is "Ore" or "Fuel" or "Ingot":
  276. set {_typeLower} to {_type} in lower case
  277. if {_leftClick} is false:
  278. if {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%} >= 64:
  279. stop
  280. add 1 to {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%}
  281. set {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%Type} to "%type of {_item}%"
  282. set {_item} to "%item amount of {_item}-1% %type of {_item}%"
  283. else:
  284. if {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%} >= 64:
  285. stop
  286. if {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%} + item amount of {_item} > 64:
  287. set {_item} to "%(item amount of {_item} - (64 - {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%}))% %type of {_item}%"
  288. set {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%} to 64
  289. set {_p}'s cursor to ("%{_item}%" parsed as an item)
  290. else:
  291. add item amount of {_item} to {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%}
  292. set {furnace1.%{inventory.%{_p}%.current}%.contents.%{_typeLower}%Type} to "%type of {_item}%"
  293. set {_item} to air
  294.  
  295. set {_typeId} to 2
  296. set {_typeString} to " II"
  297. if {inventory.%{_p}%.name} is uncolored {@tier1Furnace}:
  298. set {_typeId} to 1
  299. set {_typeString} to " I"
  300.  
  301. set {_p}'s cursor to ("%{_item}%" parsed as an item)
  302. updateItemInSlot({inventory.%{_p}%.current}, {_type}, {_slot}, {_typeString}, {_typeId})
  303. if {_startLoop}:
  304. if {furnace.%{inventory.%{_p}%.current}%.isAddedToLoop} is not true:
  305. add {inventory.%{_p}%.current} to {furnace1.loopList::*}
  306. loop_furnace1()
  307.  
  308. # F U R N A C E D E T E C T S
  309.  
  310. function isFurnace1(below: Location) :: boolean:
  311. if block at {_below} is campfire:
  312. set {_xAdjust::*} to 1, 1, 1, 0, 0, -1, -1 and -1
  313. set {_zAdjust::*} to 1, 0, -1, 1, -1, 1, 0 and -1
  314. loop 8 times:
  315. set {_checkLoc} to location at x-coordinate of {_below}+{_xAdjust::%loop-value%}, y-coordinate of {_below}, z-coordinate of {_below}+{_zAdjust::%loop-value%} in world of {_below}
  316. if block at {_checkLoc} is not red brick block:
  317. return false
  318. else:
  319. return false
  320. return true
  321.  
  322.  
  323. function isFurnace2(loc: Location) :: boolean:
  324. if block at {_loc} is not blast furnace:
  325. return false
  326.  
  327. set {_layer1::*} to air, brick slab, red brick block, air, red brick block, air, red brick block and brick slab
  328. set {_layer2::*} to air, red brick stair, eastward red brick stair and southward red brick stair
  329. set {_x::*} to 1, 1, 0, -1, -1, -1, 0 and 1
  330. set {_z::*} to 0, 1, 1, 1, 0, -1, -1 and -1
  331.  
  332. set {_base} to -2
  333. if block at location at x-coordinate of {_loc} + {_x::1}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::1} in world of {_loc} is {_layer1::1}:
  334. set {_base} to 0
  335.  
  336. else if block at location at x-coordinate of {_loc} + {_x::3}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::3} in world of {_loc} is {_layer1::1}:
  337. set {_base} to 2
  338.  
  339. else if block at location at x-coordinate of {_loc} + {_x::5}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::5} in world of {_loc} is {_layer1::1}:
  340. set {_base} to 4
  341.  
  342. else if block at location at x-coordinate of {_loc} + {_x::7}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::7} in world of {_loc} is {_layer1::1}:
  343. set {_base} to 6
  344.  
  345. set {_size} to size of {_x::*}
  346. if {_base} is not -2:
  347. loop 7 times:
  348. set {_value} to getNextNumber({_base}, loop-value, {_size})
  349. if block at location at x-coordinate of {_loc} + {_x::%{_value}%}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::%{_value}%} in world of {_loc} is not {_layer1::%loop-value%}:
  350. return false
  351.  
  352.  
  353. set {_facingAdjust::*} to 0, 4, 6 and 8
  354. if detectStair({_base}, location 1 meters above {_loc}, "top "):
  355. loop 4 times:
  356. set {_value} to getNextNumber({_base}, loop-value*2, {_size}) - 1
  357. set {_check} to location at x-coordinate of {_loc} + {_x::%{_value}%}, y-coordinate of {_loc} + 1, z-coordinate of {_loc} + {_z::%{_value}%} in world of {_loc}
  358. set {_facing} to {_base}
  359. if {_facing} - {_facingAdjust::%loop-value%} >= 2:
  360. remove {_facingAdjust::%loop-value%} from {_facing}
  361. else:
  362. add {_facingAdjust::%loop-value%} to {_facing}
  363.  
  364. if loop-value is 1:
  365. if block at {_check} is not {_layer2::%loop-value%}:
  366. return false
  367. else if detectStair({_facing} - 2, {_check}, "") is false:
  368. return false
  369.  
  370. if block at location 2 meters above {_loc} is not red brick block:
  371. return false
  372. else:
  373. return false
  374. else:
  375. return false
  376. return true
  377.  
  378. # C L I C K E V E N T S
  379.  
  380. on rightclick on smooth stone:
  381. if player is not sneaking:
  382. if {anvil.%location of clicked block%} is true:
  383. set {anvil.current.%player%} to 1
  384. openAnvilGui(player)
  385. cancel event
  386.  
  387. on rightclick on cauldron:
  388. if {furnace.%location of event-block%} is true:
  389. if isFurnace1(location 1 meters below clicked block):
  390. cancel event
  391. guiFurnace1(player, location of clicked block)
  392.  
  393. else:
  394. delete {furnace1.%location of clicked block%.contents.fuel}
  395. delete {furnace1.%location of clicked block%.contents.ore}
  396. delete {furnace1.%location of clicked block%.contents.ingot}
  397. delete {furnace.%location of event-block%}
  398.  
  399. on rightclick on blast furnace:
  400. if {furnace2.%location of event-block%} is true:
  401. if isFurnace2(location of clicked block):
  402. cancel event
  403. send "WIP"
  404. else:
  405. delete {furnace2.%location of event-block%}
  406.  
  407. on rightclick holding stone axe:
  408. if clicked block is smooth stone or iron block or diamond block:
  409. if {anvil.%location of event-block%} is not true:
  410. set {anvil.%location of event-block%} to true
  411. set {_tier} to "Tier I"
  412. if clicked block is smooth stone:
  413. set {anvil.%location of event-block%.tier} to 1
  414. else if clicked block is iron block:
  415. set {anvil.%location of event-block%.tier} to 2
  416. set {_tier} to "Tier II"
  417. else:
  418. set {anvil.%location of event-block%.tier} to 3
  419. set {_tier} to "Tier III"
  420.  
  421. set {_s} to 6
  422. loop all players in radius 6 around event-block:
  423. set {_v} to ({_s} - distance between loop-player and event-block)
  424. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  425.  
  426. send "{@logo} Successfully created an anvil of %{_tier}%."
  427. summon armor stand at location 0.6 meters below event-block
  428. set name of last spawned armor stand to "&7Anvil"
  429. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  430.  
  431. summon armor stand at location 0.9 meters below event-block
  432. set name of last spawned armor stand to "&7%{_tier}%"
  433. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  434.  
  435. else if clicked block is cauldron:
  436. if {furnace.%location of event-block%} is not true:
  437. if isFurnace1(location 1 meters below clicked block):
  438. set {furnace.%location of event-block%} to true
  439. cancel event
  440.  
  441. else if clicked block is blast furnace:
  442. if {furnace.%location of event-block%} is not true:
  443. if isFurnace2(location of clicked block):
  444. set {furnace2.%location of event-block%} to true
  445. cancel event
  446. send "WIP"
  447.  
  448. on break of smooth stone or iron block or diamond block:
  449. if {anvil.%location of event-block%} is true:
  450. set {_s} to 6
  451. loop all players in radius 6 around event-block:
  452. set {_v} to ({_s} - distance between loop-player and event-block)
  453. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  454. delete {anvil.%location of event-block%}
  455. delete {anvil.%location of event-block%.tier}
  456. loop entities in radius 1 around event-block:
  457. if type of loop-entity is armor stand:
  458. kill loop-entity
  459.  
  460.  
  461. on inventory click:
  462. if type of clicked inventory is chest inventory:
  463. if {anvil.current.%player%} is set:
  464. cancel event
  465.  
  466. else if inventory name of player's current inventory is {@tier1Furnace}:
  467. cancel event
  468. if clicked slot is set:
  469. if clicked item is not air:
  470. set {_item} to player's cursor slot
  471. set {_leftClick} to false
  472. if click type is left mouse button:
  473. set {_leftClick} to true
  474. if {_item} is not air:
  475. if name of clicked item is "&a&lOre":
  476. if canSmelt({_item}, 1):
  477. if canSmeltInFurnace(player, {_item}):
  478. setItemInSlot(player, "Ore", clicked slot, clicked item, {_item}, true, {_leftClick})
  479. else if name of clicked item is "&a&lFuel":
  480. if getFuelingTime({_item}) > 0:
  481. setItemInSlot(player, "Fuel", clicked slot, clicked item, {_item}, true, {_leftClick})
  482. else if getFuelingTime(clicked item) > 0:
  483. if getFuelingTime({_item}) > 0:
  484. setItemInSlot(player, "Fuel", clicked slot, clicked item, {_item}, false, {_leftClick})
  485. else if canSmelt(clicked item, 1) is true:
  486. if canSmelt({_item}, 1):
  487. if canSmeltInFurnace(player, {_item}):
  488. setItemInSlot(player, "Ore", clicked slot, clicked item, {_item}, false, {_leftClick})
  489. else if clicked slot is 42:
  490. if type of clicked item is not lime stained glass pane:
  491. updateItemAndRemoveFromLoop(player, clicked item, clicked slot, 1, " I", "Ingot", {_leftClick})
  492. else if getFuelingTime(clicked item) > 0:
  493. updateItemAndRemoveFromLoop(player, clicked item, clicked slot, 1, " I", "Fuel", {_leftClick})
  494. else if canSmelt(clicked item, 1) is true:
  495. updateItemAndRemoveFromLoop(player, clicked item, clicked slot, 1, " I", "Ore", {_leftClick})
  496.  
  497. on inventory close:
  498. if {inventory.%player%.name} is set:
  499. remove player from {inventoryList.%{inventory.%player%.current}%.%{inventory.%player%.name}%::*}
  500. delete {inventory.%player%.name}
  501. delete {inventory.%player%.current}
  502. else if {anvil.current.%player%} is set:
  503. delete {anvil.current.%player%}
  504.  
  505. on inventory drag:
  506. set {_tier1} to uncolored {@tier1Furnace}
  507. if {inventory.%player%.name} is "Anvil" or "%{_tier1}%" or "Furnace II":
  508. cancel event
  509. else if {anvil.current.%player%} is set:
  510. cancel event
  511.  
  512.  
  513. on disable:
  514. if {furnace1.looping} is true:
  515. set {furnace1.looping} to false
  516. set {furnace1.loopStopped} to true
  517.  
  518. on enable:
  519. wait 1 second
  520. if {furnace1.loopStopped} is true:
  521. set {furnace1.looping} to true
  522. set {furnace1.loopStopped} to false
  523.  
  524. on craft:
  525. if event-item is any helmet, any chestplate, any leggings or any boots:
  526. if "%event-item%" doesn't start with "leather":
  527. send "{@logo} You cannot craft this item in a crafting table!"
  528. cancel event
  529.  
Advertisement
Add Comment
Please, Sign In to add comment