DePhoegon icon

Model/Loot json aid - 1.18.1

DePhoegon | PRO | 01/31/22 08:28:13 AM UTC (Edited) | 0 ⭐ | 1326 👁️ | Never ⏰ | []
Batch |

27.05 KB

|

None

|

0 👍

/

0 👎

:: mccap.bat
@echo off
goto Start
::Notes Area
:: bat_filename "blockname" "a/s/p/sand/sandstone"
:Start
if ["%~1"]==[""] goto End
if ["%~2"]==[""] goto End
set NAMES=%~1
set SIDES=%~2
if "%SIDES%"=="sand" ( goto Sand) else ( goto Block)
:End
exit /b
:Sand
call ssw "%NAMES%" "sand"
call mcaid "%NAMES%_sand" "a"
call :Sandstonemodel
goto End
:Block
if "%SIDES%"=="sandstone" ( goto Sandstonemodel)
call ssw "%NAMES%" "%SIDES%"
call mcaid "%NAMES%" "%SIDES%"
goto End
:Sandstonemodel
call ssw "%NAMES%" "sandstone"
call mcaid "%NAMES%_sand_stone" "s"
call mcaid "%NAMES%_cut_sand_stone" "p"
call mcaid "%NAMES%_smooth_sand_stone" "a"
call mcaid "%NAMES%_chiseled_sand_stone" "s"
exit /b
 
::-------
:: ssw.bat
@echo off
:: Version 2.0.3
:: Minor typo in early call, resulting in wrong reciepe for slabs
:: Version 2.0.1
:: minor fixes
:: Version 2
:: 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]
:: All variables are stored in the ssw.bat file -No Quotes / spaces supported in file/block name
:: slabs / stairs / walls  Reciepe creator (stone cutter & table crafting)
:: Sand blocks & Sandstone blocks get extra done
:: 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)
:: creates crafting for each of the sandstones for the others in the stone cutter
:: assumes each block given will have walls/slabs/stairs of it 
:: separate batch files for compatibility & cross usage in a folder that is in the environmental path variables.
:: -- Call can link to a full path where files kept w/ environmental path variable use
:: ---
:: updates
:: added support for folders with spaces (note, folder structure with spaces is not supported by minecraft datapacks/mods)
:: mcaid(furn/cfire/stoncut/table)  -- support for path spaces pass through (note, folder structure with spaces is not supported by minecraft datapacks/mods)
:: mcaid(furn/cfire/stoncut/table) -- tweaked to signal start of file (to overwrite old files of the same name & prevent corrupted files)
:: 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)
:: filwrite -- organized & fat cutout (28 to 9 lines w/ exit condition, & new switch)
:: filwrite -- new switch to indicate to overwrite file of the same name or append to it.
:: ssw -- formating & notes used to keep human readable & allow Understanding of what is being used where
 
goto Start
:primevar
:: do not use Quote marks in mod or paths
set MOD=delbase
set BASEFOLDER=D:\Minecraft-aidfiles\recipes\
set STONEC=%BASEFOLDER%stone-cutter\
set TABLEC=%BASEFOLDER%table\
set CAMPC=%BASEFOLDER%campfire\
set FURNC=%BASEFOLDER%furnance\
set CCSSTONE=%CAMPC%sandstone\
set FCGLASS=%FURNC%glass\
set SCSTAIR=%STONEC%stair\
set SCWALL=%STONEC%wall\
set SCSLAB=%STONEC%slab\
set TCSTAIR=%TABLEC%stair\
set TCWALL=%TABLEC%wall\
set TCSLAB=%TABLEC%slab\
:: sandstone/sand value setting, do not touch
set SANDSTONE=no
set SAND=no
exit /b
 
:Start
call :primevar
if ["%~1"]==[""] goto End
set NAMES=%~1
if ["%~2"]==["sandstone"] set SANDSTONE=yes
if ["%~2"]==["sand"] set SAND=yes
goto Reciepe
 
:Reciepe
if %SAND%==yes (
    call :reciepewrite %NAMES%_sand sandy %NAMES%
    goto End
)
if %SANDSTONE%==yes (
    call :reciepewrite %NAMES%_sand_stone sandstone %NAMES%
    call :reciepewrite %NAMES%_cut_sand_stone off off
    call :reciepewrite %NAMES%_chiseled_sand_stone off off
    call :reciepewrite %NAMES%_smooth_sand_stone off off
    goto End
)
call :reciepewrite %NAMES% off off
:End
exit /b
 
:reciepewrite
set twmess=%1
set temptwmess=%3
set alt=%2
if ["%alt%"]==["sandstone"] (
    :: stonecutter swapping for sandstones
    call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_cut_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_cut_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_cut_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_chiseled_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_chiseled_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_smooth_sand_stone twist %temptwmess%_chiseled_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_sand_stone twist %temptwmess%_smooth_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_cut_sand_stone twist %temptwmess%_smooth_sand_stone
    call :stonecut "%STONEC%" %temptwmess%_chiseled_sand_stone twist %temptwmess%_smooth_sand_stone
    :: Table Crafting for the sandstones
    call :table "%TABLEC%" %temptwmess%_sand square %temptwmess%_sand_stone 4
    call :table "%TABLEC%" %temptwmess%_sand_stone square %temptwmess%_cut_sand_stone 4
    call :table "%TABLEC%" %temptwmess%_cut_sand_stone square %temptwmess%_chiseled_sand_stone 4
    :: Campe fire crafting for sand version to smoothstone
    call :campfire "%CCSSTONE%" %temptwmess%_sand 300 0.35 %temptwmess%_smooth_sand_stone
)
if ["%alt%"]==["sandy"] call :furn %FCGLASS% %temptwmess%_sand 200 0.1 %temptwmess%_glass
call :stonecut "%SCSTAIR%" %twmess% stair %twmess%_stair
call :stonecut "%SCWALL%" %twmess% wall %twmess%_wall
call :stonecut "%SCSLAB%" %twmess% slab %twmess%_slab
call :table "%TCSTAIR%" %twmess% stair %twmess%_stair 4
call :table "%TCWALL%" %twmess% wall %twmess%_wall 6
call :table "%TCSLAB%" %twmess% slab %twmess%_slab 6
exit /b
 
:stonecut
:: arguments(in number order) - Path / Name1 / Name2 / Type
call mcaidstoncut %1 %2 %4 %3 %MOD%
exit /b
 
:table
:: arguments(in number order) - Path / Name1 / Type / Name2 / Craft_Number
call mcaidtable %3 %5 %2 %4 %1 %MOD%
exit /b
 
:campfire
:: arguments(in number order) - Path / Name1 / Cook_time / Exp / Name2
call mcaidcfire %1 %3 %4 %2 %5 %MOD%
exit /b
 
:furn
:: arguments(in number order) - Path / Name1 / Cook_time / EXP / Name 2
call mcaidfurn %1 %3 %4 %2 %5 %MOD%
exit /b
 
::---
::mcaid.bat
@echo off
:: Version 3.0
:: Updated to MC 1.18.1 standardization
:: Put a reliance on a secondary file to minimize the amount 'echo'/'write' call locations
:: Split if Else statements that used a goto (does not work as intended inline with && )
:: Two locations using echo command (under assumption the file is there & accessible)
:: -- The = in the string w/o spaces used in Axis for Slabs & Pillars incorrectly passes forward
:: -- Overrides used sparingly
:: Slimmed down notes, cutting out redundant fixes
:: Version 2.5
:: Version 2.4
:: Version 2.2
:: version 2.1.5
:: version 2.1
:: version 2.0
:: includes fixed array calls, typos, slab loot table missing lines added (was missing 3)
:: Added command line entry of blocks.
:: creates JSON files for 'Blockstate', 'Block', 'item'(For block), & 'loot_table' 
:: 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)
:: textures not supplied, just named *wink* X}
:: Intended for mods w/ an ability register blocks (forge/etc)
:: Obviously  set environmental paths correctly, & Your ModID
:: ---
:: batfilename blockname [a/p/s] [n]
:: (stick to minecraft convention.. red_sand, polished_smooth_rock, etc. etc.)
:: a - block with 1 texture (sand)
:: p - pillar block (directional x, y, z positions)
:: s - block with 3 textures (like sandstone, top/side/bottom)
:: Only supports 1 base block at a time
:: 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)
:: ---
:: Simplification of json creation for block, stair, & slab variants.
:: Set for Blocks
:: Uses blockname_top, blockname_side, blockname_bottom for blocks with different textures
:: Uses blockname_top, blockname_side for pillar blocks. (texture)
 
goto Start
 
:RE2
if ["%3"]==[""] (
    goto End
) else ( 
    set T=%3
)
if %T%==n (goto Nextcycle)
if %T%==N (goto Nextcycle)
:End
exit /b
:Start
set MOD=delbase
set BASEFOLDER=D:\Minecraft-aidfiles\models\
set BLOCKS=%BASEFOLDER%blockstates\
set BLOCK=%BASEFOLDER%models\block\
set SLAB=%BLOCK%slab\
set STAIR=%BLOCK%stair\
set PILLA=%BLOCK%pillar\
set ITEM=%BASEFOLDER%models\item\
set DROP=%BASEFOLDER%loot_tables\blocks\
if NOT EXIST %BLOCKS% ( mkdir %BLOCKS% )
if NOT EXIST %SLAB% ( mkdir %SLAB% )
if NOT EXIST %STAIR% ( mkdir %STAIR% )
if NOT EXIST %PILLA% ( mkdir %PILLA% )
if NOT EXIST %ITEM% ( mkdir %ITEM% )
if NOT EXIST %DROP% ( mkdir %DROP% )
set FACE[0]=east
set FACE[1]=north
set FACE[2]=south
set FACE[3]=west
set HALF[0]=bottom
set HALF[1]=top
set SHAPE[0]=inner_left
set SHAPE[1]=inner_right
set SHAPE[2]=outer_left
set SHAPE[3]=outer_right
set SHAPE[4]=straight
 
