Advertisement
DePhoegon

v2 - MineCraft Reciepe aid for Stairs/walls/Slabs

Jul 11th, 2021 (edited)
944
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 10.47 KB | None | 0 0
  1. ssw.bat
  2. ---------
  3. @echo off
  4. :: V 2.1 patch
  5. :: fixed stonecutter recipes (count required)
  6. :: fixed furnance recipes (misuse of tag, where item should be)
  7. :: Version 2
  8. :: can handle spaces in folder/path names [for temp folder holding the output files only. folder structure with spaces is not supported by minecraft datapacks/mods]
  9. :: All variables are stored in the ssw.bat file -No Quotes / spaces supported in file/block name
  10. :: slabs / stairs / walls  Reciepe creator (stone cutter & table crafting)
  11. :: Sand blocks & Sandstone blocks get extra done
  12. :: Sand & sandstone entered with name without the suffix (grey_cracked_sand_stone would be grey_cracked sandstone // purple_sand would be entered as purple sand)
  13. :: creates crafting for each of the sandstones for the others in the stone cutter
  14. :: assumes each block given will have walls/slabs/stairs of it
  15. :: separate batch files for compatibility & cross usage in a folder that is in the environmental path variables.
  16. :: -- Call can link to a full path where files kept w/ environmental path variable use
  17. :: ---
  18. :: updates
  19. :: added support for folders with spaces (note, folder structure with spaces is not supported by minecraft datapacks/mods)
  20. :: mcaid(furn/cfire/stoncut/table)  -- support for path spaces pass through (note, folder structure with spaces is not supported by minecraft datapacks/mods)
  21. :: mcaid(furn/cfire/stoncut/table) -- tweaked to signal start of file (to overwrite old files of the same name & prevent corrupted files)
  22. :: mcaid(furn/cfire/stoncut/table)/filwrite -- introduced exit /b to close the files if the first argument is missing. (attempting to prevent accidental execution & errors)
  23. :: filwrite -- organized & fat cutout (28 to 9 lines w/ exit condition, & new switch)
  24. :: filwrite -- new switch to indicate to overwrite file of the same name or append to it.
  25. :: ssw -- formatting & notes used to keep human readable & allow Understanding of what is being used where
  26.  
  27. goto Start
  28. :primevar
  29. :: do not use Quote marks in mod or paths
  30. set MOD=vanilla_reclaim
  31. set BASEFOLDER=F:\Minecraft-aidfiles\
  32. set STONEC=%BASEFOLDER%stone-cutter\
  33. set TABLEC=%BASEFOLDER%table\
  34. set CAMPC=%BASEFOLDER%campfire\
  35. set FURNC=%BASEFOLDER%furnance\
  36. set CCSSTONE=%CAMPC%sandstone\
  37. set FCGLASS=%FURNC%glass\
  38. set SCSTAIR=%STONEC%stair\
  39. set SCWALL=%STONEC%wall\
  40. set SCSLAB=%STONEC%slab\
  41. set TCSTAIR=%TABLEC%stair\
  42. set TCWALL=%TABLEC%wall\
  43. set TCSLAB=%TABLEC%slab\
  44. :: sandstone/sand value setting, do not touch
  45. set SANDSTONE=no
  46. set SAND=no
  47. exit /b
  48.  
  49. :Start
  50. call :primevar
  51. if ["%1"]==[""] goto End
  52. set NAMES=%~1
  53. if ["%2"]==["sandstone"] set SANDSTONE=yes
  54. if ["%2"]==["sand"] set SAND=yes
  55. goto Reciepe
  56.  
  57. :Reciepe
  58. if %SAND%==yes (
  59.     call :reciepewrite heavy_%NAMES%_sand off off
  60.     call :reciepewrite loose_%NAMES%_sand off off
  61.     call :reciepewrite %NAMES%_sand sandy %NAMES%
  62.     goto End
  63. )
  64. if %SANDSTONE%==yes (
  65.     call :reciepewrite %NAMES%_sand_stone sandstone %NAMES%
  66.     call :reciepewrite %NAMES%_cut_sand_stone off off
  67.     call :reciepewrite %NAMES%_chiseled_sand_stone off off
  68.     call :reciepewrite %NAMES%_smooth_sand_stone off off
  69.     goto End
  70. )
  71. call :reciepewrite %NAMES% off off
  72. :End
  73. exit /b
  74.  
  75. :reciepewrite
  76. set twmess=%1
  77. set temptwmess=%3
  78. set alt=%2
  79. if ["%alt%"]==["sandstone"] (
  80.    :: stonecutter swapping for sandstones
  81.     call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_sand_stone
  82.     call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_sand_stone
  83.     call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_sand_stone
  84.     call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_cut_sand_stone
  85.     call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_cut_sand_stone
  86.     call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_cut_sand_stone
  87.     call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_chiseled_sand_stone
  88.     call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_chiseled_sand_stone
  89.     call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_chiseled_sand_stone
  90.     call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_smooth_sand_stone
  91.     call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_smooth_sand_stone
  92.     call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_smooth_sand_stone
  93.    :: Table Crafting for the sandstones
  94.     call :table "%TABLEC%" %temptwmess%_sand square %temptwmess%_sand_stone 4
  95.     call :table "%TABLEC%" %temptwmess%_sand_stone square %temptwmess%_cut_sand_stone 4
  96.     call :table "%TABLEC%" %temptwmess%_cut_sand_stone square %temptwmess%_chiseled_sand_stone 4
  97.    :: Campe fire crafting for sand version to smoothstone
  98.     call :campfire "%CCSSTONE%" %temptwmess%_sand 300 0.35 %temptwmess%_smooth_sand_stone
  99. )
  100. if ["%alt%"]==["sandy"] call :furn %FCGLASS% %temptwmess%_sand 200 0.1 %temptwmess%_glass
  101. call :stonecut "%SCSTAIR%" %twmess% stair %twmess%_stair
  102. call :stonecut "%SCWALL%" %twmess% wall %twmess%_wall
  103. call :stonecut "%SCSLAB%" %twmess% slab %twmess%_slab
  104. call :table "%TCSTAIR%" %twmess% stair %twmess%_stair 4
  105. call :table "%TCWALL%" %twmess% wall %twmess%_wall 6
  106. call :table "%TCSLAB%" %twmess% wall %twmess%_slab 6
  107. exit /b
  108.  
  109. :stonecut
  110. :: arguments(in number order) - Path / Name1 / Name2 / Type
  111. call mcaidstoncut %1 %2 %4 %3 %MOD%
  112. exit /b
  113.  
  114. :table
  115. :: arguments(in number order) - Path / Name1 / Type / Name2 / Craft_Number
  116. call mcaidtable %3 %5 %2 %4 %1 %MOD%
  117. exit /b
  118.  
  119. :campfire
  120. :: arguments(in number order) - Path / Name1 / Cook_time / Exp / Name2
  121. call mcaidcfire %1 %3 %4 %2 %5 %MOD%
  122. exit /b
  123.  
  124. :furn
  125. :: arguments(in number order) - Path / Name1 / Cook_time / EXP / Name 2
  126. call mcaidfurn %1 %3 %4 %2 %5 %MOD%
  127. exit /b
  128.  
  129. --------------------------------------------------------------------------------------------------------------------------------------
  130. mcaidtable.bat
  131. ------
  132. @echo off
  133. if ["%1"]==[""] goto End
  134. set oext=json
  135. set patnum=%~1
  136. set cntnum=%2
  137. set tempora=%3
  138. set temporatwo=%4
  139. set tempath=%~5
  140. set tmod=%6
  141. call filwrite "%tempath%" { %temporatwo% %oext% new
  142. call filwrite "%tempath%" "  "type": "minecraft:crafting_shaped"," %temporatwo% %oext%
  143. :: echo used over call for patterns Consistency of use (double spaces in paterns broke arguments)
  144. if ["%patnum%"]==["square"] echo   "pattern": [ "yy","yy" ], >> %tpath%%temporatwo%.%oext%
  145. if ["%patnum%"]==["stair"] echo   "pattern": [ "y  ","yy ","yyy" ], >> %tpath%%temporatwo%.%oext%
  146. if ["%patnum%"]==["wall"] echo   "pattern": [ "yyy","yyy" ], >> %tpath%%temporatwo%.%oext%
  147. if ["%patnum%"]==["slab"] echo   "pattern": [ "yyy" ], >> %tpath%%temporatwo%.%oext%
  148. call filwrite "%tempath%" "  "key": {" %temporatwo% %oext%
  149. call filwrite "%tempath%" "    "y": {" %temporatwo% %oext%
  150. call filwrite "%tempath%" "      "item": "%tmod%:%tempora%"" %temporatwo% %oext%
  151. call filwrite "%tempath%" "    }" %temporatwo% %oext%
  152. call filwrite "%tempath%" "  }," %temporatwo% %oext%
  153. call filwrite "%tempath%" "  "result":{" %temporatwo% %oext%
  154. call filwrite "%tempath%" "    "item": "%tmod%:%temporatwo%"," %temporatwo% %oext%
  155. call filwrite "%tempath%" "    "count": %cntnum%" %temporatwo% %oext%
  156. call filwrite "%tempath%" "  }" %temporatwo% %oext%
  157. call filwrite "%tempath%" } %temporatwo% %oext%
  158. echo file %tpath%%temporatwo%.%oext%
  159. :End
  160. exit /b
  161. --------------------------------------------------------------------------------------------------------------------------------------
  162. mcaidstoncut.bat
  163. ------------------
  164. @echo off
  165. if ["%1"]==[""] goto End
  166. set oext=json
  167. set tpath=%~1
  168. set tempora=%2
  169. set temporatwo=%3
  170. set temalt=%4
  171. set tmod=%5
  172. set fout=%temporatwo%_from_%tempora%
  173. call filwrite "%tpath%" { %fout% %oext% new
  174. call filwrite "%tpath%" "  "type": "minecraft:stonecutting"," %fout% %oext%
  175. call filwrite "%tpath%" "  "ingredient": {" %fout% %oext%
  176. call filwrite "%tpath%" "    "item": "%tmod%:%tempora%"" %fout% %oext%
  177. call filwrite "%tpath%" "  }," %fout% %oext%
  178. call filwrite "%tpath%" "  "result": "%tmod%:%temporatwo%"," %fout% %oext%
  179. if %temalt%==slab ( call filwrite "%tpath%" "  "count": 2" %fout% %oext%) else call filwrite "%tpath%" "  "count": 1" %fout% %oext%
  180. call filwrite "%tpath%" } %fout% %oext%
  181. echo file %tpath%%fout%.%oext%
  182. :End
  183. exit /b
  184.  
  185. --------------------------------------------------------------------------------------------------------------------------------------
  186. mcaidfurn.bat
  187. ---------------
  188. @echo off
  189. if ["%1"]==[""] goto End
  190. set oext=json
  191. set tpath=%~1
  192. set ctime=%2
  193. set exp=%3
  194. set temnam=%4
  195. set outnam=%5
  196. set tmod=%6
  197. call filwrite "%tpath%" { %outnam% %oext% new
  198. call filwrite "%tpath%" "  "type": "minecraft:smelting"," %outnam% %oext%
  199. call filwrite "%tpath%" "  "ingredient": {" %outnam% %oext%
  200. call filwrite "%tpath%" "    "item": "%tmod%:%temnam%"" %outnam% %oext%
  201. call filwrite "%tpath%" "  }," %outnam% %oext%
  202. call filwrite "%tpath%" "  "result": "%tmod%:%outnam%"," %outnam% %oext%
  203. call filwrite "%tpath%" "  "experience": %exp%," %outnam% %oext%
  204. call filwrite "%tpath%" "  "cookingtime": %ctime%" %outnam% %oext%
  205. call filwrite "%tpath%" } %outnam% %oext%
  206. echo file %tpath%%outnam%.%oext%
  207. :End
  208. exit /b
  209.  
  210.  
  211. --------------------------------------------------------------------------------------------------------------------------------------
  212. mcaidcfire.bat
  213. ----------------
  214. @echo off
  215. if ["%1"]==[""] goto End
  216. set oext=json
  217. set temname=%4
  218. set temnametwo=%5
  219. set tpath=%~1
  220. set ctime=%2
  221. set exp=%3
  222. set tmod=%6
  223. call filwrite "%tpath%" { %temnametwo% %oext% new
  224. call filwrite "%tpath%" "  "type": "minecraft:campfire_cooking"," %temnametwo% %oext%
  225. call filwrite "%tpath%" "  "ingredient": {" %temnametwo% %oext%
  226. call filwrite "%tpath%" "    "item": "%tmod%:%temname%"" %temnametwo% %oext%
  227. call filwrite "%tpath%" "  }," %temnametwo% %oext%
  228. call filwrite "%tpath%" "  "result": "%tmod%:%temnametwo%"," %temnametwo% %oext%
  229. call filwrite "%tpath%" "  "experience": %exp%," %temnametwo% %oext%
  230. call filwrite "%tpath%" "  "cookingtime": %ctime%" %temnametwo% %oext%
  231. call filwrite "%tpath%" } %temnametwo% %oext%
  232. echo file %tpath%%temnametwo%.%oext%
  233. :End
  234. exit /b
  235.  
  236. --------------------------------------------------------------------------------------------------------------------------------------
  237. filwrite.bat
  238. --------------
  239. @echo off
  240. if ["%1"]==[""] goto End
  241. set tpath=%~1
  242. if NOT EXIST %tpath% mkdir %tpath%
  243. set tout=%tpath%%~3.%~4
  244. if ["%~5"]==["new"] ( set toper=^>) else set toper=^>^>
  245. echo %~2 %toper% %tout%
  246. :End
  247. exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement