Zeldaboy111

Tier I Furnace Af! ]|[ Skript #362

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