Advertisement
Zeldaboy111

Click types ]|[ Skript #358

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