diff --git a/.gitignore b/.gitignore index 894a44c..bd7eb45 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,4 @@ venv.bak/ # mypy .mypy_cache/ +/.vscode/launch.json diff --git a/Dockerfile b/Dockerfile index 3f3df1c..65202c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ -FROM python:3-alpine +FROM python:alpine3.12 -RUN apk --no-cache add git mesa-osmesa mesa-gles gcc gfortran python-dev build-base wget freetype-dev fontconfig-dev libpng-dev libjpeg-turbo-dev openblas-dev && pip install numpy vispy Pillow +RUN apk --no-cache add git py3-pip mesa-osmesa mesa-gles gcc gfortran python3-dev build-base wget freetype-dev fontconfig-dev libpng-dev libjpeg-turbo-dev openblas-dev +RUN pip3 install -U scikit-build make +RUN pip3 install numpy==1.17.5 +RUN pip3 install Pillow==6.2.2 +RUN pip3 install vispy==0.5.3 COPY . /blockcrafter RUN cd /blockcrafter && pip wheel . @@ -18,4 +22,7 @@ COPY entrypoint.sh / ENV VISPY_GL_LIB /usr/lib/libGLESv2.so.2 ENV OSMESA_LIBRARY /usr/lib/libOSMesa.so.8 +# If this line starts failing, hopefully that means the dependency was fixed. That should be your cue to remove this line +RUN sed -i 's/from fractions import gcd/from math import gcd/' /usr/local/lib/python3.9/site-packages/vispy/geometry/torusknot.py + ENTRYPOINT ["/entrypoint.sh"] diff --git a/blockcrafter/blockstates.properties b/blockcrafter/blockstates.properties index cf8dabf..b264aa5 100644 --- a/blockcrafter/blockstates.properties +++ b/blockcrafter/blockstates.properties @@ -8,13 +8,14 @@ minecraft:jungle_leaves biome_type=simple,biome_colors=foliage,biome_colormap=fo minecraft:oak_leaves biome_type=simple,biome_colors=foliage,biome_colormap=foliage minecraft:birch_leaves biome_type=simple,biome_colors=foliage_flipped,biome_colormap=foliage_flipped minecraft:acacia_leaves biome_type=simple,biome_colors=foliage,biome_colormap=foliage -minecraft:vine biome_type=simple,biome_colors=grass,biome_colormap=grass +minecraft:vine biome_type=simple,biome_colors=grass,biome_colormap=grass,default_variant=east:false;north:false;south:false;west:false;up:false minecraft:lily_pad* biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:grass biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:tall_grass biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:fern biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:large_fern biome_type=simple,biome_colors=grass,biome_colormap=grass -minecraft:*_stem biome_type=simple,biome_colors=grass,biome_colormap=grass +minecraft:*melon_stem biome_type=simple,biome_colors=grass,biome_colormap=grass +minecraft:*pumpkin_stem biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:redstone_wire biome_type=simple,biome_colors=grass,biome_colormap=#ff0000c0|#ff0000c0|#ff0000c0 minecraft:seagrass is_waterloggable=true,inherently_waterlogged=true @@ -23,128 +24,67 @@ minecraft:kelp is_waterloggable=true,inherently_waterlogged=true minecraft:kelp_plant is_waterloggable=true,inherently_waterlogged=true minecraft:bubble_column is_waterloggable=true,inherently_waterlogged=true -#minecraft:glass_pane is_waterloggable=true -#minecraft:white_stained_glass_pane is_waterloggable=true -#minecraft:orange_stained_glass_pane is_waterloggable=true -#minecraft:magenta_stained_glass_pane is_waterloggable=true -#minecraft:light_blue_stained_glass_pane is_waterloggable=true -#minecraft:yellow_stained_glass_pane is_waterloggable=true -#minecraft:lime_stained_glass_pane is_waterloggable=true -#minecraft:pink_stained_glass_pane is_waterloggable=true -#minecraft:gray_stained_glass_pane is_waterloggable=true -#minecraft:light_gray_stained_glass_pane is_waterloggable=true -#minecraft:cyan_stained_glass_pane is_waterloggable=true -#minecraft:purple_stained_glass_pane is_waterloggable=true -#minecraft:blue_stained_glass_pane is_waterloggable=true -#minecraft:brown_stained_glass_pane is_waterloggable=true -#minecraft:green_stained_glass_pane is_waterloggable=true -#minecraft:red_stained_glass_pane is_waterloggable=true -#minecraft:black_stained_glass_pane is_waterloggable=true minecraft:*glass_pane is_waterloggable=true +minecraft:*_stained_glass partial=true -#minecraft:acacia_fence is_waterloggable=true -#minecraft:acacia_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:acacia_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:acacia_trapdoor is_waterloggable=true -#minecraft:birch_fence is_waterloggable=true -#minecraft:birch_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:birch_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:birch_trapdoor is_waterloggable=true -#minecraft:dark_oak_fence is_waterloggable=true -#minecraft:dark_oak_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dark_oak_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dark_oak_trapdoor is_waterloggable=true -#minecraft:jungle_fence is_waterloggable=true -#minecraft:jungle_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:jungle_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:jungle_trapdoor is_waterloggable=true -#minecraft:oak_fence is_waterloggable=true -#minecraft:oak_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:oak_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:oak_trapdoor is_waterloggable=true -#minecraft:spruce_fence is_waterloggable=true -#minecraft:spruce_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:spruce_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:spruce_trapdoor is_waterloggable=true -minecraft:*_fence is_waterloggable=true +minecraft:*_fence is_waterloggable=true,default_variant=east:false;north:false;south:false;west:false minecraft:*_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true minecraft:*_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true minecraft:*_trapdoor is_waterloggable=true -#minecraft:brick_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:brick_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:cobblestone_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:cobblestone_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dark_prismarine_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dark_prismarine_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:nether_brick_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:nether_brick_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:purpur_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:purpur_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:red_sandstone_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:red_sandstone_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:sandstone_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:sandstone_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:stone_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:stone_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:stone_brick_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:stone_brick_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dead_brain_coral is_waterloggable=true -#minecraft:dead_brain_coral_fan is_waterloggable=true -#minecraft:dead_bubble_coral is_waterloggable=true -#minecraft:dead_bubble_coral_fan is_waterloggable=true -#minecraft:dead_fire_coral is_waterloggable=true -#minecraft:dead_fire_coral_fan is_waterloggable=true -#minecraft:dead_horn_coral is_waterloggable=true -#minecraft:dead_horn_coral_fan is_waterloggable=true -#minecraft:dead_tube_coral is_waterloggable=true -#minecraft:dead_tube_coral_fan is_waterloggable=true -#minecraft:brain_coral is_waterloggable=true -#minecraft:brain_coral_fan is_waterloggable=true -#minecraft:bubble_coral is_waterloggable=true -#minecraft:bubble_coral_fan is_waterloggable=true -#minecraft:fire_coral is_waterloggable=true -#minecraft:fire_coral_fan is_waterloggable=true -#minecraft:horn_coral is_waterloggable=true -#minecraft:horn_coral_fan is_waterloggable=true -#minecraft:tube_coral is_waterloggable=true -#minecraft:tube_coral_fan is_waterloggable=true minecraft:*_coral is_waterloggable=true minecraft:*_coral_fan is_waterloggable=true +minecraft:*_coral_wall_fan is_waterloggable=true -#minecraft:chest is_waterloggable=true -#minecraft:ender_chest is_waterloggable=true -#minecraft:trapped_chest is_waterloggable=true minecraft:*chest is_waterloggable=true minecraft:*sign is_waterloggable=true minecraft:*shulker_box is_waterloggable=true minecraft:iron_bars is_waterloggable=true +minecraft:chain is_waterloggable=true minecraft:iron_trapdoor is_waterloggable=true minecraft:ladder is_waterloggable=true -minecraft:cobblestone_wall is_waterloggable=true -minecraft:mossy_cobblestone_wall is_waterloggable=true -minecraft:nether_brick_fence is_waterloggable=true +minecraft:*_wall is_waterloggable=true,default_variant=east:none;north:none;south:none;west:none;up:false minecraft:sea_pickle is_waterloggable=true -minecraft:conduit is_waterloggable=true +minecraft:conduit is_waterloggable=true,disable_culling=true minecraft:farmland faulty_lighting=true minecraft:anvil faulty_lighting=true -minecraft:grass_path faulty_lighting=true +minecraft:dirt_path faulty_lighting=true minecraft:cocoa faulty_lighting=true minecraft:dragon_egg faulty_lighting=true minecraft:snow lighting_type=smooth_bottom -minecraft:grass_path lighting_type=smooth,shadow_edges=1 +minecraft:dirt_path lighting_type=smooth,shadow_edges=1 minecraft:water lighting_type=smooth,biome_type=simple,biome_colors=water minecraft:flowing_water lighting_type=smooth,biome_type=simple,biome_colors=water -minecraft:full_water lighting_type=smooth,biome_type=simple,biome_colors=water +minecraft:full_water lighting_type=smooth,biome_type=simple,biome_colors=water,default_variant=south:true;west:true minecraft:waterlog lighting_type=smooth,biome_type=simple,biome_colors=water,shadow_edges=1 -minecraft:snow shadow_edges=1 -minecraft:*_leaves shadow_edges=5 +minecraft:water_cauldron lighting_type=smooth,biome_type=simple,biome_colors=water,shadow_edges=1 + +minecraft:sculk_sensor is_waterloggable=true +minecraft:*candle is_waterloggable=true +minecraft:*amethyst_bud is_waterloggable=true +minecraft:amethyst_cluster is_waterloggable=true +minecraft:*_dripstone is_waterloggable=true +minecraft:*rail is_waterloggable=true +minecraft:*campfire is_waterloggable=true +minecraft:scaffolding is_waterloggable=true +minecraft:*lantern is_waterloggable=true +minecraft:glow_lichen is_waterloggable=true,default_variant=east:false;north:false;south:false;west:false;up:false;down:false +minecraft:*grimstone* is_waterloggable=true +minecraft:*blackstone* is_waterloggable=true +minecraft:*_dripleaf* is_waterloggable=true +minecraft:lightning_rod is_waterloggable=true + +minecraft:ice partial=true +minecraft:honey_block partial=true +minecraft:snow shadow_edges=1,partial=true +# minecraft:*_leaves* shadow_edges=5,partial=true +minecraft:*_leaves* shadow_edges=5 minecraft:full_water shadow_edges=1 minecraft:water shadow_edges=1 minecraft:*_slab shadow_edges=1 diff --git a/blockcrafter/custom_assets/minecraft/blockstates/acacia_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/acacia_sign.json new file mode 100644 index 0000000..b5f0617 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/acacia_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/acacia_sign", "y": 0 }, + "rotation=1": { "model": "block/acacia_sign", "y": 22.5 }, + "rotation=2": { "model": "block/acacia_sign", "y": 45 }, + "rotation=3": { "model": "block/acacia_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/acacia_sign", "y": 90 }, + "rotation=5": { "model": "block/acacia_sign", "y": 112.5 }, + "rotation=6": { "model": "block/acacia_sign", "y": 135}, + "rotation=7": { "model": "block/acacia_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/acacia_sign", "y": 180 }, + "rotation=9": { "model": "block/acacia_sign", "y": 202.5 }, + "rotation=10": { "model": "block/acacia_sign", "y": 225 }, + "rotation=11": { "model": "block/acacia_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/acacia_sign", "y": 270 }, + "rotation=13": { "model": "block/acacia_sign", "y": 292.5 }, + "rotation=14": { "model": "block/acacia_sign", "y": 315 }, + "rotation=15": { "model": "block/acacia_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/acacia_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/acacia_wall_sign.json new file mode 100644 index 0000000..feb2ed4 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/acacia_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/acacia_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/acacia_wall_sign", "y": 0 }, + "facing=east": { "model": "block/acacia_wall_sign", "y": 270 }, + "facing=west": { "model": "block/acacia_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/bamboo.json b/blockcrafter/custom_assets/minecraft/blockstates/bamboo.json new file mode 100644 index 0000000..59e7e52 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/bamboo.json @@ -0,0 +1,26 @@ +{ + "multipart": [ + { "when": { "leaves": "none", "age": "0" }, + "apply": [ + { "model": "block/bamboo1_age0" }, + { "model": "block/bamboo2_age0" }, + { "model": "block/bamboo3_age0" }, + { "model": "block/bamboo4_age0" } + ] + }, + { "when": { "leaves": "none", "age": "1" }, + "apply": [ + { "model": "block/bamboo1_age1" }, + { "model": "block/bamboo2_age1" }, + { "model": "block/bamboo3_age1" }, + { "model": "block/bamboo4_age1" } + ] + }, + { "when": { "leaves": "small" }, + "apply": { "model": "block/bamboo_small_leaves" } + }, + { "when": { "leaves": "large" }, + "apply": { "model": "block/bamboo_large_leaves" } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/bell.json b/blockcrafter/custom_assets/minecraft/blockstates/bell.json new file mode 100644 index 0000000..2131c24 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/bell.json @@ -0,0 +1,24 @@ +{ + "variants": { + "facing=north,attachment=floor": { "model": "block/bell_floor" }, + "facing=south,attachment=floor": { "model": "block/bell_floor", "y": 180 }, + "facing=east,attachment=floor": { "model": "block/bell_floor", "y": 90 }, + "facing=west,attachment=floor": { "model": "block/bell_floor", "y": 270 }, + "facing=north,attachment=ceiling": { "model": "block/bell_ceiling" }, + "facing=south,attachment=ceiling": { "model": "block/bell_ceiling", "y": 180 }, + "facing=east,attachment=ceiling": { "model": "block/bell_ceiling", "y": 90 }, + "facing=west,attachment=ceiling": { "model": "block/bell_ceiling", "y": 270 }, + "facing=east,attachment=single_wall": { "model": "block/bell_wall" }, + "facing=west,attachment=single_wall": { "model": "block/bell_wall", "y": 180 }, + "facing=south,attachment=single_wall": { "model": "block/bell_wall", "y": 90 }, + "facing=north,attachment=single_wall": { "model": "block/bell_wall", "y": 270 }, + "facing=east,attachment=double_wall": { "model": "block/bell_between_walls" }, + "facing=west,attachment=double_wall": { "model": "block/bell_between_walls", "y": 180 }, + "facing=north,attachment=double_wall": { "model": "block/bell_between_walls", "y": 90 }, + "facing=south,attachment=double_wall": { "model": "block/bell_between_walls", "y": 270 }, + "facing=north" : { "model" : "block/simple_bell", "y": 180 }, + "facing=south" : { "model" : "block/simple_bell", "y": 0 }, + "facing=east" : { "model" : "block/simple_bell", "y": 270 }, + "facing=west" : { "model" : "block/simple_bell", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/birch_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/birch_sign.json new file mode 100644 index 0000000..7f243fd --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/birch_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/birch_sign", "y": 0 }, + "rotation=1": { "model": "block/birch_sign", "y": 22.5 }, + "rotation=2": { "model": "block/birch_sign", "y": 45 }, + "rotation=3": { "model": "block/birch_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/birch_sign", "y": 90 }, + "rotation=5": { "model": "block/birch_sign", "y": 112.5 }, + "rotation=6": { "model": "block/birch_sign", "y": 135}, + "rotation=7": { "model": "block/birch_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/birch_sign", "y": 180 }, + "rotation=9": { "model": "block/birch_sign", "y": 202.5 }, + "rotation=10": { "model": "block/birch_sign", "y": 225 }, + "rotation=11": { "model": "block/birch_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/birch_sign", "y": 270 }, + "rotation=13": { "model": "block/birch_sign", "y": 292.5 }, + "rotation=14": { "model": "block/birch_sign", "y": 315 }, + "rotation=15": { "model": "block/birch_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/birch_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/birch_wall_sign.json new file mode 100644 index 0000000..eb6ed4c --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/birch_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/birch_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/birch_wall_sign", "y": 0 }, + "facing=east": { "model": "block/birch_wall_sign", "y": 270 }, + "facing=west": { "model": "block/birch_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/composter.json b/blockcrafter/custom_assets/minecraft/blockstates/composter.json new file mode 100644 index 0000000..82152ba --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/composter.json @@ -0,0 +1,31 @@ +{ + "multipart": [ + { "apply": { "model": "block/composter" }}, + { "when": { "level": "0" } + }, + { "when": { "level": "1" }, + "apply": { "model": "block/composter_contents1" } + }, + { "when": { "level": "2" }, + "apply": { "model": "block/composter_contents2" } + }, + { "when": { "level": "3" }, + "apply": { "model": "block/composter_contents3" } + }, + { "when": { "level": "4" }, + "apply": { "model": "block/composter_contents4" } + }, + { "when": { "level": "5" }, + "apply": { "model": "block/composter_contents5" } + }, + { "when": { "level": "6" }, + "apply": { "model": "block/composter_contents6" } + }, + { "when": { "level": "7" }, + "apply": { "model": "block/composter_contents7" } + }, + { "when": { "level": "8" }, + "apply": { "model": "block/composter_contents_ready" } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/conduit.json b/blockcrafter/custom_assets/minecraft/blockstates/conduit.json new file mode 100644 index 0000000..1dae143 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/conduit.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "block/conduit" } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/crimson_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/crimson_sign.json new file mode 100644 index 0000000..3f295e0 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/crimson_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/crimson_sign", "y": 0 }, + "rotation=1": { "model": "block/crimson_sign", "y": 22.5 }, + "rotation=2": { "model": "block/crimson_sign", "y": 45 }, + "rotation=3": { "model": "block/crimson_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/crimson_sign", "y": 90 }, + "rotation=5": { "model": "block/crimson_sign", "y": 112.5 }, + "rotation=6": { "model": "block/crimson_sign", "y": 135}, + "rotation=7": { "model": "block/crimson_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/crimson_sign", "y": 180 }, + "rotation=9": { "model": "block/crimson_sign", "y": 202.5 }, + "rotation=10": { "model": "block/crimson_sign", "y": 225 }, + "rotation=11": { "model": "block/crimson_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/crimson_sign", "y": 270 }, + "rotation=13": { "model": "block/crimson_sign", "y": 292.5 }, + "rotation=14": { "model": "block/crimson_sign", "y": 315 }, + "rotation=15": { "model": "block/crimson_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/crimson_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/crimson_wall_sign.json new file mode 100644 index 0000000..f5b20f5 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/crimson_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/crimson_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/crimson_wall_sign", "y": 0 }, + "facing=east": { "model": "block/crimson_wall_sign", "y": 270 }, + "facing=west": { "model": "block/crimson_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_sign.json new file mode 100644 index 0000000..058913c --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/dark_oak_sign", "y": 0 }, + "rotation=1": { "model": "block/dark_oak_sign", "y": 22.5 }, + "rotation=2": { "model": "block/dark_oak_sign", "y": 45 }, + "rotation=3": { "model": "block/dark_oak_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/dark_oak_sign", "y": 90 }, + "rotation=5": { "model": "block/dark_oak_sign", "y": 112.5 }, + "rotation=6": { "model": "block/dark_oak_sign", "y": 135}, + "rotation=7": { "model": "block/dark_oak_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/dark_oak_sign", "y": 180 }, + "rotation=9": { "model": "block/dark_oak_sign", "y": 202.5 }, + "rotation=10": { "model": "block/dark_oak_sign", "y": 225 }, + "rotation=11": { "model": "block/dark_oak_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/dark_oak_sign", "y": 270 }, + "rotation=13": { "model": "block/dark_oak_sign", "y": 292.5 }, + "rotation=14": { "model": "block/dark_oak_sign", "y": 315 }, + "rotation=15": { "model": "block/dark_oak_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_wall_sign.json new file mode 100644 index 0000000..b97f012 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/dark_oak_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/dark_oak_wall_sign", "y": 0 }, + "facing=east": { "model": "block/dark_oak_wall_sign", "y": 270 }, + "facing=west": { "model": "block/dark_oak_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/full_water.json b/blockcrafter/custom_assets/minecraft/blockstates/full_water.json index c854ad6..d0cbaf6 100644 --- a/blockcrafter/custom_assets/minecraft/blockstates/full_water.json +++ b/blockcrafter/custom_assets/minecraft/blockstates/full_water.json @@ -4,13 +4,33 @@ "apply" : { "model" : "block/full_water_up" }, "when" : { "up" : "false" } }, + { + "apply" : { "model" : "block/full_water_south_up" }, + "when": { + "up": "false", + "south": "false" + } + }, { "apply" : { "model" : "block/full_water_south" }, - "when" : { "south" : "false" } + "when": { + "up": "true", + "south": "false" + } + }, + { + "apply" : { "model" : "block/full_water_west_up" }, + "when": { + "up": "false", + "west": "false" + } }, { "apply" : { "model" : "block/full_water_west" }, - "when" : { "west" : "false" } + "when": { + "up": "true", + "west": "false" + } } ] } diff --git a/blockcrafter/custom_assets/minecraft/blockstates/jungle_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/jungle_sign.json new file mode 100644 index 0000000..8e91f45 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/jungle_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/jungle_sign", "y": 0 }, + "rotation=1": { "model": "block/jungle_sign", "y": 22.5 }, + "rotation=2": { "model": "block/jungle_sign", "y": 45 }, + "rotation=3": { "model": "block/jungle_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/jungle_sign", "y": 90 }, + "rotation=5": { "model": "block/jungle_sign", "y": 112.5 }, + "rotation=6": { "model": "block/jungle_sign", "y": 135}, + "rotation=7": { "model": "block/jungle_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/jungle_sign", "y": 180 }, + "rotation=9": { "model": "block/jungle_sign", "y": 202.5 }, + "rotation=10": { "model": "block/jungle_sign", "y": 225 }, + "rotation=11": { "model": "block/jungle_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/jungle_sign", "y": 270 }, + "rotation=13": { "model": "block/jungle_sign", "y": 292.5 }, + "rotation=14": { "model": "block/jungle_sign", "y": 315 }, + "rotation=15": { "model": "block/jungle_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/jungle_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/jungle_wall_sign.json new file mode 100644 index 0000000..d8aaf3b --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/jungle_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/jungle_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/jungle_wall_sign", "y": 0 }, + "facing=east": { "model": "block/jungle_wall_sign", "y": 270 }, + "facing=west": { "model": "block/jungle_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/oak_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/oak_sign.json new file mode 100644 index 0000000..1d4b20e --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/oak_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/oak_sign", "y": 0 }, + "rotation=1": { "model": "block/oak_sign", "y": 22.5 }, + "rotation=2": { "model": "block/oak_sign", "y": 45 }, + "rotation=3": { "model": "block/oak_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/oak_sign", "y": 90 }, + "rotation=5": { "model": "block/oak_sign", "y": 112.5 }, + "rotation=6": { "model": "block/oak_sign", "y": 135}, + "rotation=7": { "model": "block/oak_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/oak_sign", "y": 180 }, + "rotation=9": { "model": "block/oak_sign", "y": 202.5 }, + "rotation=10": { "model": "block/oak_sign", "y": 225 }, + "rotation=11": { "model": "block/oak_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/oak_sign", "y": 270 }, + "rotation=13": { "model": "block/oak_sign", "y": 292.5 }, + "rotation=14": { "model": "block/oak_sign", "y": 315 }, + "rotation=15": { "model": "block/oak_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/oak_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/oak_wall_sign.json new file mode 100644 index 0000000..4ec02cb --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/oak_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/oak_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/oak_wall_sign", "y": 0 }, + "facing=east": { "model": "block/oak_wall_sign", "y": 270 }, + "facing=west": { "model": "block/oak_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/sign.json b/blockcrafter/custom_assets/minecraft/blockstates/sign.json deleted file mode 100644 index bd6f94f..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/sign.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "variants": { - "rotation=0": { "model": "block/sign", "y": 0 }, - "rotation=1": { "model": "block/sign", "y": 22.5 }, - "rotation=2": { "model": "block/sign", "y": 45 }, - "rotation=3": { "model": "block/sign", "y": 67.5 }, - - "rotation=4": { "model": "block/sign", "y": 90 }, - "rotation=5": { "model": "block/sign", "y": 112.5 }, - "rotation=6": { "model": "block/sign", "y": 135}, - "rotation=7": { "model": "block/sign", "y": 157.5 }, - - "rotation=8": { "model": "block/sign", "y": 180 }, - "rotation=9": { "model": "block/sign", "y": 202.5 }, - "rotation=10": { "model": "block/sign", "y": 225 }, - "rotation=11": { "model": "block/sign", "y": 247.5 }, - - "rotation=12": { "model": "block/sign", "y": 270 }, - "rotation=13": { "model": "block/sign", "y": 292.5 }, - "rotation=14": { "model": "block/sign", "y": 315 }, - "rotation=15": { "model": "block/sign", "y": 337.5 } - } -} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/spruce_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/spruce_sign.json new file mode 100644 index 0000000..c648de2 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/spruce_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/spruce_sign", "y": 0 }, + "rotation=1": { "model": "block/spruce_sign", "y": 22.5 }, + "rotation=2": { "model": "block/spruce_sign", "y": 45 }, + "rotation=3": { "model": "block/spruce_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/spruce_sign", "y": 90 }, + "rotation=5": { "model": "block/spruce_sign", "y": 112.5 }, + "rotation=6": { "model": "block/spruce_sign", "y": 135}, + "rotation=7": { "model": "block/spruce_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/spruce_sign", "y": 180 }, + "rotation=9": { "model": "block/spruce_sign", "y": 202.5 }, + "rotation=10": { "model": "block/spruce_sign", "y": 225 }, + "rotation=11": { "model": "block/spruce_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/spruce_sign", "y": 270 }, + "rotation=13": { "model": "block/spruce_sign", "y": 292.5 }, + "rotation=14": { "model": "block/spruce_sign", "y": 315 }, + "rotation=15": { "model": "block/spruce_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/spruce_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/spruce_wall_sign.json new file mode 100644 index 0000000..662c430 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/spruce_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/spruce_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/spruce_wall_sign", "y": 0 }, + "facing=east": { "model": "block/spruce_wall_sign", "y": 270 }, + "facing=west": { "model": "block/spruce_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/wall_sign.json deleted file mode 100644 index e525f4f..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/wall_sign.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "facing=north": { "model": "block/wall_sign", "y" : 180 }, - "facing=south": { "model": "block/wall_sign", "y": 0 }, - "facing=east": { "model": "block/wall_sign", "y": 270 }, - "facing=west": { "model": "block/wall_sign", "y": 90 } - } -} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/warped_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/warped_sign.json new file mode 100644 index 0000000..43ded60 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/warped_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/warped_sign", "y": 0 }, + "rotation=1": { "model": "block/warped_sign", "y": 22.5 }, + "rotation=2": { "model": "block/warped_sign", "y": 45 }, + "rotation=3": { "model": "block/warped_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/warped_sign", "y": 90 }, + "rotation=5": { "model": "block/warped_sign", "y": 112.5 }, + "rotation=6": { "model": "block/warped_sign", "y": 135}, + "rotation=7": { "model": "block/warped_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/warped_sign", "y": 180 }, + "rotation=9": { "model": "block/warped_sign", "y": 202.5 }, + "rotation=10": { "model": "block/warped_sign", "y": 225 }, + "rotation=11": { "model": "block/warped_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/warped_sign", "y": 270 }, + "rotation=13": { "model": "block/warped_sign", "y": 292.5 }, + "rotation=14": { "model": "block/warped_sign", "y": 315 }, + "rotation=15": { "model": "block/warped_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/warped_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/warped_wall_sign.json new file mode 100644 index 0000000..b1e3e37 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/warped_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/warped_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/warped_wall_sign", "y": 0 }, + "facing=east": { "model": "block/warped_wall_sign", "y": 270 }, + "facing=west": { "model": "block/warped_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/acacia_sign.json b/blockcrafter/custom_assets/minecraft/models/block/acacia_sign.json new file mode 100644 index 0000000..99f3058 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/acacia_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/acacia/post", + "front": "entity/signs/acacia/front", + "back" : "entity/signs/acacia/back", + "side": "entity/signs/acacia/side", + "top": "entity/signs/acacia/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/acacia_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/acacia_wall_sign.json new file mode 100644 index 0000000..9f948a5 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/acacia_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/acacia/post", + "front": "entity/signs/acacia/front", + "back" : "entity/signs/acacia/back", + "side": "entity/signs/acacia/side", + "top": "entity/signs/acacia/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/base_chest_left.json b/blockcrafter/custom_assets/minecraft/models/block/base_chest_left.json index 263a3a1..d94978c 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/base_chest_left.json +++ b/blockcrafter/custom_assets/minecraft/models/block/base_chest_left.json @@ -6,7 +6,7 @@ "to": [ 16, 14, 15 ], "faces": { "up" : { "texture": "#top" }, - "north": { "texture": "#right_back" }, + "north": { "texture": "#back" }, "south": { "texture": "#front" }, "west": { "texture": "#side" } } diff --git a/blockcrafter/custom_assets/minecraft/models/block/base_chest_right.json b/blockcrafter/custom_assets/minecraft/models/block/base_chest_right.json index 65f5d9f..87c3d5a 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/base_chest_right.json +++ b/blockcrafter/custom_assets/minecraft/models/block/base_chest_right.json @@ -6,7 +6,7 @@ "to": [ 15, 14, 15 ], "faces": { "up" : { "texture": "#top" }, - "north": { "texture": "#left_back" }, + "north": { "texture": "#back" }, "south": { "texture": "#front" }, "east": { "texture": "#side" } } diff --git a/blockcrafter/custom_assets/minecraft/models/block/birch_sign.json b/blockcrafter/custom_assets/minecraft/models/block/birch_sign.json new file mode 100644 index 0000000..3ec903f --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/birch_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/birch/post", + "front": "entity/signs/birch/front", + "back" : "entity/signs/birch/back", + "side": "entity/signs/birch/side", + "top": "entity/signs/birch/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/birch_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/birch_wall_sign.json new file mode 100644 index 0000000..2289b3c --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/birch_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/birch/post", + "front": "entity/signs/birch/front", + "back" : "entity/signs/birch/back", + "side": "entity/signs/birch/side", + "top": "entity/signs/birch/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/chest_left.json b/blockcrafter/custom_assets/minecraft/models/block/chest_left.json index ecc43be..420462d 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/chest_left.json +++ b/blockcrafter/custom_assets/minecraft/models/block/chest_left.json @@ -3,7 +3,7 @@ "textures": { "front": "entity/chest/normal_double/left_front", "side": "entity/chest/normal_double/side", - "right_back": "entity/chest/normal_double/right_back", + "back": "entity/chest/normal_double/left_back", "top": "entity/chest/normal_double/left_top", "thing_front": "entity/chest/normal_double/thing_front", "thing_side": "entity/chest/normal_double/thing_side", diff --git a/blockcrafter/custom_assets/minecraft/models/block/chest_right.json b/blockcrafter/custom_assets/minecraft/models/block/chest_right.json index 0abf2e7..9a28957 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/chest_right.json +++ b/blockcrafter/custom_assets/minecraft/models/block/chest_right.json @@ -3,7 +3,7 @@ "textures": { "front": "entity/chest/normal_double/right_front", "side": "entity/chest/normal_double/side", - "left_back": "entity/chest/normal_double/left_back", + "back": "entity/chest/normal_double/right_back", "top": "entity/chest/normal_double/right_top", "thing_front": "entity/chest/normal_double/thing_front", "thing_side": "entity/chest/normal_double/thing_side", diff --git a/blockcrafter/custom_assets/minecraft/models/block/conduit.json b/blockcrafter/custom_assets/minecraft/models/block/conduit.json new file mode 100644 index 0000000..0ec1071 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/conduit.json @@ -0,0 +1,24 @@ +{ + "elements": [ + { + "from": [ 4, 4, 4 ], + "to": [ 11, 11, 11 ], + "faces": { + "up" : { "texture": "#up" }, + "down": { "texture": "#down"}, + "north": { "texture": "#north" }, + "south": { "texture": "#south" }, + "east": { "texture": "#east" }, + "west": { "texture": "#west" } + } + } + ], + "textures": { + "up": "entity/conduit/cage/up", + "down": "entity/conduit/cage/down", + "north": "entity/conduit/cage/north", + "south": "entity/conduit/cage/south", + "east": "entity/conduit/cage/east", + "west": "entity/conduit/cage/west" + } +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/models/block/crimson_sign.json b/blockcrafter/custom_assets/minecraft/models/block/crimson_sign.json new file mode 100644 index 0000000..5cd44e2 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/crimson_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/crimson/post", + "front": "entity/signs/crimson/front", + "back" : "entity/signs/crimson/back", + "side": "entity/signs/crimson/side", + "top": "entity/signs/crimson/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/crimson_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/crimson_wall_sign.json new file mode 100644 index 0000000..c7dff45 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/crimson_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/crimson/post", + "front": "entity/signs/crimson/front", + "back" : "entity/signs/crimson/back", + "side": "entity/signs/crimson/side", + "top": "entity/signs/crimson/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/dark_oak_sign.json b/blockcrafter/custom_assets/minecraft/models/block/dark_oak_sign.json new file mode 100644 index 0000000..6a2e507 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/dark_oak_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/dark_oak/post", + "front": "entity/signs/dark_oak/front", + "back" : "entity/signs/dark_oak/back", + "side": "entity/signs/dark_oak/side", + "top": "entity/signs/dark_oak/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/dark_oak_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/dark_oak_wall_sign.json new file mode 100644 index 0000000..9286a9a --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/dark_oak_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/dark_oak/post", + "front": "entity/signs/dark_oak/front", + "back" : "entity/signs/dark_oak/back", + "side": "entity/signs/dark_oak/side", + "top": "entity/signs/dark_oak/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json new file mode 100644 index 0000000..def00fd --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json @@ -0,0 +1,15 @@ +{ + "parent": "block/water", + "textures": { + "water" : "block/water_still" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 13, 16 ], + "faces": { + "south": { "uv" : [0, 3, 16, 16], "texture": "#water", "cullface": "south" } + } + } + ] +} + diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json index ca47068..1c63042 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json @@ -5,7 +5,7 @@ }, "elements": [ { "from": [ 0, 0, 0 ], - "to": [ 16, 16, 16 ], + "to": [ 16, 13, 16 ], "faces": { "up": { "texture": "#water", "cullface": "up"} } diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json new file mode 100644 index 0000000..0733daf --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json @@ -0,0 +1,15 @@ +{ + "parent": "block/water", + "textures": { + "water" : "block/water_still" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 13, 16 ], + "faces": { + "west": { "uv" : [0, 3, 16, 16], "texture": "#water", "cullface": "west" } + } + } + ] +} + diff --git a/blockcrafter/custom_assets/minecraft/models/block/jungle_sign.json b/blockcrafter/custom_assets/minecraft/models/block/jungle_sign.json new file mode 100644 index 0000000..2188142 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/jungle_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/jungle/post", + "front": "entity/signs/jungle/front", + "back" : "entity/signs/jungle/back", + "side": "entity/signs/jungle/side", + "top": "entity/signs/jungle/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/jungle_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/jungle_wall_sign.json new file mode 100644 index 0000000..67b91b3 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/jungle_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/jungle/post", + "front": "entity/signs/jungle/front", + "back" : "entity/signs/jungle/back", + "side": "entity/signs/jungle/side", + "top": "entity/signs/jungle/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/sign.json b/blockcrafter/custom_assets/minecraft/models/block/oak_sign.json similarity index 79% rename from blockcrafter/custom_assets/minecraft/models/block/sign.json rename to blockcrafter/custom_assets/minecraft/models/block/oak_sign.json index 83f18fa..cefb3b6 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/sign.json +++ b/blockcrafter/custom_assets/minecraft/models/block/oak_sign.json @@ -1,10 +1,10 @@ { "textures": { - "post": "entity/sign/post", - "front": "entity/sign/front", - "back" : "entity/sign/back", - "side": "entity/sign/side", - "top": "entity/sign/top" + "post": "entity/signs/oak/post", + "front": "entity/signs/oak/front", + "back" : "entity/signs/oak/back", + "side": "entity/signs/oak/side", + "top": "entity/signs/oak/top" }, "elements": [ { diff --git a/blockcrafter/custom_assets/minecraft/models/block/wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/oak_wall_sign.json similarity index 68% rename from blockcrafter/custom_assets/minecraft/models/block/wall_sign.json rename to blockcrafter/custom_assets/minecraft/models/block/oak_wall_sign.json index 81e41e6..0b89c4e 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/wall_sign.json +++ b/blockcrafter/custom_assets/minecraft/models/block/oak_wall_sign.json @@ -1,10 +1,10 @@ { "textures": { - "post": "entity/sign/post", - "front": "entity/sign/front", - "back" : "entity/sign/back", - "side": "entity/sign/side", - "top": "entity/sign/top" + "post": "entity/signs/oak/post", + "front": "entity/signs/oak/front", + "back" : "entity/signs/oak/back", + "side": "entity/signs/oak/side", + "top": "entity/signs/oak/top" }, "elements": [ { diff --git a/blockcrafter/custom_assets/minecraft/models/block/simple_bell.json b/blockcrafter/custom_assets/minecraft/models/block/simple_bell.json new file mode 100644 index 0000000..6413993 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/simple_bell.json @@ -0,0 +1,42 @@ +{ + "elements": [ + { + "comment": "bell-middle", + "from": [ 5, 5, 5 ], + "to": [ 11, 13, 11 ], + "faces": { + "up": { "texture": "#top-middle" }, + "north": { "texture": "#front-middle" }, + "south": { "texture": "#back-middle" }, + "east": { "texture": "#east-middle" }, + "west": { "texture": "#west-middle" } + } + }, + { + "comment": "bell-bottom", + "from": [ 4, 3, 4 ], + "to": [ 12, 5, 12 ], + "faces": { + "up": { "texture": "#top-bottom" }, + "north": { "texture": "#front-bottom" }, + "south": { "texture": "#back-bottom" }, + "east": { "texture": "#east-bottom" }, + "west": { "texture": "#west-bottom" } + } + } + ], + "textures": { + "front-middle": "entity/bell/bell_body/front", + "east-middle": "entity/bell/bell_body/east", + "back-middle": "entity/bell/bell_body/back", + "west-middle": "entity/bell/bell_body/west", + "side-middle": "entity/bell/bell_body/side", + "top-middle": "entity/bell/bell_body/top", + "front-bottom": "entity/bell/bell_body/low_front", + "east-bottom": "entity/bell/bell_body/low_east", + "back-bottom": "entity/bell/bell_body/low_back", + "west-bottom": "entity/bell/bell_body/low_west", + "side-bottom": "entity/bell/bell_body/low_side", + "top-bottom": "entity/bell/bell_body/low_top" + } +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/models/block/spruce_sign.json b/blockcrafter/custom_assets/minecraft/models/block/spruce_sign.json new file mode 100644 index 0000000..8bda114 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/spruce_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/spruce/post", + "front": "entity/signs/spruce/front", + "back" : "entity/signs/spruce/back", + "side": "entity/signs/spruce/side", + "top": "entity/signs/spruce/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/spruce_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/spruce_wall_sign.json new file mode 100644 index 0000000..d1a279a --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/spruce_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/spruce/post", + "front": "entity/signs/spruce/front", + "back" : "entity/signs/spruce/back", + "side": "entity/signs/spruce/side", + "top": "entity/signs/spruce/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_left.json b/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_left.json index 0ecd335..ac0b00d 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_left.json +++ b/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_left.json @@ -3,7 +3,7 @@ "textures": { "front": "entity/chest/trapped_double/left_front", "side": "entity/chest/trapped_double/side", - "right_back": "entity/chest/trapped_double/right_back", + "back": "entity/chest/trapped_double/left_back", "top": "entity/chest/trapped_double/left_top", "thing_front": "entity/chest/trapped_double/thing_front", "thing_side": "entity/chest/trapped_double/thing_side", diff --git a/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_right.json b/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_right.json index 5bcf4b7..ef57040 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_right.json +++ b/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_right.json @@ -3,7 +3,7 @@ "textures": { "front": "entity/chest/trapped_double/right_front", "side": "entity/chest/trapped_double/side", - "left_back": "entity/chest/trapped_double/left_back", + "back": "entity/chest/trapped_double/right_back", "top": "entity/chest/trapped_double/right_top", "thing_front": "entity/chest/trapped_double/thing_front", "thing_side": "entity/chest/trapped_double/thing_side", diff --git a/blockcrafter/custom_assets/minecraft/models/block/warped_sign.json b/blockcrafter/custom_assets/minecraft/models/block/warped_sign.json new file mode 100644 index 0000000..1395f78 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/warped_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/warped/post", + "front": "entity/signs/warped/front", + "back" : "entity/signs/warped/back", + "side": "entity/signs/warped/side", + "top": "entity/signs/warped/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/warped_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/warped_wall_sign.json new file mode 100644 index 0000000..0945027 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/warped_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/warped/post", + "front": "entity/signs/warped/front", + "back" : "entity/signs/warped/back", + "side": "entity/signs/warped/side", + "top": "entity/signs/warped/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/waterlog.json b/blockcrafter/custom_assets/minecraft/models/block/waterlog.json index 595f48f..71147e5 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/waterlog.json +++ b/blockcrafter/custom_assets/minecraft/models/block/waterlog.json @@ -5,9 +5,9 @@ }, "elements": [ { "from": [ 0, 0, 0 ], - "to": [ 16, 16, 16 ], + "to": [ 16, 13, 16 ], "faces": { - "up": { "uv" : [0, 0, 16, 16], "texture": "#water", "cullface": "up" } + "up": { "uv" : [0, 3, 16, 16], "texture": "#water", "cullface": "up" } } } ] diff --git a/blockcrafter/export.py b/blockcrafter/export.py index d5efb9c..d033e30 100644 --- a/blockcrafter/export.py +++ b/blockcrafter/export.py @@ -28,7 +28,7 @@ from blockcrafter import mcmodel from blockcrafter import render -COLUMNS = 32 +COLUMNS = 128 class BlockImages: def __init__(self): @@ -132,15 +132,19 @@ def write_block_info(blockstate, variant, indices): actual_rotation = rotation if name == "minecraft:full_water": actual_rotation = 0 - if name == "minecraft:ice": + if blockstate.disable_blending or mode=="uv": render.set_blending("opaque") else: render.set_blending("premultiplied") + if blockstate.disable_culling: + render.apply_face_culling(on=False) + else: + render.apply_face_culling(on=True) actual_model = render.apply_model_rotation(model, rotation=0) glblock.render(variant, actual_model, view, projection, rotation=actual_rotation, mode=mode) array = np.array(fbo.read("color")) - if name == "minecraft:ice": + if blockstate.disable_blending: # make image opaque if mode == "color": array[:, :, 3] = (array[:, :, 3] > 0) * 255 diff --git a/blockcrafter/mcmodel.py b/blockcrafter/mcmodel.py index 43d644c..851f6d9 100644 --- a/blockcrafter/mcmodel.py +++ b/blockcrafter/mcmodel.py @@ -186,40 +186,51 @@ def create_chest_files(self, source, path): assert w == h f = w / 64 - front = image.crop((int(f * 14), int(f * 14), int(f * 28), int(f * 28))) - front.paste(image.crop((int(f * 14), int(f * 33), int(f * 28), int(f * (33+14)))), (int(f * 0), int(f * 5))) - side = image.crop((int(f * 0), int(f * 14), int(f * 14), int(f * 28))) - side.paste(image.crop((int(f * 0), int(f * 33), int(f * 14), int(f * (33+14)))), (int(f * 0), int(f * 5))) + front = image.crop((int(f * 42), int(f * 33), int(f * 56), int(f * (33+15)))) + front.paste(image.crop((int(f * 42), int(f * 14), int(f * 56), int(f * 19))), (int(f * 0), int(f * 10))) + front = front.transpose(Image.FLIP_TOP_BOTTOM) + side = image.crop((int(f * 0), int(f * 33), int(f * 14), int(f * (33+15)))) + side.paste(image.crop((int(f * 0), int(f * 14), int(f * 14), int(f * 19))), (int(f * 0), int(f * 10))) + side = side.transpose(Image.FLIP_TOP_BOTTOM) files = {} files[base_name + "front.png"] = pack_image(front) files[base_name + "side.png"] = pack_image(side) - files[base_name + "top.png"] = pack_image(image.crop((int(f * 14), int(f * 0), int(f * 28), int(f * 14)))) + files[base_name + "top.png"] = pack_image(image.crop((int(f * 28), int(f * 0), int(f * 42), int(f * 14)))) files[base_name + "thing_front.png"] = pack_image(image.crop((int(f * 1), int(f * 1), int(f * 3), int(f * 5)))) files[base_name + "thing_side.png"] = pack_image(image.crop((int(f * 0), int(f * 1), int(f * 1), int(f * 5)))) files[base_name + "thing_top.png"] = pack_image(image.crop((int(f * 1), int(f * 0), int(f * 3), int(f * 1)))) return files - def create_double_chest_files(self, source, path): - base_name = path.replace(".png", "/") - if len(source.glob_files(path)) == 0: + def create_double_chest_files(self, source, path_left, path_right): + base_name = path_left.replace("_left.png", "_double/") + if len(source.glob_files(path_left)) == 0 or len(source.glob_files(path_right)) == 0: return {} - image = Image.open(source.open_file(path)).convert("RGBA") - w, h = image.size - assert w == h * 2 - f = w / 128 - - left_front = image.crop((int(f * 14), int(f * 14), int(f * 29), int(f * 28))) - left_front.paste(image.crop((int(f * 14), int(f * 33), int(f * 29), int(f * (33+14)))), (int(f * 0), int(f * 5))) - right_front = image.crop((int(f * 29), int(f * 14), int(f * 44), int(f * 28))) - right_front.paste(image.crop((int(f * 29), int(f * 33), int(f * 44), int(f * (33+14)))), (int(f * 0), int(f * 5))) - side = image.crop((int(f * 0), int(f * 14), int(f * 14), int(f * 28))) - side.paste(image.crop((int(f * 0), int(f * 33), int(f * 14), int(f * (33+14)))), (int(f * 0), int(f * 5))) - left_back = image.crop((int(f * 58), int(f * 14), int(f * 73), int(f * 28))) - left_back.paste(image.crop((int(f * 58), int(f * 33), int(f * 73), int(f * (33+14)))), (int(f * 0), int(f * 5))) - right_back = image.crop((int(f * 73), int(f * 14), int(f * 88), int(f * 28))) - right_back.paste(image.crop((int(f * 73), int(f * 33), int(f * 88), int(f * (33+14)))), (int(f * 0), int(f * 5))) + image_left = Image.open(source.open_file(path_left)).convert("RGBA") + image_right = Image.open(source.open_file(path_right)).convert("RGBA") + wl, hl = image_left.size + wr, hr = image_right.size + assert wl == hl + assert wr == hr + assert wl == wr + f = wl / 64 + + left_front = image_left.crop((int(f * 43), int(f * 33), int(f * 58), int(f * (33+15)))) + left_front.paste(image_left.crop((int(f * 43), int(f * 14), int(f * 58), int(f * 19))), (int(f * 0), int(f * 10))) + left_front = left_front.transpose(Image.FLIP_TOP_BOTTOM) + right_front = image_right.crop((int(f * 43), int(f * 33), int(f * 58), int(f * (33+15)))) + right_front.paste(image_right.crop((int(f * 43), int(f * 14), int(f * 58), int(f * 19))), (int(f * 0), int(f * 10))) + right_front = right_front.transpose(Image.FLIP_TOP_BOTTOM) + side = image_left.crop((int(f * 29), int(f * 33), int(f * 43), int(f * (33+15)))) + side.paste(image_left.crop((int(f * 29), int(f * 14), int(f * 43), int(f * 19))), (int(f * 0), int(f * 10))) + side = side.transpose(Image.FLIP_TOP_BOTTOM) + left_back = image_left.crop((int(f * 14), int(f * 33), int(f * 29), int(f * (33+15)))) + left_back.paste(image_left.crop((int(f * 14), int(f * 14), int(f * 29), int(f * 19))), (int(f * 0), int(f * 10))) + left_back = left_back.transpose(Image.FLIP_TOP_BOTTOM) + right_back = image_right.crop((int(f * 14), int(f * 33), int(f * 29), int(f * (33+15)))) + right_back.paste(image_right.crop((int(f * 14), int(f * 14), int(f * 29), int(f * 19))), (int(f * 0), int(f * 10))) + right_back = right_back.transpose(Image.FLIP_TOP_BOTTOM) files = {} files[base_name + "left_front.png"] = pack_image(left_front) @@ -227,11 +238,11 @@ def create_double_chest_files(self, source, path): files[base_name + "side.png"] = pack_image(side) files[base_name + "left_back.png"] = pack_image(left_back) files[base_name + "right_back.png"] = pack_image(right_back) - files[base_name + "left_top.png"] = pack_image(image.crop((int(f * 14), int(f * 0), int(f * 29), int(f * 14)))) - files[base_name + "right_top.png"] = pack_image(image.crop((int(f * 29), int(f * 0), int(f * 44), int(f * 14)))) - files[base_name + "thing_front.png"] = pack_image(image.crop((int(f * 1), int(f * 1), int(f * 3), int(f * 5)))) - files[base_name + "thing_side.png"] = pack_image(image.crop((int(f * 0), int(f * 1), int(f * 1), int(f * 5)))) - files[base_name + "thing_top.png"] = pack_image(image.crop((int(f * 1), int(f * 0), int(f * 3), int(f * 1)))) + files[base_name + "left_top.png"] = pack_image(image_left.crop((int(f * 29), int(f * 0), int(f * 44), int(f * 14))).transpose(Image.FLIP_LEFT_RIGHT)) + files[base_name + "right_top.png"] = pack_image(image_right.crop((int(f * 29), int(f * 0), int(f * 44), int(f * 14))).transpose(Image.FLIP_LEFT_RIGHT)) + files[base_name + "thing_front.png"] = pack_image(image_left.crop((int(f * 1), int(f * 1), int(f * 3), int(f * 5)))) + files[base_name + "thing_side.png"] = pack_image(image_left.crop((int(f * 3), int(f * 1), int(f * 4), int(f * 5)))) + files[base_name + "thing_top.png"] = pack_image(image_left.crop((int(f * 1), int(f * 0), int(f * 3), int(f * 1)))) return files def create_sign_files(self, source, path): @@ -251,6 +262,28 @@ def create_sign_files(self, source, path): files[base_name + "post.png"] = pack_image(image.crop((int(f * 2), int(f * 16), int(f * 4), int(f * 30)))) return files + def create_bell_files(self, source, path): + base_name = path.replace(".png", "/") + if len(source.glob_files(path)) == 0: + return {} + image = Image.open(source.open_file(path)).convert("RGBA") + w, h = image.size + assert w == h + f = w / 32 + + files = {} + files[base_name + "front.png"] = pack_image(image.crop((int(f * 0), int(f * 6), int(f * 6), int(f * 13))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "east.png"] = pack_image(image.crop((int(f * 6), int(f * 6), int(f * 12), int(f * 13))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "back.png"] = pack_image(image.crop((int(f * 12), int(f * 6), int(f * 18), int(f * 13))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "west.png"] = pack_image(image.crop((int(f * 18), int(f * 6), int(f * 24), int(f * 13))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "top.png"] = pack_image(image.crop((int(f * 6), int(f * 0), int(f * 12), int(f * 6)))) + files[base_name + "low_front.png"] = pack_image(image.crop((int(f * 0), int(f * 21), int(f * 8), int(f * 23))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "low_east.png"] = pack_image(image.crop((int(f * 8), int(f * 21), int(f * 16), int(f * 23))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "low_back.png"] = pack_image(image.crop((int(f * 16), int(f * 21), int(f * 24), int(f * 23))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "low_west.png"] = pack_image(image.crop((int(f * 24), int(f * 21), int(f * 32), int(f * 23))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "low_top.png"] = pack_image(image.crop((int(f * 8), int(f * 13), int(f * 16), int(f * 21)))) + return files + def create_shulker_files(self, source, path): base_name = path.replace(".png", "/") if len(source.glob_files(path)) == 0: @@ -289,14 +322,35 @@ def create_bed_files(self, source, path): files[base_name + "stand_inner.png"] = pack_image(image.crop((int(f * 56), int(f * 3), int(f * 59), int(f * 6)))) return files + def create_conduit_files(self, source, path): + base_name = path.replace(".png", "/") + if len(source.glob_files(path)) == 0: + return {} + image = Image.open(source.open_file(path)).convert("RGBA") + w, h = image.size + assert w == h * 2 + f = w / 32 + + files = {} + files[base_name + "up.png"] = pack_image(image.crop((int(f * 8), int(f * 0), int(f * 16), int(f * 8)))) + files[base_name + "down.png"] = pack_image(image.crop((int(f * 16), int(f * 0), int(f * 24), int(f * 8)))) + files[base_name + "north.png"] = pack_image(image.crop((int(f * 0), int(f * 8), int(f * 8), int(f * 16)))) + files[base_name + "west.png"] = pack_image(image.crop((int(f * 8), int(f * 8), int(f * 16), int(f * 16)))) + files[base_name + "south.png"] = pack_image(image.crop((int(f * 16), int(f * 8), int(f * 24), int(f * 16)))) + files[base_name + "east.png"] = pack_image(image.crop((int(f * 24), int(f * 8), int(f * 32), int(f * 16)))) + return files + def create_files(self, source): files = {} files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/normal.png")) files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/trapped.png")) files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/ender.png")) - files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/normal_double.png")) - files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/trapped_double.png")) - files.update(self.create_sign_files(source, "minecraft/textures/entity/sign.png")) + files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/normal_left.png", "minecraft/textures/entity/chest/normal_right.png")) + files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/trapped_left.png", "minecraft/textures/entity/chest/trapped_right.png")) + files.update(self.create_bell_files(source, "minecraft/textures/entity/bell/bell_body.png")) + files.update(self.create_conduit_files(source, "minecraft/textures/entity/conduit/cage.png")) + for path in source.glob_files("minecraft/textures/entity/signs/*.png"): + files.update(self.create_sign_files(source, path)) for path in source.glob_files("minecraft/textures/entity/shulker/shulker*.png"): files.update(self.create_shulker_files(source, path)) for path in source.glob_files("minecraft/textures/entity/bed/*.png"): @@ -320,6 +374,9 @@ def load_file(self, path): return data class Assets: + + MINECRAFT_NAMESPACE = "minecraft:" + def __init__(self, source): self.source = source @@ -374,7 +431,11 @@ def _get_model_json(self, path): if "parent" in m: prefix = path.split("/")[0] - parent = self._get_model_json(self.model_base.format(prefix=prefix) + "/" + m["parent"] + ".json") + parent_model = m["parent"] + # The model can have the minecraft: namespace in it since 1.16 + if parent_model.startswith(self.MINECRAFT_NAMESPACE): + parent_model = parent_model[len(self.MINECRAFT_NAMESPACE):] + parent = self._get_model_json(self.model_base.format(prefix=prefix) + "/" + parent_model + ".json") textures.update(parent["textures"]) if "elements" in parent: elements = parent["elements"] @@ -414,6 +475,9 @@ def load_texture(self, prefix, path): return self.source.open_file(self.texture_base.format(prefix=prefix) + "/" + path, mode="rb") class Blockstate: + + MINECRAFT_NAMESPACE = "minecraft:" + def __init__(self, assets, prefix, name, data, properties={}): self.assets = assets self.prefix = prefix @@ -422,7 +486,12 @@ def __init__(self, assets, prefix, name, data, properties={}): self.extra_properties = properties self.waterloggable = properties.get("is_waterloggable", "") == "true" + self.default_variant = properties.get("default_variant", None) + if self.default_variant != None: + self.default_variant = dict(map(lambda pair: pair.split(":"), self.default_variant.split(";"))) self.inherently_waterlogged = properties.get("inherently_waterlogged", "") == "true" + self.disable_blending = properties.get("disable_blending", "") == "true" + self.disable_culling = properties.get("disable_culling", "") == "true" if "biome_colormap" in self.extra_properties: def load_colormap(colormap): @@ -459,10 +528,12 @@ def evaluate_variant(self, variant): when = part["when"] if len(when) == 1 and "OR" in when: if any(map(lambda c: is_condition_fulfilled(c, variant), when["OR"])): - modelrefs.append(part["apply"]) + if("apply" in part): + modelrefs.append(part["apply"]) else: if is_condition_fulfilled(when, variant): - modelrefs.append(part["apply"]) + if("apply" in part): + modelrefs.append(part["apply"]) else: assert False, "There must be variants defined!" @@ -472,6 +543,9 @@ def evaluate_variant(self, variant): if isinstance(modelref, list): modelref = modelref[0] model_name = modelref["model"] + # The model can have the minecraft: namespace in it since 1.16 + if model_name.startswith(self.MINECRAFT_NAMESPACE): + model_name = model_name[len(self.MINECRAFT_NAMESPACE):] model_transformation = dict(modelref) del model_transformation["model"] model = self.assets.get_model(self.prefix + "/models/" + model_name + ".json") @@ -486,19 +560,16 @@ def apply_condition(condition): for key, value in condition.items(): if key not in variables: variables[key] = set() - + if self.default_variant != None and key in self.default_variant: + variables[key].add(self.default_variant[key]) + if type(value) == bool: value = "true" if value else "false" values = set([value]) if "|" in value: values = set(value.split("|")) - # TODO this is a bit hacky - # (just assume there must be true to false value, and vice versa) - if "true" in values: - values.add("false") - if "false" in values: - values.add("true") + variables[key].update(values) if "variants" in self.data: @@ -538,6 +609,9 @@ def __repr__(self): return "" % (self.prefix, self.name) class Model: + + MINECRAFT_NAMESPACE = "minecraft:" + def __init__(self, assets, prefix, name, data): self.assets = assets self.prefix = prefix @@ -553,12 +627,15 @@ def elements(self): return self.data["elements"] def resolve_texture(self, texture): - if not texture.startswith("#"): - return texture - name = texture[1:] - if not name in self.textures: - return None - return self.resolve_texture(self.textures[name]) + if texture.startswith("#"): + name = texture[1:] + if not name in self.textures: + return None + texture = self.resolve_texture(self.textures[name]) + # The data can have the minecraft: namespace in it since 1.16 + if texture != None and texture.startswith(self.MINECRAFT_NAMESPACE): + texture = texture[len(self.MINECRAFT_NAMESPACE):] + return texture def load_texture(self, name): return self.assets.load_texture(self.prefix, name + ".png") @@ -586,7 +663,7 @@ def parse_variant(condition): def encode_variant(variant): if len(variant) == 0: return "-" - items = list(variant.items()) + items = list(filter(lambda x: (x[0] != "default_variant"), list(variant.items()))) items.sort(key = lambda i: i[0]) return ",".join(map(lambda i: "=".join(i), items)) diff --git a/blockcrafter/render.py b/blockcrafter/render.py index 47ffff1..f670a9f 100644 --- a/blockcrafter/render.py +++ b/blockcrafter/render.py @@ -124,7 +124,15 @@ } float face = float(u_face_index) / 6.0; - gl_FragColor = vec4(vec3(v_texcoord.xy, face), 1.0); + + // Process the value of the Z position and scale it to be + // stored in the alpha channel of pixel, hence why + // the blending is disabled for UV mode. + // It's purpose is mainly to merge blocks, such as waterlog + vec4 t_rot = u_model * vec4(v_position, 1.0); + float t_z = min(max(((t_rot.z + 1.0) * 0.5) * 255.0/256.0 + 1.0/256.0, 1.0/256.0), 1.0); + + gl_FragColor = vec4(vec3(v_texcoord.xy, face), t_z); } """ @@ -410,7 +418,7 @@ def load_faces(model, element): data = np.array(image) semi_transparent = np.all((data[:, :, 3] == 0) | (data[:, :, 3] == 255)) w, h = image.size - image = image.resize((w*2, h*2), resample=Image.BILINEAR) + image = image.resize((w*2, h*2), resample=Image.NEAREST) data = np.array(image) if semi_transparent: data[:, :, 3] = (data[:, :, 3] > 255/2.0) * 255 @@ -420,7 +428,7 @@ def load_faces(model, element): data[:, :, 0] = data[:, :, 0] * r data[:, :, 1] = data[:, :, 1] * g data[:, :, 2] = data[:, :, 2] * b - faces[direction] = (gloo.Texture2D(data=data, interpolation="nearest"), (uv0, uv1)) + faces[direction] = (gloo.Texture2D(data=data, interpolation="linear"), (uv0, uv1)) f.close() # gather faces in order for cube sides @@ -516,6 +524,12 @@ def apply_model_rotation(model, rotation=0, phi=0.0): rotation = transforms.rotate(-rotation * 90 + phi, (0, 1, 0)) return np.dot(rotation, model) +def apply_face_culling(on=True): + if on: + gloo.set_state(cull_face=True) + else: + gloo.set_state(cull_face=False) + def set_blending(mode): if mode == "premultiplied": gloo.set_state(blend=True, depth_test=True) diff --git a/fractions.patch b/fractions.patch new file mode 100644 index 0000000..e8e5ad4 --- /dev/null +++ b/fractions.patch @@ -0,0 +1,8 @@ +4c4 +< #from fractions import gcd +--- +> from fractions import gcd +91c91 +< return math.gcd(self._p, self._q) +--- +> return gcd(self._p, self._q) diff --git a/setup.py b/setup.py index 71ff2b4..8ab18fc 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ ], keywords="", packages=find_packages(), - install_requires=["numpy", "vispy", "Pillow"], + install_requires=["numpy==1.17.5", "vispy==0.5.3", "Pillow==6.2.2"], extras_require={}, package_data={ "blockcrafter" : ["custom_assets", "blockstates.properties"]