if NOT ["%~1"]==[""]  (
    set NAM=%~1
    if NOT ["%~2"]==[""] (
        set ALLSIDED=%~2
        goto Aurgument
    )
)
:Nextcycle
set /p NAM= "Base Block Name: "
:Sid
echo Enter ( A ) if block uses the same texture on all sides
echo Enter ( S ) if it uses a Top, side, & bottom texture that are different
echo Enter ( P ) for Pillars.  Logs & Basalt are pillar blocks
echo Enter ( E ) to exit. 
echo Provides Basic loot table only. (It breaks, it drops.  nothing more)
set /p ALLSIDED= "Type of block: "
:Aurgument
if %ALLSIDED%==A ( goto Setallsided )
if %ALLSIDED%==a ( goto Setallsided )
if %ALLSIDED%==S ( goto Topped )
if %ALLSIDED%==s ( goto Topped )
if %ALLSIDED%==P ( goto Pillar )
if %ALLSIDED%==p ( goto Pillar )
if %ALLSIDED%==E ( goto End )
if %ALLSIDED%==e ( goto End )
echo "Valid Entries are ( A, a, S, s, E, e ), or Exit (E)"
goto Sid
:Setallsided
set ALLSIDED=ALL
goto Blockstate
:Pillar
set ALLSIDED=PILL
set AXIS=x
goto Blockstate
:Topped
set ALLSIDED=TOPP
:Blockstate
if %ALLSIDED%==ALL (
    set TopSide=%NAM%
    set SideSide=%NAM%
    set BotSide=%NAM%
)
if %ALLSIDED%==PILL ( 
    set TopSide=%NAM%_top
    set SideSide=%NAM%_side
    set BotSide=%NAM%_top
)
if %ALLSIDED%==TOPP (
    set TopSide=%NAM%_top
    set SideSide=%NAM%_side
    set BotSide=%NAM%_bottom
)
::Blockstates 
::Base Block
call filwrite "%BLOCKS%" "{" "%NAM%" "json" "new"
call filwrite "%BLOCKS%" "  "variants": {" "%NAM%" "json"
if %ALLSIDED%==PILL ( goto Blockstatepill )
call filwrite "%BLOCKS%" "    "": {" "%NAM%" "json"
call filwrite "%BLOCKS%" "      "model": "%MOD%:block/%NAM%"" "%NAM%" "json"
call filwrite "%BLOCKS%" "    }" "%NAM%" "json"
goto Axisout
:Blockstatepill
echo    "axis=%AXIS%": { >> %BLOCKS%%NAM%.json
if %AXIS%==y ( call filwrite "%BLOCKS%" "      "model": "%MOD%:block/pillar/%NAM%"" "%NAM%" "json") else ( call filwrite "%BLOCKS%" "      "model": "%MOD%:block/pillar/%NAM%"," "%NAM%" "json")
if %AXIS%==x ( call filwrite "%BLOCKS%" "      "x": 90," "%NAM%" "json")
if %AXIS%==z ( call filwrite "%BLOCKS%" "      "x": 90" "%NAM%" "json")
if %AXIS%==x ( call filwrite "%BLOCKS%" "      "y": 90" "%NAM%" "json")
if %AXIS%==z (
    call filwrite "%BLOCKS%" "    }" "%NAM%" "json"
    goto Axisout
) else (
    call filwrite "%BLOCKS%" "    }," "%NAM%" "json"
)
if %AXIS%==x ( set AXIS=y) else ( set AXIS=z)
goto Blockstatepill
:Axisout
call filwrite "%BLOCKS%" "  }" "%NAM%" "json"
call filwrite "%BLOCKS%" "}" "%NAM%" "json"
 
:: Slab version
call filwrite "%BLOCKS%" "{" "%NAM%_slab" "json" "new"
set AXIS=bottom
call filwrite "%BLOCKS%" "  "variants": {" "%NAM%_slab" "json"
:Slabvar
echo    "type=%AXIS%": { >> %BLOCKS%%NAM%_slab.json
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")
if %AXIS%==top (
    call filwrite "%BLOCKS%" "    }" "%NAM%_slab" "json"
    goto Slabout
) else (
    call filwrite "%BLOCKS%" "    }," "%NAM%_slab" "json"
)
if %AXIS%==bottom ( set AXIS=double) else ( set AXIS=top)
goto Slabvar
:Slabout
call filwrite "%BLOCKS%" "  }" "%NAM%_slab" "json"
call filwrite "%BLOCKS%" "}" "%NAM%_slab" "json"
 
:: Stair blocks
set /a OUTER=0
set /a MID=0
set /a INNER=0
call filwrite "%BLOCKS%" "{" "%NAM%_stair" "json" "new"
call filwrite "%BLOCKS%" "  "variants": {" "%NAM%_stair" "json"
goto Stairloop
 
:Stairloop
set /a YY=0
set uv=no
:: checking using Shape array
:: Inner Left
if %INNER% EQU 0 (
    if %MID% EQU 0 (
        if %OUTER% EQU 0 ( set /a YY=270 )
        if %OUTER% EQU 1 ( set /a YY=180 )
        if %OUTER% EQU 3 ( set /a YY=90 )
    ) else (
        if %OUTER% EQU 1 ( set /a YY=270 )
        if %OUTER% EQU 2 ( set /a YY=90 )
        if %OUTER% EQU 3 ( set /a YY=180 )
    )
)
::Inner Right
if %INNER% EQU 1 (
    if %MID% EQU 0 (
        if %OUTER% EQU 1 ( set /a YY=270 )
        if %OUTER% EQU 2 ( set /a YY=90 )
        if %OUTER% EQU 3 ( set /a YY=180 )
    ) else (
        if %OUTER% EQU 0 ( set /a YY=90 )
        if %OUTER% EQU 2 ( set /a YY=180 )
        if %OUTER% EQU 3 ( set /a YY=270 )
    )
)
::Outer Left
if %INNER% EQU 2 (
    if %MID% EQU 0 (
        if %OUTER% EQU 0 ( set /a YY=270 )
        if %OUTER% EQU 1 ( set /a YY=180 )
        if %OUTER% EQU 3 ( set /a YY=90 )
    ) else (
        if %OUTER% EQU 1 ( set /a YY=270 )
        if %OUTER% EQU 2 ( set /a YY=90 )
        if %OUTER% EQU 3 ( set /a YY=180 )
    )
)
::Outer Right
if %INNER% EQU 3 (
    if %MID% EQU 0 (
        if %OUTER% EQU 1 ( set /a YY=270 )
        if %OUTER% EQU 2 ( set /a YY=90 )
        if %OUTER% EQU 3 ( set /a YY=180 )
    ) else (
        if %OUTER% EQU 0 ( set /a YY=90 )
        if %OUTER% EQU 2 ( set /a YY=180 )
        if %OUTER% EQU 3 ( set /a YY=270 )
    )
)
if %INNER% EQU 4 (
    if %OUTER% EQU 1 ( set /a YY=270 )
    if %OUTER% EQU 2 ( set /a YY=90 )
    if %OUTER% EQU 3 ( set /a YY=180 )
)
:: Call Echo used to properly call the array value
echo    "facing=%%FACE[%OUTER%]%%,half=%%HALF[%MID%]%%,shape=%%SHAPE[%INNER%]%%": { >> %BLOCKS%%NAM%_stair.json
if %MID% EQU 1 ( set uv=yes)
if %YY% GTR 10 ( set uv=yes)
if %INNER% LSS 2 (
    if %uv%==yes ( set line=      "model": "%MOD%:block/stair/%NAM%_stair_inner",) else ( set line=      "model": "%MOD%:block/stair/%NAM%_stair_inner")
) else (
    if %INNER% LSS 4 (
        if %uv%==yes ( set line=      "model": "%MOD%:block/stair/%NAM%_stair_outer",) else ( set line=      "model": "%MOD%:block/stair/%NAM%_stair_outer")
    ) else ( 
        if %uv%==yes ( set line=      "model": "%MOD%:block/stair/%NAM%_stair",) else ( set line=      "model": "%MOD%:block/stair/%NAM%_stair")
    )
)
call filwrite "%BLOCKS%" "%line%" "%NAM%_stair" "json"
if %MID% EQU 1 ( call filwrite "%BLOCKS%" "      "x": 180," "%NAM%_stair" "json")
if %YY% GTR 10 ( call filwrite "%BLOCKS%" "      "y": %YY%," "%NAM%_stair" "json")
if %uv%==yes ( call filwrite "%BLOCKS%" "      "uvlock": true" "%NAM%_stair" "json")
set /a THREE=%OUTER% + %MID% + %INNER% 
if %THREE% EQU 8 (
    call filwrite "%BLOCKS%" "    }" "%NAM%_stair" "json"
    call filwrite "%BLOCKS%" "  }" "%NAM%_stair" "json"
    call filwrite "%BLOCKS%" "}" "%NAM%_stair" "json"
) else (
    call filwrite "%BLOCKS%" "    }," "%NAM%_stair" "json"
    echo     }, >> %BLOCKS%%NAM%_stair.json 
    if %INNER% LSS 4 ( 
        set /a INNER=%INNER% + 1 
    ) else (
        set /a INNER=0
        if %MID% EQU 0 ( 
            set /a MID=1 
        ) else (
            set /a MID=0
            if %OUTER% LSS 3 (
                set /a OUTER=%OUTER% + 1
            ) else (
                echo Failure in logic, this error shouldn't show up,
            )
        )
    )
    goto Stairloop
)
 
::Block models
:: Check for Pillar first
if %ALLSIDED%==PILL ( goto Pilstart ) else ( goto CubeStart )
set top
:Pilstart
call filwrite "%PILLA%" "{" "%NAM%" "json" "new"
call filwrite "%PILLA%" "  "parent": "minecraft:block/cube_column"," "%NAM%" "json"
call filwrite "%PILLA%" "  "textures": {" "%NAM%" "json"
call filwrite "%PILLA%" "    "end": "%MOD%:block/%TopSide%"," "%NAM%" "json"
call filwrite "%PILLA%" "    "side": "%MOD%:block/%SideSide%"" "%NAM%" "json"
call filwrite "%PILLA%" "  }" "%NAM%" "json"
call filwrite "%PILLA%" "}" "%NAM%" "json"
goto Slabstart
 
::Cubes
:CubeStart
call filwrite "%BLOCK%" "{" "%NAM%" "json" "new"
if %ALLSIDED%==ALL (
    call filwrite "%BLOCK%" "  "parent": "minecraft:block/cube_all"," "%NAM%" "json"
) else (
    call filwrite "%BLOCK%" "  "parent": "minecraft:block/cube_bottom_top"," "%NAM%" "json"
)
call filwrite "%BLOCK%" "   "textures": {" "%NAM%" "json"
if %ALLSIDED%==ALL (
    call filwrite "%BLOCK%" "     "all": "%MOD%:block/%NAM%"" "%NAM%" "json"
) else (
    call filwrite "%BLOCK%" "     "top": "%MOD%:block/%TopSide%"," "%NAM%" "json"
    call filwrite "%BLOCK%" "     "bottom": "%MOD%:block/%BotSide%"," "%NAM%" "json"
    call filwrite "%BLOCK%" "     "side": "%MOD%:block/%SideSide%"" "%NAM%" "json"
)
call filwrite "%BLOCK%" "  }" "%NAM%" "json"
call filwrite "%BLOCK%" "}" "%NAM%" "json"
 
::Slabs
:Slabstart
call :Slabfiles "{" "all" "new"
call filwrite "%SLAB%" "  "parent": "minecraft:block/slab"," "%NAM%_slab" "json"
if %ALLSIDED%==TOPP (
    call filwrite "%SLAB%" "  "parent": "minecraft:block/cube_bottom_top"," "%NAM%_slab_double" "json"
) else (
    call filwrite "%SLAB%" "  "parent": "minecraft:block/cube_column"," "%NAM%_slab_double" "json"
)
call filwrite "%SLAB%" "  "parent": "minecraft:block/slab_top"," "%NAM%_slab_top" "json"
call :Slabfiles "  "textures": {" all
if %ALLSIDED%==TOPP (
    call :Slabfiles "    "bottom": "%MOD%:block/%BotSide%"," all
    call :Slabfiles "    "top": "%MOD%:block/%TopSide%"," all
) else (
    call :Slabfiles "    "bottom": "%MOD%:block/%BotSide%","
    call :Slabfiles "    "top": "%MOD%:block/%TopSide%","
    call filwrite "%SLAB%" "    "end": "%MOD%:block/%TopSide%"," "%NAM%_slab_double" "json"
)
call :Slabfiles "    "side": "%MOD%:block/%SideSide%"" "all"
call :Slabfiles "  }" "all"
call :Slabfiles "}" "all"
goto Stairs
 
:Slabfiles
set Bark=%~1
if "%~3"=="new" (set SLFLAG="new") else (set SLFLAG="")
call filwrite "%SLAB%" "%Bark%" "%NAM%_slab" "json" %SLFLAG%
if "%~2"=="all" call filwrite "%SLAB%" "%Bark%" "%NAM%_slab_double" "json" %SLFLAG%
call filwrite "%SLAB%" "%Bark%" "%NAM%_slab_top" "json" %SLFLAG%
exit /b
 
:Stairs
set BOTT=%NAM%
set TTOPP=%NAM%
set TSIDE=%NAM%
 
call :Stairfiles { "new"
call :Stairfiles block
call :Stairfiles "  "textures": {"
call :Stairfiles "    "bottom": "%MOD%:block/%BotSide%","
call :Stairfiles "    "top": "%MOD%:block/%TopSide%","
call :Stairfiles "    "side": "%MOD%:block/%SideSide%""
call :Stairfiles "   }"
call :Stairfiles }
goto Bitem
:Stairfiles
set PARE=%~1
if "%~2"=="new" (set SFLAG="new") else (set SFLAG="")
if "%PARE%"=="block" (
    call filwrite "%STAIR%" "  "parent": "minecraft:block/stairs"," "%NAM%_stair" "json"
    call filwrite "%STAIR%" "  "parent": "minecraft:block/inner_stairs"," "%NAM%_stair_inner" "json"
    call filwrite "%STAIR%" "  "parent": "minecraft:block/outer_stairs"," "%NAM%_stair_outer" "json"
) else (
    call filwrite "%STAIR%" "%PARE%" "%NAM%_stair" "json" %SFLAG%
    call filwrite "%STAIR%" "%PARE%" "%NAM%_stair_inner" "json" %SFLAG%
    call filwrite "%STAIR%" "%PARE%" "%NAM%_stair_outer" "json" %SFLAG%
)
exit /b
 
:: Item versions of the blocks
:Bitem
call filwrite "%ITEM%" "{" "%NAM%" "json" "new"
call filwrite "%ITEM%" "{" "%NAM%_slab" "json" "new"
call filwrite "%ITEM%" "{" "%NAM%_stair" "json" "new"
if %ALLSIDED%==PILL (
    call filwrite "%ITEM%" "   "parent": "%MOD%:block/pillar/%NAM%"" "%NAM%" "json"
) else (
    call filwrite "%ITEM%" "   "parent":"%MOD%:block/%NAM%"" "%NAM%" "json"
)
call filwrite "%ITEM%" "  "parent": "%MOD%:block/slab/%NAM%_slab"" "%NAM%_slab" "json"
call filwrite "%ITEM%" "  "parent": "%MOD%:block/stair/%NAM%_stair"" "%NAM%_stair" "json"
call filwrite "%ITEM%" "}" "%NAM%" "json"
call filwrite "%ITEM%" "}" "%NAM%_slab" "json"
call filwrite "%ITEM%" "}" "%NAM%_stair" "json"
 
::blockloot
call normloot "%DROP%" "%MOD%:%NAM%" "%NAM%" "json" "norm"
call normloot "%DROP%" "%MOD%:%NAM%_stair" "%NAM%_stair" "json" "norm"
call normloot "%DROP%" "%MOD%:%NAM%_slab" "%NAM%_slab" "json" "slab"
goto RE2
 
::---
::mcaidcfire.bat
@echo off
if ["%1"]==[""] goto End
set oext=json
set temname=%4
set temnametwo=%5
set tpath=%~1
set ctime=%2
set exp=%3
set tmod=%6
call filwrite "%tpath%" { %temnametwo% %oext% new
call filwrite "%tpath%" "  "type": "minecraft:campfire_cooking"," %temnametwo% %oext%
call filwrite "%tpath%" "  "ingredient": {" %temnametwo% %oext%
call filwrite "%tpath%" "    "item": "%tmod%:%temname%"" %temnametwo% %oext%
call filwrite "%tpath%" "  }," %temnametwo% %oext%
call filwrite "%tpath%" "  "result": "%tmod%:%temnametwo%"," %temnametwo% %oext%
call filwrite "%tpath%" "  "experience": %exp%," %temnametwo% %oext%
call filwrite "%tpath%" "  "cookingtime": %ctime%" %temnametwo% %oext%
call filwrite "%tpath%" } %temnametwo% %oext%
echo file %tpath%%temnametwo%.%oext%
:End
exit /b
::----
::mcaidfurn.bat
@echo off
if ["%1"]==[""] goto End
set oext=json
set tpath=%~1
set ctime=%2
set exp=%3
set temnam=%4
set outnam=%5
set tmod=%6
call filwrite "%tpath%" { %outnam% %oext% new
call filwrite "%tpath%" "  "type": "minecraft:smelting"," %outnam% %oext%
call filwrite "%tpath%" "  "ingredient": {" %outnam% %oext%
call filwrite "%tpath%" "    "item": "%tmod%:%temnam%"" %outnam% %oext%
call filwrite "%tpath%" "  }," %outnam% %oext%
call filwrite "%tpath%" "  "result": "%tmod%:%outnam%"," %outnam% %oext%
call filwrite "%tpath%" "  "experience": %exp%," %outnam% %oext%
call filwrite "%tpath%" "  "cookingtime": %ctime%" %outnam% %oext%
call filwrite "%tpath%" } %outnam% %oext%
echo file %tpath%%outnam%.%oext%
:End
exit /b
 
::----
::mcaidstoncut.bat
@echo off
if ["%1"]==[""] goto End
set oext=json
set tpath=%~1
set tempora=%2
set temporatwo=%3
set temalt=%4
set tmod=%5
set fout=%temporatwo%_from_%tempora%
call filwrite "%tpath%" { %fout% %oext% new
call filwrite "%tpath%" "  "type": "minecraft:stonecutting"," %fout% %oext%
call filwrite "%tpath%" "  "ingredient": {" %fout% %oext%
call filwrite "%tpath%" "    "item": "%tmod%:%tempora%"" %fout% %oext%
call filwrite "%tpath%" "  }," %fout% %oext%
call filwrite "%tpath%" "  "result": "%tmod%:%temporatwo%"," %fout% %oext%
if %temalt%==slab ( call filwrite "%tpath%" "  "count": 2" %fout% %oext%) else call filwrite "%tpath%" "  "count": 1" %fout% %oext%
call filwrite "%tpath%" } %fout% %oext%
echo file %tpath%%fout%.%oext%
:End
exit /b
 
::----
::mcaidtable.bat
@echo off
if ["%1"]==[""] goto End
set oext=json
set patnum=%~1
set cntnum=%2
set tempora=%3
set temporatwo=%4
set tempath=%~5
set tmod=%6
call filwrite "%tempath%" { %temporatwo% %oext% new
call filwrite "%tempath%" "  "type": "minecraft:crafting_shaped"," %temporatwo% %oext%
:: echo used over call for patterns Consistency of use (double spaces in paterns broke arguments)
if ["%patnum%"]==["square"] echo   "pattern": [ "yy","yy" ], >> %tpath%%temporatwo%.%oext%
if ["%patnum%"]==["stair"] echo   "pattern": [ "y  ","yy ","yyy" ], >> %tpath%%temporatwo%.%oext%
if ["%patnum%"]==["wall"] echo   "pattern": [ "yyy","yyy" ], >> %tpath%%temporatwo%.%oext%
if ["%patnum%"]==["slab"] echo   "pattern": [ "yyy" ], >> %tpath%%temporatwo%.%oext%
call filwrite "%tempath%" "  "key": {" %temporatwo% %oext%
call filwrite "%tempath%" "    "y": {" %temporatwo% %oext%
call filwrite "%tempath%" "      "item": "%tmod%:%tempora%"" %temporatwo% %oext%
call filwrite "%tempath%" "    }" %temporatwo% %oext%
call filwrite "%tempath%" "  }," %temporatwo% %oext%
call filwrite "%tempath%" "  "result":{" %temporatwo% %oext%
call filwrite "%tempath%" "    "item": "%tmod%:%temporatwo%"," %temporatwo% %oext%
call filwrite "%tempath%" "    "count": %cntnum%" %temporatwo% %oext%
call filwrite "%tempath%" "  }" %temporatwo% %oext%
call filwrite "%tempath%" } %temporatwo% %oext%
echo file %tpath%%temporatwo%.%oext%
:End
exit /b
 
::-------
::normloot.bat
GOTO Start
:End
exit /b
:Start
set tpath=%~1
set titem=%2
set tfilou=%~3
set tfext=%~4
set ttype=%~5
 
call filwrite "%tpath%" "{" "%tfilou%" "%tfext%" "new"
call filwrite "%tpath%" "  "type": "minecraft:block"," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "  "pools": [" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "    {" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "      "rolls": 1.0," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "      "bonus_rolls": 0.0," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "      "entries": [" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "        {" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "          "type": "minecraft:item"," "%tfilou%" "%tfext%"
if ["%ttype%"]==["slab"] (
call filwrite "%tpath%" "          "functions": [" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "            {" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "              "function": "minecraft:set_count"," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "              "conditions": [" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "                {" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "                  "condition": "minecraft:block_state_property"," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "                  "block": %titem%," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "                  "properties": {" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "                    "type": "double"" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "                  }" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "                }" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "              ]," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "              "count": 2.0," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "              "add": false" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "            }," "%tfilou%" "%tfext%"
call :explosion_decay
call filwrite "%tpath%" "          ]," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "          "name": %titem%" "%tfilou%" "%tfext%"
GOTO fout
)
 
::Generic Loot_table -- Insert special ones above this
call filwrite "%tpath%" "          "name": %titem%" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "        }" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "      ]," "%tfilou%" "%tfext%"
call filwrite "%tpath%" "      "conditions": [" "%tfilou%" "%tfext%"
call :explosion_decay
call filwrite "%tpath%" "      ]" "%tfilou%" "%tfext%"
:fout
call filwrite "%tpath%" "    }" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "  ]" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "}" "%tfilou%" "%tfext%"
GOTO End
:explosion_decay
call filwrite "%tpath%" "        {" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "          "condition": "minecraft:survives_explosion"" "%tfilou%" "%tfext%"
call filwrite "%tpath%" "        }" "%tfilou%" "%tfext%"
exit /b

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