Advertisement
Zeldaboy111

Click types ]|[ Skript #357

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