Advertisement
DePhoegon

Model/Loot json aid - 1.18.1

Jan 22nd, 2022 (edited)
670
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :: mccap.bat
  2. @echo off
  3. goto Start
  4. ::Notes Area
  5. :: bat_filename "blockname" "a/s/p/sand/sandstone"
  6. :Start
  7. if ["%~1"]==[""] goto End
  8. if ["%~2"]==[""] goto End
  9. set NAMES=%~1
  10. set SIDES=%~2
  11. if "%SIDES%"=="sand" ( goto Sand) else ( goto Block)
  12. :End
  13. exit /b
  14. :Sand
  15. call ssw "%NAMES%" "sand"
  16. call mcaid "%NAMES%_sand" "a"
  17. call :Sandstonemodel
  18. goto End
  19. :Block
  20. if "%SIDES%"=="sandstone" ( goto Sandstonemodel)
  21. call ssw "%NAMES%" "%SIDES%"
  22. call mcaid "%NAMES%" "%SIDES%"
  23. goto End
  24. :Sandstonemodel
  25. call ssw "%NAMES%" "sandstone"
  26. call mcaid "%NAMES%_sand_stone" "s"
  27. call mcaid "%NAMES%_cut_sand_stone" "p"
  28. call mcaid "%NAMES%_smooth_sand_stone" "a"
  29. call mcaid "%NAMES%_chiseled_sand_stone" "s"
  30. exit /b
  31.  
  32. ::-------
  33. :: ssw.bat
  34. @echo off
  35. :: Version 2.0.3
  36. :: Minor typo in early call, resulting in wrong reciepe for slabs
  37. :: Version 2.0.1
  38. :: minor fixes
  39. :: Version 2
  40. :: 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]
  41. :: All variables are stored in the ssw.bat file -No Quotes / spaces supported in file/block name
  42. :: slabs / stairs / walls  Reciepe creator (stone cutter & table crafting)
  43. :: Sand blocks & Sandstone blocks get extra done
  44. :: 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)
  45. :: creates crafting for each of the sandstones for the others in the stone cutter
  46. :: assumes each block given will have walls/slabs/stairs of it
  47. :: separate batch files for compatibility & cross usage in a folder that is in the environmental path variables.
  48. :: -- Call can link to a full path where files kept w/ environmental path variable use
  49. :: ---
  50. :: updates
  51. :: added support for folders with spaces (note, folder structure with spaces is not supported by minecraft datapacks/mods)
  52. :: mcaid(furn/cfire/stoncut/table)  -- support for path spaces pass through (note, folder structure with spaces is not supported by minecraft datapacks/mods)
  53. :: mcaid(furn/cfire/stoncut/table) -- tweaked to signal start of file (to overwrite old files of the same name & prevent corrupted files)
  54. :: mcaid(furn/cfire/stoncut/table)/filwrite -- introduced exit /b to close the files if the first argument is missing. (attempting to prevent accidental exicution & errors)
  55. :: filwrite -- organized & fat cutout (28 to 9 lines w/ exit condition, & new switch)
  56. :: filwrite -- new switch to indicate to overwrite file of the same name or append to it.
  57. :: ssw -- formating & notes used to keep human readable & allow Understanding of what is being used where
  58.  
  59. goto Start
  60. :primevar
  61. :: do not use Quote marks in mod or paths
  62. set MOD=delbase
  63. set BASEFOLDER=D:\Minecraft-aidfiles\recipes\
  64. set STONEC=%BASEFOLDER%stone-cutter\
  65. set TABLEC=%BASEFOLDER%table\
  66. set CAMPC=%BASEFOLDER%campfire\
  67. set FURNC=%BASEFOLDER%furnance\
  68. set CCSSTONE=%CAMPC%sandstone\
  69. set FCGLASS=%FURNC%glass\
  70. set SCSTAIR=%STONEC%stair\
  71. set SCWALL=%STONEC%wall\
  72. set SCSLAB=%STONEC%slab\
  73. set TCSTAIR=%TABLEC%stair\
  74. set TCWALL=%TABLEC%wall\
  75. set TCSLAB=%TABLEC%slab\
  76. :: sandstone/sand value setting, do not touch
  77. set SANDSTONE=no
  78. set SAND=no
  79. exit /b
  80.  
  81. :Start
  82. call :primevar
  83. if ["%~1"]==[""] goto End
  84. set NAMES=%~1
  85. if ["%~2"]==["sandstone"] set SANDSTONE=yes
  86. if ["%~2"]==["sand"] set SAND=yes
  87. goto Reciepe
  88.  
  89. :Reciepe
  90. if %SAND%==yes (
  91.     call :reciepewrite %NAMES%_sand sandy %NAMES%
  92.     goto End
  93. )
  94. if %SANDSTONE%==yes (
  95.     call :reciepewrite %NAMES%_sand_stone sandstone %NAMES%
  96.     call :reciepewrite %NAMES%_cut_sand_stone off off
  97.     call :reciepewrite %NAMES%_chiseled_sand_stone off off
  98.     call :reciepewrite %NAMES%_smooth_sand_stone off off
  99.     goto End
  100. )
  101. call :reciepewrite %NAMES% off off
  102. :End
  103. exit /b
  104.  
  105. :reciepewrite
  106. set twmess=%1
  107. set temptwmess=%3
  108. set alt=%2
  109. if ["%alt%"]==["sandstone"] (
  110.    :: stonecutter swapping for sandstones
  111.     call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_sand_stone
  112.     call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_sand_stone
  113.     call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_sand_stone
  114.     call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_cut_sand_stone
  115.     call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_cut_sand_stone
  116.     call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_cut_sand_stone
  117.     call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_chiseled_sand_stone
  118.     call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_chiseled_sand_stone
  119.     call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_chiseled_sand_stone
  120.     call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_smooth_sand_stone
  121.     call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_smooth_sand_stone
  122.     call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_smooth_sand_stone
  123.    :: Table Crafting for the sandstones
  124.     call :table "%TABLEC%" %temptwmess%_sand square %temptwmess%_sand_stone 4
  125.     call :table "%TABLEC%" %temptwmess%_sand_stone square %temptwmess%_cut_sand_stone 4
  126.     call :table "%TABLEC%" %temptwmess%_cut_sand_stone square %temptwmess%_chiseled_sand_stone 4
  127.    :: Campe fire crafting for sand version to smoothstone
  128.     call :campfire "%CCSSTONE%" %temptwmess%_sand 300 0.35 %temptwmess%_smooth_sand_stone
  129. )
  130. if ["%alt%"]==["sandy"] call :furn %FCGLASS% %temptwmess%_sand 200 0.1 %temptwmess%_glass
  131. call :stonecut "%SCSTAIR%" %twmess% stair %twmess%_stair
  132. call :stonecut "%SCWALL%" %twmess% wall %twmess%_wall
  133. call :stonecut "%SCSLAB%" %twmess% slab %twmess%_slab
  134. call :table "%TCSTAIR%" %twmess% stair %twmess%_stair 4
  135. call :table "%TCWALL%" %twmess% wall %twmess%_wall 6
  136. call :table "%TCSLAB%" %twmess% slab %twmess%_slab 6
  137. exit /b
  138.  
  139. :stonecut
  140. :: arguments(in number order) - Path / Name1 / Name2 / Type
  141. call mcaidstoncut %1 %2 %4 %3 %MOD%
  142. exit /b
  143.  
  144. :table
  145. :: arguments(in number order) - Path / Name1 / Type / Name2 / Craft_Number
  146. call mcaidtable %3 %5 %2 %4 %1 %MOD%
  147. exit /b
  148.  
  149. :campfire
  150. :: arguments(in number order) - Path / Name1 / Cook_time / Exp / Name2
  151. call mcaidcfire %1 %3 %4 %2 %5 %MOD%
  152. exit /b
  153.  
  154. :furn
  155. :: arguments(in number order) - Path / Name1 / Cook_time / EXP / Name 2
  156. call mcaidfurn %1 %3 %4 %2 %5 %MOD%
  157. exit /b
  158.  
  159. ::---
  160. ::mcaid.bat
  161. @echo off
  162. :: Version 3.0
  163. :: Updated to MC 1.18.1 standardization
  164. :: Put a reliance on a secondary file to minimize the amount 'echo'/'write' call locations
  165. :: Split if Else statements that used a goto (does not work as intended inline with && )
  166. :: Two locations using echo command (under assumption the file is there & accessible)
  167. :: -- The = in the string w/o spaces used in Axis for Slabs & Pillars incorrectly passes forward
  168. :: -- Overrides used sparingly
  169. :: Slimmed down notes, cutting out redundant fixes
  170. :: Version 2.5
  171. :: Version 2.4
  172. :: Version 2.2
  173. :: version 2.1.5
  174. :: version 2.1
  175. :: version 2.0
  176. :: includes fixed array calls, typos, slab loot table missing lines added (was missing 3)
  177. :: Added command line entry of blocks.
  178. :: creates JSON files for 'Blockstate', 'Block', 'item'(For block), & 'loot_table'
  179. :: Input Block (1 texture blocks, like sand // 3 textured blocks like Sand stone{top,side,bottom}) or Pillar (two textured, & is meant fora pillar block, like basalt)
  180. :: textures not supplied, just named *wink* X}
  181. :: Intended for mods w/ an ability register blocks (forge/etc)
  182. :: Obviously  set environmental paths correctly, & Your ModID
  183. :: ---
  184. :: batfilename blockname [a/p/s] [n]
  185. :: (stick to minecraft convention.. red_sand, polished_smooth_rock, etc. etc.)
  186. :: a - block with 1 texture (sand)
  187. :: p - pillar block (directional x, y, z positions)
  188. :: s - block with 3 textures (like sandstone, top/side/bottom)
  189. :: Only supports 1 base block at a time
  190. :: n - for it to cycle again, and prompt for a new block name & type (leave blank for it to close right after it's done)
  191. :: ---
  192. :: Simplification of json creation for block, stair, & slab variants.
  193. :: Set for Blocks
  194. :: Uses blockname_top, blockname_side, blockname_bottom for blocks with different textures
  195. :: Uses blockname_top, blockname_side for pillar blocks. (texture)
  196.  
  197. goto Start
  198.  
  199. :RE2
  200. if ["%3"]==[""] (
  201.     goto End
  202. ) else (
  203.     set T=%3
  204. )
  205. if %T%==n (goto Nextcycle)
  206. if %T%==N (goto Nextcycle)
  207. :End
  208. exit /b
  209. :Start
  210. set MOD=delbase
  211. set BASEFOLDER=D:\Minecraft-aidfiles\models\
  212. set BLOCKS=%BASEFOLDER%blockstates\
  213. set BLOCK=%BASEFOLDER%models\block\
  214. set SLAB=%BLOCK%slab\
  215. set STAIR=%BLOCK%stair\
  216. set PILLA=%BLOCK%pillar\
  217. set ITEM=%BASEFOLDER%models\item\
  218. set DROP=%BASEFOLDER%loot_tables\blocks\
  219. if NOT EXIST %BLOCKS% ( mkdir %BLOCKS% )
  220. if NOT EXIST %SLAB% ( mkdir %SLAB% )
  221. if NOT EXIST %STAIR% ( mkdir %STAIR% )
  222. if NOT EXIST %PILLA% ( mkdir %PILLA% )
  223. if NOT EXIST %ITEM% ( mkdir %ITEM% )
  224. if NOT EXIST %DROP% ( mkdir %DROP% )
  225. set FACE[0]=east
  226. set FACE[1]=north
  227. set FACE[2]=south
  228. set FACE[3]=west
  229. set HALF[0]=bottom
  230. set HALF[1]=top
  231. set SHAPE[0]=inner_left
  232. set SHAPE[1]=inner_right
  233. set SHAPE[2]=outer_left
  234. set SHAPE[3]=outer_right
  235. set SHAPE[4]=straight
  236.  
  237. if NOT ["%~1"]==[""]  (
  238.     set NAM=%~1
  239.     if NOT ["%~2"]==[""] (
  240.         set ALLSIDED=%~2
  241.         goto Aurgument
  242.     )
  243. )
  244. :Nextcycle
  245. set /p NAM= "Base Block Name: "
  246. :Sid
  247. echo Enter ( A ) if block uses the same texture on all sides
  248. echo Enter ( S ) if it uses a Top, side, & bottom texture that are different
  249. echo Enter ( P ) for Pillars.  Logs & Basalt are pillar blocks
  250. echo Enter ( E ) to exit.
  251. echo Provides Basic loot table only. (It breaks, it drops.  nothing more)
  252. set /p ALLSIDED= "Type of block: "
  253. :Aurgument
  254. if %ALLSIDED%==A ( goto Setallsided )
  255. if %ALLSIDED%==a ( goto Setallsided )
  256. if %ALLSIDED%==S ( goto Topped )
  257. if %ALLSIDED%==s ( goto Topped )
  258. if %ALLSIDED%==P ( goto Pillar )
  259. if %ALLSIDED%==p ( goto Pillar )
  260. if %ALLSIDED%==E ( goto End )
  261. if %ALLSIDED%==e ( goto End )
  262. echo "Valid Entries are ( A, a, S, s, E, e ), or Exit (E)"
  263. goto Sid
  264. :Setallsided
  265. set ALLSIDED=ALL
  266. goto Blockstate
  267. :Pillar
  268. set ALLSIDED=PILL
  269. set AXIS=x
  270. goto Blockstate
  271. :Topped
  272. set ALLSIDED=TOPP
  273. :Blockstate
  274. if %ALLSIDED%==ALL (
  275.     set TopSide=%NAM%
  276.     set SideSide=%NAM%
  277.     set BotSide=%NAM%
  278. )
  279. if %ALLSIDED%==PILL (
  280.     set TopSide=%NAM%_top
  281.     set SideSide=%NAM%_side
  282.     set BotSide=%NAM%_top
  283. )
  284. if %ALLSIDED%==TOPP (
  285.     set TopSide=%NAM%_top
  286.     set SideSide=%NAM%_side
  287.     set BotSide=%NAM%_bottom
  288. )
  289. ::Blockstates
  290. ::Base Block
  291. call filwrite "%BLOCKS%" "{" "%NAM%" "json" "new"
  292. call filwrite "%BLOCKS%" "  "variants": {" "%NAM%" "json"
  293. if %ALLSIDED%==PILL ( goto Blockstatepill )
  294. call filwrite "%BLOCKS%" "    "": {" "%NAM%" "json"
  295. call filwrite "%BLOCKS%" "      "model": "%MOD%:block/%NAM%"" "%NAM%" "json"
  296. call filwrite "%BLOCKS%" "    }" "%NAM%" "json"
  297. goto Axisout
  298. :Blockstatepill
  299. echo    "axis=%AXIS%": { >> %BLOCKS%%NAM%.json
  300. if %AXIS%==y ( call filwrite "%BLOCKS%" "      "model": "%MOD%:block/pillar/%NAM%"" "%NAM%" "json") else ( call filwrite "%BLOCKS%" "      "model": "%MOD%:block/pillar/%NAM%"," "%NAM%" "json")
  301. if %AXIS%==x ( call filwrite "%BLOCKS%" "      "x": 90," "%NAM%" "json")
  302. if %AXIS%==z ( call filwrite "%BLOCKS%" "      "x": 90" "%NAM%" "json")
  303. if %AXIS%==x ( call filwrite "%BLOCKS%" "      "y": 90" "%NAM%" "json")
  304. if %AXIS%==z (
  305.     call filwrite "%BLOCKS%" "    }" "%NAM%" "json"
  306.     goto Axisout
  307. ) else (
  308.     call filwrite "%BLOCKS%" "    }," "%NAM%" "json"
  309. )
  310. if %AXIS%==x ( set AXIS=y) else ( set AXIS=z)
  311. goto Blockstatepill
  312. :Axisout
  313. call filwrite "%BLOCKS%" "  }" "%NAM%" "json"
  314. call filwrite "%BLOCKS%" "}" "%NAM%" "json"
  315.  
  316. :: Slab version
  317. call filwrite "%BLOCKS%" "{" "%NAM%_slab" "json" "new"
  318. set AXIS=bottom
  319. call filwrite "%BLOCKS%" "  "variants": {" "%NAM%_slab" "json"
  320. :Slabvar
  321. echo    "type=%AXIS%": { >> %BLOCKS%%NAM%_slab.json
  322. if %AXIS%==bottom ( call filwrite "%BLOCKS%" ""model": "%MOD%:block/slab/%NAM%_slab"" "%NAM%_slab" "json") else ( call filwrite "%BLOCKS%" ""model": "%MOD%:block/slab/%NAM%_slab_%AXIS%"" "%NAM%_slab" "json")
  323. if %AXIS%==top (
  324.     call filwrite "%BLOCKS%" "    }" "%NAM%_slab" "json"
  325.     goto Slabout
  326. ) else (
  327.     call filwrite "%BLOCKS%" "    }," "%NAM%_slab" "json"
  328. )
  329. if %AXIS%==bottom ( set AXIS=double) else ( set AXIS=top)
  330. goto Slabvar
  331. :Slabout
  332. call filwrite "%BLOCKS%" "  }" "%NAM%_slab" "json"
  333. call filwrite "%BLOCKS%" "}" "%NAM%_slab" "json"
  334.  
  335. :: Stair blocks
  336. set /a OUTER=0
  337. set /a MID=0
  338. set /a INNER=0
  339. call filwrite "%BLOCKS%" "{" "%NAM%_stair" "json" "new"
  340. call filwrite "%BLOCKS%" "  "variants": {" "%NAM%_stair" "json"
  341. goto Stairloop
  342.  
  343. :Stairloop
  344. set /a YY=0
  345. set uv=no
  346. :: checking using Shape array
  347. :: Inner Left
  348. if %INNER% EQU 0 (
  349.     if %MID% EQU 0 (
  350.         if %OUTER% EQU 0 ( set /a YY=270 )
  351.         if %OUTER% EQU 1 ( set /a YY=180 )
  352.         if %OUTER% EQU 3 ( set /a YY=90 )
  353.     ) else (
  354.         if %OUTER% EQU 1 ( set /a YY=270 )
  355.         if %OUTER% EQU 2 ( set /a YY=90 )
  356.         if %OUTER% EQU 3 ( set /a YY=180 )
  357.     )
  358. )
  359. ::Inner Right
  360. if %INNER% EQU 1 (
  361.     if %MID% EQU 0 (
  362.         if %OUTER% EQU 1 ( set /a YY=270 )
  363.         if %OUTER% EQU 2 ( set /a YY=90 )
  364.         if %OUTER% EQU 3 ( set /a YY=180 )
  365.     ) else (
  366.         if %OUTER% EQU 0 ( set /a YY=90 )
  367.         if %OUTER% EQU 2 ( set /a YY=180 )
  368.         if %OUTER% EQU 3 ( set /a YY=270 )
  369.     )
  370. )
  371. ::Outer Left
  372. if %INNER% EQU 2 (
  373.     if %MID% EQU 0 (
  374.         if %OUTER% EQU 0 ( set /a YY=270 )
  375.         if %OUTER% EQU 1 ( set /a YY=180 )
  376.         if %OUTER% EQU 3 ( set /a YY=90 )
  377.     ) else (
  378.         if %OUTER% EQU 1 ( set /a YY=270 )
  379.         if %OUTER% EQU 2 ( set /a YY=90 )
  380.         if %OUTER% EQU 3 ( set /a YY=180 )
  381.     )
  382. )
  383. ::Outer Right
  384. if %INNER% EQU 3 (
  385.     if %MID% EQU 0 (
  386.         if %OUTER% EQU 1 ( set /a YY=270 )
  387.         if %OUTER% EQU 2 ( set /a YY=90 )
  388.         if %OUTER% EQU 3 ( set /a YY=180 )
  389.     ) else (
  390.         if %OUTER% EQU 0 ( set /a YY=90 )
  391.         if %OUTER% EQU 2 ( set /a YY=180 )
  392.         if %OUTER% EQU 3 ( set /a YY=270 )
  393.     )
  394. )
  395. if %INNER% EQU 4 (
  396.     if %OUTER% EQU 1 ( set /a YY=270 )
  397.     if %OUTER% EQU 2 ( set /a YY=90 )
  398.     if %OUTER% EQU 3 ( set /a YY=180 )
  399. )
  400. :: Call Echo used to properly call the array value
  401. echo    "facing=%%FACE[%OUTER%]%%,half=%%HALF[%MID%]%%,shape=%%SHAPE[%INNER%]%%": { >> %BLOCKS%%NAM%_stair.json
  402. if %MID% EQU 1 ( set uv=yes)
  403. if %YY% GTR 10 ( set uv=yes)
  404. if %INNER% LSS 2 (
  405.     if %uv%==yes ( set line=      "model": "%MOD%:block/stair/%NAM%_stair_inner",) else ( set line=      "model": "%MOD%:block/stair/%NAM%_stair_inner")
  406. ) else (
  407.     if %INNER% LSS 4 (
  408.         if %uv%==yes ( set line=      "model": "%MOD%:block/stair/%NAM%_stair_outer",) else ( set line=      "model": "%MOD%:block/stair/%NAM%_stair_outer")
  409.     ) else (
  410.         if %uv%==yes ( set line=      "model": "%MOD%:block/stair/%NAM%_stair",) else ( set line=      "model": "%MOD%:block/stair/%NAM%_stair")
  411.     )
  412. )
  413. call filwrite "%BLOCKS%" "%line%" "%NAM%_stair" "json"
  414. if %MID% EQU 1 ( call filwrite "%BLOCKS%" "      "x": 180," "%NAM%_stair" "json")
  415. if %YY% GTR 10 ( call filwrite "%BLOCKS%" "      "y": %YY%," "%NAM%_stair" "json")
  416. if %uv%==yes ( call filwrite "%BLOCKS%" "      "uvlock": true" "%NAM%_stair" "json")
  417. set /a THREE=%OUTER% + %MID% + %INNER%
  418. if %THREE% EQU 8 (
  419.     call filwrite "%BLOCKS%" "    }" "%NAM%_stair" "json"
  420.     call filwrite "%BLOCKS%" "  }" "%NAM%_stair" "json"
  421.     call filwrite "%BLOCKS%" "}" "%NAM%_stair" "json"
  422. ) else (
  423.     call filwrite "%BLOCKS%" "    }," "%NAM%_stair" "json"
  424.     echo     }, >> %BLOCKS%%NAM%_stair.json
  425.     if %INNER% LSS 4 (
  426.         set /a INNER=%INNER% + 1
  427.     ) else (
  428.         set /a INNER=0
  429.         if %MID% EQU 0 (
  430.             set /a MID=1
  431.         ) else (
  432.             set /a MID=0
  433.             if %OUTER% LSS 3 (
  434.                 set /a OUTER=%OUTER% + 1
  435.             ) else (
  436.                 echo Failure in logic, this error shouldn't show up,
  437.             )
  438.         )
  439.     )
  440.     goto Stairloop
  441. )
  442.  
  443. ::Block models
  444. :: Check for Pillar first
  445. if %ALLSIDED%==PILL ( goto Pilstart ) else ( goto CubeStart )
  446. set top
  447. :Pilstart
  448. call filwrite "%PILLA%" "{" "%NAM%" "json" "new"
  449. call filwrite "%PILLA%" "  "parent": "minecraft:block/cube_column"," "%NAM%" "json"
  450. call filwrite "%PILLA%" "  "textures": {" "%NAM%" "json"
  451. call filwrite "%PILLA%" "    "end": "%MOD%:block/%TopSide%"," "%NAM%" "json"
  452. call filwrite "%PILLA%" "    "side": "%MOD%:block/%SideSide%"" "%NAM%" "json"
  453. call filwrite "%PILLA%" "  }" "%NAM%" "json"
  454. call filwrite "%PILLA%" "}" "%NAM%" "json"
  455. goto Slabstart
  456.  
  457. ::Cubes
  458. :CubeStart
  459. call filwrite "%BLOCK%" "{" "%NAM%" "json" "new"
  460. if %ALLSIDED%==ALL (
  461.     call filwrite "%BLOCK%" "  "parent": "minecraft:block/cube_all"," "%NAM%" "json"
  462. ) else (
  463.     call filwrite "%BLOCK%" "  "parent": "minecraft:block/cube_bottom_top"," "%NAM%" "json"
  464. )
  465. call filwrite "%BLOCK%" "   "textures": {" "%NAM%" "json"
  466. if %ALLSIDED%==ALL (
  467.     call filwrite "%BLOCK%" "     "all": "%MOD%:block/%NAM%"" "%NAM%" "json"
  468. ) else (
  469.     call filwrite "%BLOCK%" "     "top": "%MOD%:block/%TopSide%"," "%NAM%" "json"
  470.     call filwrite "%BLOCK%" "     "bottom": "%MOD%:block/%BotSide%"," "%NAM%" "json"
  471.     call filwrite "%BLOCK%" "     "side": "%MOD%:block/%SideSide%"" "%NAM%" "json"
  472. )
  473. call filwrite "%BLOCK%" "  }" "%NAM%" "json"
  474. call filwrite "%BLOCK%" "}" "%NAM%" "json"
  475.  
  476. ::Slabs
  477. :Slabstart
  478. call :Slabfiles "{" "all" "new"
  479. call filwrite "%SLAB%" "  "parent": "minecraft:block/slab"," "%NAM%_slab" "json"
  480. if %ALLSIDED%==TOPP (
  481.     call filwrite "%SLAB%" "  "parent": "minecraft:block/cube_bottom_top"," "%NAM%_slab_double" "json"
  482. ) else (
  483.     call filwrite "%SLAB%" "  "parent": "minecraft:block/cube_column"," "%NAM%_slab_double" "json"
  484. )
  485. call filwrite "%SLAB%" "  "parent": "minecraft:block/slab_top"," "%NAM%_slab_top" "json"
  486. call :Slabfiles "  "textures": {" all
  487. if %ALLSIDED%==TOPP (
  488.     call :Slabfiles "    "bottom": "%MOD%:block/%BotSide%"," all
  489.     call :Slabfiles "    "top": "%MOD%:block/%TopSide%"," all
  490. ) else (
  491.     call :Slabfiles "    "bottom": "%MOD%:block/%BotSide%","
  492.     call :Slabfiles "    "top": "%MOD%:block/%TopSide%","
  493.     call filwrite "%SLAB%" "    "end": "%MOD%:block/%TopSide%"," "%NAM%_slab_double" "json"
  494. )
  495. call :Slabfiles "    "side": "%MOD%:block/%SideSide%"" "all"
  496. call :Slabfiles "  }" "all"
  497. call :Slabfiles "}" "all"
  498. goto Stairs
  499.  
  500. :Slabfiles
  501. set Bark=%~1
  502. if "%~3"=="new" (set SLFLAG="new") else (set SLFLAG="")
  503. call filwrite "%SLAB%" "%Bark%" "%NAM%_slab" "json" %SLFLAG%
  504. if "%~2"=="all" call filwrite "%SLAB%" "%Bark%" "%NAM%_slab_double" "json" %SLFLAG%
  505. call filwrite "%SLAB%" "%Bark%" "%NAM%_slab_top" "json" %SLFLAG%
  506. exit /b
  507.  
  508. :Stairs
  509. set BOTT=%NAM%
  510. set TTOPP=%NAM%
  511. set TSIDE=%NAM%
  512.  
  513. call :Stairfiles { "new"
  514. call :Stairfiles block
  515. call :Stairfiles "  "textures": {"
  516. call :Stairfiles "    "bottom": "%MOD%:block/%BotSide%","
  517. call :Stairfiles "    "top": "%MOD%:block/%TopSide%","
  518. call :Stairfiles "    "side": "%MOD%:block/%SideSide%""
  519. call :Stairfiles "   }"
  520. call :Stairfiles }
  521. goto Bitem
  522. :Stairfiles
  523. set PARE=%~1
  524. if "%~2"=="new" (set SFLAG="new") else (set SFLAG="")
  525. if "%PARE%"=="block" (
  526.     call filwrite "%STAIR%" "  "parent": "minecraft:block/stairs"," "%NAM%_stair" "json"
  527.     call filwrite "%STAIR%" "  "parent": "minecraft:block/inner_stairs"," "%NAM%_stair_inner" "json"
  528.     call filwrite "%STAIR%" "  "parent": "minecraft:block/outer_stairs"," "%NAM%_stair_outer" "json"
  529. ) else (
  530.     call filwrite "%STAIR%" "%PARE%" "%NAM%_stair" "json" %SFLAG%
  531.     call filwrite "%STAIR%" "%PARE%" "%NAM%_stair_inner" "json" %SFLAG%
  532.     call filwrite "%STAIR%" "%PARE%" "%NAM%_stair_outer" "json" %SFLAG%
  533. )
  534. exit /b
  535.  
  536. :: Item versions of the blocks
  537. :Bitem
  538. call filwrite "%ITEM%" "{" "%NAM%" "json" "new"
  539. call filwrite "%ITEM%" "{" "%NAM%_slab" "json" "new"
  540. call filwrite "%ITEM%" "{" "%NAM%_stair" "json" "new"
  541. if %ALLSIDED%==PILL (
  542.     call filwrite "%ITEM%" "   "parent": "%MOD%:block/pillar/%NAM%"" "%NAM%" "json"
  543. ) else (
  544.     call filwrite "%ITEM%" "   "parent":"%MOD%:block/%NAM%"" "%NAM%" "json"
  545. )
  546. call filwrite "%ITEM%" "  "parent": "%MOD%:block/slab/%NAM%_slab"" "%NAM%_slab" "json"
  547. call filwrite "%ITEM%" "  "parent": "%MOD%:block/stair/%NAM%_stair"" "%NAM%_stair" "json"
  548. call filwrite "%ITEM%" "}" "%NAM%" "json"
  549. call filwrite "%ITEM%" "}" "%NAM%_slab" "json"
  550. call filwrite "%ITEM%" "}" "%NAM%_stair" "json"
  551.  
  552. ::blockloot
  553. call normloot "%DROP%" "%MOD%:%NAM%" "%NAM%" "json" "norm"
  554. call normloot "%DROP%" "%MOD%:%NAM%_stair" "%NAM%_stair" "json" "norm"
  555. call normloot "%DROP%" "%MOD%:%NAM%_slab" "%NAM%_slab" "json" "slab"
  556. goto RE2
  557.  
  558. ::---
  559. ::mcaidcfire.bat
  560. @echo off
  561. if ["%1"]==[""] goto End
  562. set oext=json
  563. set temname=%4
  564. set temnametwo=%5
  565. set tpath=%~1
  566. set ctime=%2
  567. set exp=%3
  568. set tmod=%6
  569. call filwrite "%tpath%" { %temnametwo% %oext% new
  570. call filwrite "%tpath%" "  "type": "minecraft:campfire_cooking"," %temnametwo% %oext%
  571. call filwrite "%tpath%" "  "ingredient": {" %temnametwo% %oext%
  572. call filwrite "%tpath%" "    "item": "%tmod%:%temname%"" %temnametwo% %oext%
  573. call filwrite "%tpath%" "  }," %temnametwo% %oext%
  574. call filwrite "%tpath%" "  "result": "%tmod%:%temnametwo%"," %temnametwo% %oext%
  575. call filwrite "%tpath%" "  "experience": %exp%," %temnametwo% %oext%
  576. call filwrite "%tpath%" "  "cookingtime": %ctime%" %temnametwo% %oext%
  577. call filwrite "%tpath%" } %temnametwo% %oext%
  578. echo file %tpath%%temnametwo%.%oext%
  579. :End
  580. exit /b
  581. ::----
  582. ::mcaidfurn.bat
  583. @echo off
  584. if ["%1"]==[""] goto End
  585. set oext=json
  586. set tpath=%~1
  587. set ctime=%2
  588. set exp=%3
  589. set temnam=%4
  590. set outnam=%5
  591. set tmod=%6
  592. call filwrite "%tpath%" { %outnam% %oext% new
  593. call filwrite "%tpath%" "  "type": "minecraft:smelting"," %outnam% %oext%
  594. call filwrite "%tpath%" "  "ingredient": {" %outnam% %oext%
  595. call filwrite "%tpath%" "    "item": "%tmod%:%temnam%"" %outnam% %oext%
  596. call filwrite "%tpath%" "  }," %outnam% %oext%
  597. call filwrite "%tpath%" "  "result": "%tmod%:%outnam%"," %outnam% %oext%
  598. call filwrite "%tpath%" "  "experience": %exp%," %outnam% %oext%
  599. call filwrite "%tpath%" "  "cookingtime": %ctime%" %outnam% %oext%
  600. call filwrite "%tpath%" } %outnam% %oext%
  601. echo file %tpath%%outnam%.%oext%
  602. :End
  603. exit /b
  604.  
  605. ::----
  606. ::mcaidstoncut.bat
  607. @echo off
  608. if ["%1"]==[""] goto End
  609. set oext=json
  610. set tpath=%~1
  611. set tempora=%2
  612. set temporatwo=%3
  613. set temalt=%4
  614. set tmod=%5
  615. set fout=%temporatwo%_from_%tempora%
  616. call filwrite "%tpath%" { %fout% %oext% new
  617. call filwrite "%tpath%" "  "type": "minecraft:stonecutting"," %fout% %oext%
  618. call filwrite "%tpath%" "  "ingredient": {" %fout% %oext%
  619. call filwrite "%tpath%" "    "item": "%tmod%:%tempora%"" %fout% %oext%
  620. call filwrite "%tpath%" "  }," %fout% %oext%
  621. call filwrite "%tpath%" "  "result": "%tmod%:%temporatwo%"," %fout% %oext%
  622. if %temalt%==slab ( call filwrite "%tpath%" "  "count": 2" %fout% %oext%) else call filwrite "%tpath%" "  "count": 1" %fout% %oext%
  623. call filwrite "%tpath%" } %fout% %oext%
  624. echo file %tpath%%fout%.%oext%
  625. :End
  626. exit /b
  627.  
  628. ::----
  629. ::mcaidtable.bat
  630. @echo off
  631. if ["%1"]==[""] goto End
  632. set oext=json
  633. set patnum=%~1
  634. set cntnum=%2
  635. set tempora=%3
  636. set temporatwo=%4
  637. set tempath=%~5
  638. set tmod=%6
  639. call filwrite "%tempath%" { %temporatwo% %oext% new
  640. call filwrite "%tempath%" "  "type": "minecraft:crafting_shaped"," %temporatwo% %oext%
  641. :: echo used over call for patterns Consistency of use (double spaces in paterns broke arguments)
  642. if ["%patnum%"]==["square"] echo   "pattern": [ "yy","yy" ], >> %tpath%%temporatwo%.%oext%
  643. if ["%patnum%"]==["stair"] echo   "pattern": [ "y  ","yy ","yyy" ], >> %tpath%%temporatwo%.%oext%
  644. if ["%patnum%"]==["wall"] echo   "pattern": [ "yyy","yyy" ], >> %tpath%%temporatwo%.%oext%
  645. if ["%patnum%"]==["slab"] echo   "pattern": [ "yyy" ], >> %tpath%%temporatwo%.%oext%
  646. call filwrite "%tempath%" "  "key": {" %temporatwo% %oext%
  647. call filwrite "%tempath%" "    "y": {" %temporatwo% %oext%
  648. call filwrite "%tempath%" "      "item": "%tmod%:%tempora%"" %temporatwo% %oext%
  649. call filwrite "%tempath%" "    }" %temporatwo% %oext%
  650. call filwrite "%tempath%" "  }," %temporatwo% %oext%
  651. call filwrite "%tempath%" "  "result":{" %temporatwo% %oext%
  652. call filwrite "%tempath%" "    "item": "%tmod%:%temporatwo%"," %temporatwo% %oext%
  653. call filwrite "%tempath%" "    "count": %cntnum%" %temporatwo% %oext%
  654. call filwrite "%tempath%" "  }" %temporatwo% %oext%
  655. call filwrite "%tempath%" } %temporatwo% %oext%
  656. echo file %tpath%%temporatwo%.%oext%
  657. :End
  658. exit /b
  659.  
  660. ::-------
  661. ::normloot.bat
  662. GOTO Start
  663. :End
  664. exit /b
  665. :Start
  666. set tpath=%~1
  667. set titem=%2
  668. set tfilou=%~3
  669. set tfext=%~4
  670. set ttype=%~5
  671.  
  672. call filwrite "%tpath%" "{" "%tfilou%" "%tfext%" "new"
  673. call filwrite "%tpath%" "  "type": "minecraft:block"," "%tfilou%" "%tfext%"
  674. call filwrite "%tpath%" "  "pools": [" "%tfilou%" "%tfext%"
  675. call filwrite "%tpath%" "    {" "%tfilou%" "%tfext%"
  676. call filwrite "%tpath%" "      "rolls": 1.0," "%tfilou%" "%tfext%"
  677. call filwrite "%tpath%" "      "bonus_rolls": 0.0," "%tfilou%" "%tfext%"
  678. call filwrite "%tpath%" "      "entries": [" "%tfilou%" "%tfext%"
  679. call filwrite "%tpath%" "        {" "%tfilou%" "%tfext%"
  680. call filwrite "%tpath%" "          "type": "minecraft:item"," "%tfilou%" "%tfext%"
  681. if ["%ttype%"]==["slab"] (
  682. call filwrite "%tpath%" "          "functions": [" "%tfilou%" "%tfext%"
  683. call filwrite "%tpath%" "            {" "%tfilou%" "%tfext%"
  684. call filwrite "%tpath%" "              "function": "minecraft:set_count"," "%tfilou%" "%tfext%"
  685. call filwrite "%tpath%" "              "conditions": [" "%tfilou%" "%tfext%"
  686. call filwrite "%tpath%" "                {" "%tfilou%" "%tfext%"
  687. call filwrite "%tpath%" "                  "condition": "minecraft:block_state_property"," "%tfilou%" "%tfext%"
  688. call filwrite "%tpath%" "                  "block": %titem%," "%tfilou%" "%tfext%"
  689. call filwrite "%tpath%" "                  "properties": {" "%tfilou%" "%tfext%"
  690. call filwrite "%tpath%" "                    "type": "double"" "%tfilou%" "%tfext%"
  691. call filwrite "%tpath%" "                  }" "%tfilou%" "%tfext%"
  692. call filwrite "%tpath%" "                }" "%tfilou%" "%tfext%"
  693. call filwrite "%tpath%" "              ]," "%tfilou%" "%tfext%"
  694. call filwrite "%tpath%" "              "count": 2.0," "%tfilou%" "%tfext%"
  695. call filwrite "%tpath%" "              "add": false" "%tfilou%" "%tfext%"
  696. call filwrite "%tpath%" "            }," "%tfilou%" "%tfext%"
  697. call :explosion_decay
  698. call filwrite "%tpath%" "          ]," "%tfilou%" "%tfext%"
  699. call filwrite "%tpath%" "          "name": %titem%" "%tfilou%" "%tfext%"
  700. GOTO fout
  701. )
  702.  
  703. ::Generic Loot_table -- Insert special ones above this
  704. call filwrite "%tpath%" "          "name": %titem%" "%tfilou%" "%tfext%"
  705. call filwrite "%tpath%" "        }" "%tfilou%" "%tfext%"
  706. call filwrite "%tpath%" "      ]," "%tfilou%" "%tfext%"
  707. call filwrite "%tpath%" "      "conditions": [" "%tfilou%" "%tfext%"
  708. call :explosion_decay
  709. call filwrite "%tpath%" "      ]" "%tfilou%" "%tfext%"
  710. :fout
  711. call filwrite "%tpath%" "    }" "%tfilou%" "%tfext%"
  712. call filwrite "%tpath%" "  ]" "%tfilou%" "%tfext%"
  713. call filwrite "%tpath%" "}" "%tfilou%" "%tfext%"
  714. GOTO End
  715. :explosion_decay
  716. call filwrite "%tpath%" "        {" "%tfilou%" "%tfext%"
  717. call filwrite "%tpath%" "          "condition": "minecraft:survives_explosion"" "%tfilou%" "%tfext%"
  718. call filwrite "%tpath%" "        }" "%tfilou%" "%tfext%"
  719. exit /b
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement