Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Version 2.5.1
- :: Corrected Loot Table for Stairs [left out _stair on the item]
- :: Version 2.5
- :: Corrected name standardization for double slab from pillars & all sided blocks.
- :: Version 2.4
- :: Fixed Sided blocks doublesided slab verions
- :: Addressed slab method.
- :: Version 2.2
- :: Logic oversites
- :: Fixed names & Name variables
- :: version 2.1.5
- :: Logic Improvments
- :: version 2.1
- :: fixed slab name schema failure
- :: fixed 2nd axis variable name error.
- :: tested, forge ready w/ some attention to texture location/names
- :: version 2.0
- :: includes fixed array calls, typos, slab loot table missing lines added (was missing 3)
- :: Added command line entry of blocks.
- :: Manual loot table for other blocks still may be needed.
- :: 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 enviromental paths correctly, & Your ModID
- :: ---
- :: batfilename blockname [a/p/s] [n]
- :: (stick to minecraft convenction.. red_sand, polished_smooth_rock, etc. etc.)
- :: a - block with 1 texture (sand)
- :: p - pillar block
- :: 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=vanilla_reclaim
- set BASEFOLDER=F:\Minecraft-aidfiles\
- 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
- echo { > %BLOCKS%%NAM%.json
- echo "variants": { >> %BLOCKS%%NAM%.json
- if %ALLSIDED%==PILL ( goto Blockstatepill )
- echo "": { >> %BLOCKS%%NAM%.json
- echo "model": "%MOD%:block/%NAM%" >> %BLOCKS%%NAM%.json
- echo } >> %BLOCKS%%NAM%.json
- goto Axisout
- :Blockstatepill
- echo "axis=%AXIS%": { >> %BLOCKS%%NAM%.json
- if %AXIS%==y ( echo "model": "%MOD%:block/pillar/%NAM%" >> %BLOCKS%%NAM%.json ) else ( echo "model": "%MOD%:block/pillar/%NAM%", >> %BLOCKS%%NAM%.json )
- if %AXIS%==x ( echo "x": 90, >> %BLOCKS%%NAM%.json )
- if %AXIS%==z ( echo "x": 90 >> %BLOCKS%%NAM%.json )
- if %AXIS%==x ( echo "y": 90 >> %BLOCKS%%NAM%.json )
- if %AXIS%==z ( echo } >> %BLOCKS%%NAM%.json && goto Axisout ) else ( echo }, >> %BLOCKS%%NAM%.json )
- if %AXIS%==x ( set AXIS=y) else ( set AXIS=z)
- goto Blockstatepill
- :Axisout
- echo } >> %BLOCKS%%NAM%.json
- echo } >> %BLOCKS%%NAM%.json
- :: Slab version
- echo { > %BLOCKS%%NAM%_slab.json
- set AXIS=bottom
- echo "variants": { >> %BLOCKS%%NAM%_slab.json
- :Slabvar
- echo "type=%AXIS%": { >> %BLOCKS%%NAM%_slab.json
- if %AXIS%==bottom ( echo "model": "%MOD%:block/slab/%NAM%_slab" >> %BLOCKS%%NAM%_slab.json ) else ( echo "model": "%MOD%:block/slab/%NAM%_slab_%AXIS%" >> %BLOCKS%%NAM%_slab.json )
- if %AXIS%==top ( echo } >> %BLOCKS%%NAM%_slab.json && goto Slabout ) else ( echo }, >> %BLOCKS%%NAM%_slab.json )
- if %AXIS%==bottom ( set AXIS=double) else ( set AXIS=top)
- goto Slabvar
- :Slabout
- echo } >> %BLOCKS%%NAM%_slab.json
- echo } >> %BLOCKS%%NAM%_slab.json
- :: Stair blocks
- set /a OUTER=0
- set /a MID=0
- set /a INNER=0
- echo { > %BLOCKS%%NAM%_stair.json
- echo "variants": { >> %BLOCKS%%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
- call 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")
- )
- )
- echo %line% >> %BLOCKS%%NAM%_stair.json
- if %MID% EQU 1 ( echo "x": 180, >> %BLOCKS%%NAM%_stair.json )
- if %YY% GTR 10 ( echo "y": %YY%, >> %BLOCKS%%NAM%_stair.json )
- if %uv%==yes ( echo "uvlock": true >> %BLOCKS%%NAM%_stair.json )
- set /a THREE=%OUTER% + %MID% + %INNER%
- if %THREE% EQU 8 (
- echo } >> %BLOCKS%%NAM%_stair.json
- echo } >> %BLOCKS%%NAM%_stair.json
- echo } >> %BLOCKS%%NAM%_stair.json
- ) else (
- 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
- echo { > %PILLA%%NAM%.json
- echo "parent": "minecraft:block/cube_column", >> %PILLA%%NAM%.json
- echo "textures": { >> %PILLA%%NAM%.json
- echo "end": "%MOD%:block/%TopSide%", >> %PILLA%%NAM%.json
- echo "side": "%MOD%:block/%SideSide%" >> %PILLA%%NAM%.json
- echo } >> %PILLA%%NAM%.json
- echo } >> %PILLA%%NAM%.json
- goto Slabstart
- ::Cubes
- :CubeStart
- echo { > %BLOCK%%NAM%.json
- if %ALLSIDED%==ALL ( echo "parent": "minecraft:block/cube_all", >> %BLOCK%%NAM%.json ) else ( echo "parent": "minecraft:block/cube_bottom_top", >> %BLOCK%%NAM%.json )
- echo "textures": { >> %BLOCK%%NAM%.json
- if %ALLSIDED%==ALL (
- echo "all": "%MOD%:block/%NAM%" >> %BLOCK%%NAM%.json
- ) else (
- echo "top": "%MOD%:block/%TopSide%", >> %BLOCK%%NAM%.json
- echo "bottom": "%MOD%:block/%BotSide%", >> %BLOCK%%NAM%.json
- echo "side": "%MOD%:block/%SideSide%" >> %BLOCK%%NAM%.json
- )
- echo } >> %BLOCK%%NAM%.json
- echo } >> %BLOCK%%NAM%.json
- ::Slabs
- :Slabstart
- echo { > %SLAB%%NAM%_slab.json
- echo { > %SLAB%%NAM%_slab_double.json
- echo { > %SLAB%%NAM%_slab_top.json
- echo "parent": "minecraft:block/slab", >> %SLAB%%NAM%_slab.json
- if %ALLSIDED%==TOPP ( echo "parent": "minecraft:block/cube_bottom_top", >> %SLAB%%NAM%_slab_double.json) else ( echo "parent": "minecraft:block/cube_column", >> %SLAB%%NAM%_slab_double.json)
- echo "parent": "minecraft:block/slab_top", >> %SLAB%%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%","
- echo "end": "%MOD%:block/%TopSide%", >> %SLAB%%NAM%_slab_double.json
- )
- call :Slabfiles " "side": "%MOD%:block/%SideSide%"" all
- call :Slabfiles " }" all
- call :Slabfiles } all
- goto Stairs
- :Slabfiles
- set Bark=%~1
- echo %Bark% >> %SLAB%%NAM%_slab.json
- if "%~2"=="all" echo %Bark% >> %SLAB%%NAM%_slab_double.json
- echo %Bark% >> %SLAB%%NAM%_slab_top.json
- exit /b
- :Stairs
- set BOTT=%NAM%
- set TTOPP=%NAM%
- set TSIDE=%NAM%
- echo { > %STAIR%%NAM%_stair.json
- echo { > %STAIR%%NAM%_stair_inner.json
- echo { > %STAIR%%NAM%_stair_outer.json
- 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 "%PARE%"=="block" (
- echo "parent": "minecraft:block/stairs", >> %STAIR%%NAM%_stair.json
- echo "parent": "minecraft:block/inner_stairs", >> %STAIR%%NAM%_stair_inner.json
- echo "parent": "minecraft:block/outer_stairs", >> %STAIR%%NAM%_stair_outer.json
- ) else (
- echo %PARE% >> %STAIR%%NAM%_stair.json
- echo %PARE% >> %STAIR%%NAM%_stair_inner.json
- echo %PARE% >> %STAIR%%NAM%_stair_outer.json
- )
- exit /b
- :: Item versions of the blocks
- :Bitem
- echo { > %ITEM%%NAM%.json
- if %ALLSIDED%==PILL (
- echo "parent": "%MOD%:block/pillar/%NAM%" >> %ITEM%%NAM%.json
- ) else (
- echo "parent":"%MOD%:block/%NAM%" >> %ITEM%%NAM%.json
- )
- echo } >> %ITEM%%NAM%.json
- ::Slabitem
- echo { > %ITEM%%NAM%_slab.json
- echo "parent": "%MOD%:block/slab/%NAM%_slab" >> %ITEM%%NAM%_slab.json
- echo } >> %ITEM%%NAM%_slab.json
- ::Stairitem
- echo { > %ITEM%%NAM%_stair.json
- echo "parent": "%MOD%:block/stair/%NAM%_stair" >> %ITEM%%NAM%_stair.json
- echo } >> %ITEM%%NAM%_stair.json
- ::blockloot
- echo { > %DROP%%NAM%.json
- echo { > %DROP%%NAM%_stair.json
- echo "type": "minecraft:block", >> %DROP%%NAM%.json
- echo "type": "minecraft:block", >> %DROP%%NAM%_stair.json
- echo "name": "%MOD%:%NAM%" >> %DROP%%NAM%.json
- echo "name": "%MOD%:%NAM%_stair" >> %DROP%%NAM%_stair.json
- echo } >> %DROP%%NAM%.json
- echo } >> %DROP%%NAM%_stair.json
- echo { > %DROP%%NAM%_slab.json
- call :Slabloot " "type": "minecraft:block","
- call :Slabloot " "pools": ["
- call :Slabloot " {"
- call :Slabloot " "rolls":1,"
- call :Slabloot " "entries": ["
- call :Slabloot " {"
- call :Slabloot " "type": "minecraft:item","
- call :Slabloot " "functions": ["
- call :Slabloot " {"
- call :Slabloot " "function": "minecraft:set_count","
- call :Slabloot " "conditions": ["
- call :Slabloot " {"
- call :Slabloot " "condition": "minecraft:block_state_property","
- call :Slabloot " "block": "%MOD%:%NAM%_slab","
- call :Slabloot " "properties": {"
- call :Slabloot " "type": "double""
- call :Slabloot " }"
- call :Slabloot " }"
- call :Slabloot " ],"
- call :Slabloot " "count": 2"
- call :Slabloot " },"
- call :Slabloot " {"
- call :Slabloot " "function": "minecraft:explosion_decay""
- call :Slabloot " }"
- call :Slabloot " ],"
- call :Slabloot " "name": "%MOD%:%NAM%_slab""
- call :Slabloot " }"
- call :Slabloot " ]"
- call :Slabloot " }"
- call :Slabloot " ]"
- call :Slabloot }
- goto RE2
- :Slabloot
- echo %~1 >> %DROP%%NAM%_slab.json
- exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement