diff --git a/src/generated/resources/assets/otemod/blockstates/panzerglass_block.json b/src/generated/resources/assets/otemod/blockstates/panzerglass_block.json new file mode 100644 index 0000000..387cbb9 --- /dev/null +++ b/src/generated/resources/assets/otemod/blockstates/panzerglass_block.json @@ -0,0 +1,18 @@ +{ + "variants": { + "": [ + { + "model": "otemod:block/panzerglass_block_model0" + }, + { + "model": "otemod:block/panzerglass_block_model1" + }, + { + "model": "otemod:block/panzerglass_block_model2" + }, + { + "model": "otemod:block/panzerglass_block_model3" + } + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/blockstates/panzerglass_slab.json b/src/generated/resources/assets/otemod/blockstates/panzerglass_slab.json new file mode 100644 index 0000000..cdd13c0 --- /dev/null +++ b/src/generated/resources/assets/otemod/blockstates/panzerglass_slab.json @@ -0,0 +1,88 @@ +{ + "variants": { + "type=bottom,waterlogged=false": [ + { + "model": "otemod:block/panzerglass_slab_model0_bottom" + }, + { + "model": "otemod:block/panzerglass_slab_model1_bottom" + }, + { + "model": "otemod:block/panzerglass_slab_model2_bottom" + }, + { + "model": "otemod:block/panzerglass_slab_model3_bottom" + } + ], + "type=bottom,waterlogged=true": [ + { + "model": "otemod:block/panzerglass_slab_model0_bottom" + }, + { + "model": "otemod:block/panzerglass_slab_model1_bottom" + }, + { + "model": "otemod:block/panzerglass_slab_model2_bottom" + }, + { + "model": "otemod:block/panzerglass_slab_model3_bottom" + } + ], + "type=double,waterlogged=false": [ + { + "model": "otemod:block/panzerglass_slab_model0_double" + }, + { + "model": "otemod:block/panzerglass_slab_model1_double" + }, + { + "model": "otemod:block/panzerglass_slab_model2_double" + }, + { + "model": "otemod:block/panzerglass_slab_model3_double" + } + ], + "type=double,waterlogged=true": [ + { + "model": "otemod:block/panzerglass_slab_model0_double" + }, + { + "model": "otemod:block/panzerglass_slab_model1_double" + }, + { + "model": "otemod:block/panzerglass_slab_model2_double" + }, + { + "model": "otemod:block/panzerglass_slab_model3_double" + } + ], + "type=top,waterlogged=false": [ + { + "model": "otemod:block/panzerglass_slab_model0_top" + }, + { + "model": "otemod:block/panzerglass_slab_model1_top" + }, + { + "model": "otemod:block/panzerglass_slab_model2_top" + }, + { + "model": "otemod:block/panzerglass_slab_model3_top" + } + ], + "type=top,waterlogged=true": [ + { + "model": "otemod:block/panzerglass_slab_model0_top" + }, + { + "model": "otemod:block/panzerglass_slab_model1_top" + }, + { + "model": "otemod:block/panzerglass_slab_model2_top" + }, + { + "model": "otemod:block/panzerglass_slab_model3_top" + } + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_block_inventory.json b/src/generated/resources/assets/otemod/models/block/panzerglass_block_inventory.json new file mode 100644 index 0000000..755d57e --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_block_inventory.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture_inventory" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_block_model0.json b/src/generated/resources/assets/otemod/models/block/panzerglass_block_model0.json new file mode 100644 index 0000000..3dc22b7 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_block_model0.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture0" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_block_model1.json b/src/generated/resources/assets/otemod/models/block/panzerglass_block_model1.json new file mode 100644 index 0000000..fb9b67a --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_block_model1.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture1" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_block_model2.json b/src/generated/resources/assets/otemod/models/block/panzerglass_block_model2.json new file mode 100644 index 0000000..82b906a --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_block_model2.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture2" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_block_model3.json b/src/generated/resources/assets/otemod/models/block/panzerglass_block_model3.json new file mode 100644 index 0000000..0d2da90 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_block_model3.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture3" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_bottom.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_bottom.json new file mode 100644 index 0000000..8407035 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_bottom.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/slab", + "render_type": "minecraft:translucent", + "textures": { + "bottom": "otemod:block/engineersdecor/glass/panzerglass_block_texture0", + "side": "otemod:block/engineersdecor/glass/panzerglass_block_texture0", + "top": "otemod:block/engineersdecor/glass/panzerglass_block_texture0" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_double.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_double.json new file mode 100644 index 0000000..3dc22b7 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_double.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture0" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_top.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_top.json new file mode 100644 index 0000000..89a8c41 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model0_top.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/slab_top", + "render_type": "minecraft:translucent", + "textures": { + "bottom": "otemod:block/engineersdecor/glass/panzerglass_block_texture0", + "side": "otemod:block/engineersdecor/glass/panzerglass_block_texture0", + "top": "otemod:block/engineersdecor/glass/panzerglass_block_texture0" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_bottom.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_bottom.json new file mode 100644 index 0000000..88da879 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_bottom.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/slab", + "render_type": "minecraft:translucent", + "textures": { + "bottom": "otemod:block/engineersdecor/glass/panzerglass_block_texture1", + "side": "otemod:block/engineersdecor/glass/panzerglass_block_texture1", + "top": "otemod:block/engineersdecor/glass/panzerglass_block_texture1" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_double.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_double.json new file mode 100644 index 0000000..fb9b67a --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_double.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture1" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_top.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_top.json new file mode 100644 index 0000000..4865e24 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model1_top.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/slab_top", + "render_type": "minecraft:translucent", + "textures": { + "bottom": "otemod:block/engineersdecor/glass/panzerglass_block_texture1", + "side": "otemod:block/engineersdecor/glass/panzerglass_block_texture1", + "top": "otemod:block/engineersdecor/glass/panzerglass_block_texture1" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_bottom.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_bottom.json new file mode 100644 index 0000000..ee2101b --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_bottom.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/slab", + "render_type": "minecraft:translucent", + "textures": { + "bottom": "otemod:block/engineersdecor/glass/panzerglass_block_texture2", + "side": "otemod:block/engineersdecor/glass/panzerglass_block_texture2", + "top": "otemod:block/engineersdecor/glass/panzerglass_block_texture2" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_double.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_double.json new file mode 100644 index 0000000..82b906a --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_double.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture2" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_top.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_top.json new file mode 100644 index 0000000..5f739b1 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model2_top.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/slab_top", + "render_type": "minecraft:translucent", + "textures": { + "bottom": "otemod:block/engineersdecor/glass/panzerglass_block_texture2", + "side": "otemod:block/engineersdecor/glass/panzerglass_block_texture2", + "top": "otemod:block/engineersdecor/glass/panzerglass_block_texture2" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_bottom.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_bottom.json new file mode 100644 index 0000000..1c0a689 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_bottom.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/slab", + "render_type": "minecraft:translucent", + "textures": { + "bottom": "otemod:block/engineersdecor/glass/panzerglass_block_texture3", + "side": "otemod:block/engineersdecor/glass/panzerglass_block_texture3", + "top": "otemod:block/engineersdecor/glass/panzerglass_block_texture3" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_double.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_double.json new file mode 100644 index 0000000..0d2da90 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_double.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_all", + "render_type": "minecraft:translucent", + "textures": { + "all": "otemod:block/engineersdecor/glass/panzerglass_block_texture3" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_top.json b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_top.json new file mode 100644 index 0000000..bd2109c --- /dev/null +++ b/src/generated/resources/assets/otemod/models/block/panzerglass_slab_model3_top.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/slab_top", + "render_type": "minecraft:translucent", + "textures": { + "bottom": "otemod:block/engineersdecor/glass/panzerglass_block_texture3", + "side": "otemod:block/engineersdecor/glass/panzerglass_block_texture3", + "top": "otemod:block/engineersdecor/glass/panzerglass_block_texture3" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/item/panzerglass_block.json b/src/generated/resources/assets/otemod/models/item/panzerglass_block.json new file mode 100644 index 0000000..b8df5eb --- /dev/null +++ b/src/generated/resources/assets/otemod/models/item/panzerglass_block.json @@ -0,0 +1,3 @@ +{ + "parent": "otemod:block/panzerglass_block_inventory" +} \ No newline at end of file diff --git a/src/generated/resources/assets/otemod/models/item/panzerglass_slab.json b/src/generated/resources/assets/otemod/models/item/panzerglass_slab.json new file mode 100644 index 0000000..d1f7837 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/item/panzerglass_slab.json @@ -0,0 +1,3 @@ +{ + "parent": "otemod:block/panzerglass_slab_model0_bottom" +} \ No newline at end of file diff --git a/src/generated/resources/data/otemod/loot_tables/blocks/panzerglass_block.json b/src/generated/resources/data/otemod/loot_tables/blocks/panzerglass_block.json new file mode 100644 index 0000000..a8c2bf6 --- /dev/null +++ b/src/generated/resources/data/otemod/loot_tables/blocks/panzerglass_block.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "otemod:panzerglass_block" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "otemod:blocks/panzerglass_block" +} \ No newline at end of file diff --git a/src/generated/resources/data/otemod/loot_tables/blocks/panzerglass_slab.json b/src/generated/resources/data/otemod/loot_tables/blocks/panzerglass_slab.json new file mode 100644 index 0000000..923c77f --- /dev/null +++ b/src/generated/resources/data/otemod/loot_tables/blocks/panzerglass_slab.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "otemod:panzerglass_slab" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "otemod:blocks/panzerglass_slab" +} \ No newline at end of file diff --git a/src/main/java/dev/zontreck/otemod/blocks/ModBlocks.java b/src/main/java/dev/zontreck/otemod/blocks/ModBlocks.java index 78760ad..a6aca99 100644 --- a/src/main/java/dev/zontreck/otemod/blocks/ModBlocks.java +++ b/src/main/java/dev/zontreck/otemod/blocks/ModBlocks.java @@ -306,4 +306,10 @@ public class ModBlocks { public static final RegistryObject REBAR_CONCRETE_TILE_STAIRS = registerWithItem(BLOCKS.register("rebar_concrete_tile_stairs", ()-> new StairBlock(ModBlocks.REBAR_CONCRETE_BLOCK.get()::defaultBlockState, BlockBehaviour.Properties.copy(Blocks.STONE).strength(1f, 2000f).isValidSpawn(ModBlocks::neverSpawn))), new Item.Properties()); + public static final RegistryObject PANZER_GLASS_BLOCK = registerWithItem(BLOCKS.register("panzerglass_block", ()-> new Block(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK).noOcclusion().strength(0.5f, 2000f).isValidSpawn(ModBlocks::neverSpawn).sound(SoundType.METAL))), new Item.Properties()); + + public static final RegistryObject PANZER_GLASS_SLAB = registerWithItem(BLOCKS.register("panzerglass_slab", ()-> new SlabBlock(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK).noOcclusion().strength(0.5f, 2000f).isValidSpawn(ModBlocks::neverSpawn).sound(SoundType.METAL))), new Item.Properties()); + + + } diff --git a/src/main/java/dev/zontreck/otemod/data/ModBlockStatesProvider.java b/src/main/java/dev/zontreck/otemod/data/ModBlockStatesProvider.java index 135ba8b..818497d 100644 --- a/src/main/java/dev/zontreck/otemod/data/ModBlockStatesProvider.java +++ b/src/main/java/dev/zontreck/otemod/data/ModBlockStatesProvider.java @@ -129,6 +129,13 @@ public class ModBlockStatesProvider extends BlockStateProvider { new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_tile_texture7") }; + ResourceLocation[] panzerglass = new ResourceLocation[]{ + new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/glass/panzerglass_block_texture0"), + new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/glass/panzerglass_block_texture1"), + new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/glass/panzerglass_block_texture2"), + new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/glass/panzerglass_block_texture3") + }; + variantCubeBlock(ModBlocks.CLINKER_BRICK_BLOCK, clinkerBlock); customSlabBlock(ModBlocks.CLINKER_BRICK_SLAB, clinkerBlock); customStairBlock(ModBlocks.CLINKER_BRICK_STAIRS, clinkerBlock); @@ -151,6 +158,9 @@ public class ModBlockStatesProvider extends BlockStateProvider { variantCubeBlock(ModBlocks.REBAR_CONCRETE_TILE_BLOCK, rebarConcreteTile); customSlabBlock(ModBlocks.REBAR_CONCRETE_TILE_SLAB, rebarConcreteTile); customStairBlock(ModBlocks.REBAR_CONCRETE_TILE_STAIRS, rebarConcreteTile); + + variantTransparentCubeBlock(ModBlocks.PANZER_GLASS_BLOCK, new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/glass/panzerglass_block_texture_inventory"), panzerglass); + customTransparentSlabBlock(ModBlocks.PANZER_GLASS_SLAB, panzerglass); } private void wallBlock(RegistryObject blk, ResourceLocation texture) @@ -305,6 +315,110 @@ public class ModBlockStatesProvider extends BlockStateProvider { }); + simpleBlockItem(blockId.get(), model0.get()); + } + private void customTransparentSlabBlock(RegistryObject blockId, ResourceLocation... variations) { + VariantBlockStateBuilder builder = getVariantBuilder(blockId.get()); + + + AtomicReference model0 = new AtomicReference<>(); + + builder.forAllStates((state)->{ + ConfiguredModel[] models = new ConfiguredModel[variations.length]; + + + String appendName = ""; + SlabType type = state.getValue(SlabBlock.TYPE); + + if(type == SlabType.BOTTOM) + appendName = "_bottom"; + else if(type == SlabType.TOP) + appendName = "_top"; + else if(type == SlabType.DOUBLE) + appendName = "_double"; + + for (int i = 0; i < variations.length; i++) { + ResourceLocation texture = variations[i]; + ResourceLocation rss = new ResourceLocation(texture.getNamespace(), "block/" + texture.getPath()); + ModelFile model = null; + if(type == SlabType.TOP) + model = models().slabTop(name(blockId.get()) + "_model" + i + appendName, rss, rss, rss).renderType(new ResourceLocation("translucent")); + else if(type == SlabType.BOTTOM) + model = models().slab(name(blockId.get()) + "_model" + i + appendName, rss, rss, rss).renderType(new ResourceLocation("translucent")); + else if(type == SlabType.DOUBLE) + model = models().cubeAll(name(blockId.get()) + "_model" + i + appendName, rss).renderType(new ResourceLocation("translucent")); + + + ConfiguredModel[] cfgModel = ConfiguredModel.builder().modelFile(model).build(); + + if(i==0 && model0.get()==null && type == SlabType.BOTTOM) model0.set(model); + + models[i] = cfgModel[0]; + //builder.partialState().addModels(cfgModel); + } + return models; + }); + + + simpleBlockItem(blockId.get(), model0.get()); + } + + private void customTransparentStairBlock(RegistryObject blockId, ResourceLocation... variations) { + VariantBlockStateBuilder builder = getVariantBuilder(blockId.get()); + ResourceLocation blockDefault = blockTexture(blockId.get()); + + + AtomicReference model0 = new AtomicReference<>(); + + builder.forAllStates((state)->{ + ConfiguredModel[] models = new ConfiguredModel[variations.length]; + Direction facing = (Direction)state.getValue(StairBlock.FACING); + Half half = (Half)state.getValue(StairBlock.HALF); + StairsShape shape = (StairsShape)state.getValue(StairBlock.SHAPE); + int yRot = (int)facing.getClockWise().toYRot(); + if (shape == StairsShape.INNER_LEFT || shape == StairsShape.OUTER_LEFT) { + yRot += 270; + } + + if (shape != StairsShape.STRAIGHT && half == Half.TOP) { + yRot += 90; + } + + yRot %= 360; + boolean uvlock = yRot != 0 || half == Half.TOP; + + String modelName = (shape == StairsShape.STRAIGHT) ? "" : (shape != StairsShape.INNER_LEFT && shape != StairsShape.INNER_RIGHT) ? "_outer":"_inner"; + boolean straight = (shape == StairsShape.STRAIGHT); + boolean inner = (shape == StairsShape.INNER_LEFT || shape == StairsShape.INNER_RIGHT); + + + for (int i = 0; i < variations.length; i++) { + ResourceLocation texture = variations[i]; + ResourceLocation rss = new ResourceLocation(texture.getNamespace(), "block/" + texture.getPath()); + ModelFile cubeModel = null; + if(straight) + cubeModel = models().stairs( + blockId.getId().getPath() + "_model"+i + modelName, // Model name + rss, rss, rss // Texture location + ).renderType(new ResourceLocation("translucent")); + + if(inner) + cubeModel = models().stairsInner(blockId.getId().getPath()+"_model"+i + modelName, rss, rss, rss).renderType(new ResourceLocation("translucent")); + else if(!inner && !straight) + cubeModel = models().stairsOuter(blockId.getId().getPath() + "_model"+i+modelName, rss, rss, rss).renderType(new ResourceLocation("translucent")); + + ConfiguredModel[] cfgModel = ConfiguredModel.builder().modelFile(cubeModel).rotationX(half == Half.BOTTOM ? 0 : 180).rotationY(yRot).uvLock(uvlock).build(); + + if(i==0 && model0.get()==null) model0.set(cubeModel); + + models[i] = cfgModel[0]; + //builder.partialState().addModels(cfgModel); + } + + return models; + }); + + simpleBlockItem(blockId.get(), model0.get()); } @@ -327,6 +441,32 @@ public class ModBlockStatesProvider extends BlockStateProvider { + simpleBlockItem(blockId.get(), model0); + } + + public void variantTransparentCubeBlock(RegistryObject blockId, ResourceLocation inventory, ResourceLocation... variations) { + VariantBlockStateBuilder builder = getVariantBuilder(blockId.get()); + ResourceLocation blockDefault = blockTexture(blockId.get()); + + ModelFile model0 = models().cubeAll(name(blockId.get()) + "_inventory", new ResourceLocation(inventory.getNamespace(), "block/" + inventory.getPath())).renderType(new ResourceLocation("translucent")); + + + for (int i = 0; i < variations.length; i++) { + ResourceLocation texture = variations[i]; + ResourceLocation rss = new ResourceLocation(texture.getNamespace(), "block/" + texture.getPath()); + + ModelFile cubeModel = models().cubeAll( + blockId.getId().getPath() + "_model"+i, // Model name + rss // Texture location + ).renderType(new ResourceLocation("translucent")); + var cfgModel = ConfiguredModel.builder().modelFile(cubeModel).build(); + //if(i==0)model0 = cubeModel; + builder.partialState().addModels(cfgModel); + } + + + + simpleBlockItem(blockId.get(), model0); } } diff --git a/src/main/java/dev/zontreck/otemod/data/loot/ModBlockLootTablesProvider.java b/src/main/java/dev/zontreck/otemod/data/loot/ModBlockLootTablesProvider.java index 7d0c078..357568f 100644 --- a/src/main/java/dev/zontreck/otemod/data/loot/ModBlockLootTablesProvider.java +++ b/src/main/java/dev/zontreck/otemod/data/loot/ModBlockLootTablesProvider.java @@ -137,6 +137,9 @@ public class ModBlockLootTablesProvider extends BlockLootSubProvider dropSelf(ModBlocks.REBAR_CONCRETE_TILE_SLAB.get()); dropSelf(ModBlocks.REBAR_CONCRETE_TILE_STAIRS.get()); + dropSelf(ModBlocks.PANZER_GLASS_BLOCK.get()); + dropSelf(ModBlocks.PANZER_GLASS_SLAB.get()); + } diff --git a/src/main/resources/assets/otemod/lang/en_us.json b/src/main/resources/assets/otemod/lang/en_us.json index 8a8543a..e0c1e9d 100644 --- a/src/main/resources/assets/otemod/lang/en_us.json +++ b/src/main/resources/assets/otemod/lang/en_us.json @@ -164,6 +164,10 @@ "block.otemod.rebar_concrete_tile_stairs.help": "Steel reinforced concrete tile stairs.\n Expensive but Creeper-proof.", "block.otemod.rebar_concrete_wall": "Rebar Concrete Wall", "block.otemod.rebar_concrete_wall.help": "Steel reinforced concrete wall.\n Expensive but Creeper-proof.", + "block.otemod.panzerglass_block": "Panzer Glass Block", + "block.otemod.panzerglass_block.help": "Reinforced glass block.\n Expensive, explosion-proof.\n Dark gray tint, faint structural\n lines visible, multi texture for\n seamless look.", + "block.otemod.panzerglass_slab": "Panzer Glass Slab", + "block.otemod.panzerglass_slab.help": "Reinforced glass slab.\n Expensive, explosion-proof.\n Dark gray tint, faint structural\n lines visible.", diff --git a/src/main/resources/data/minecraft/tags/blocks/slabs.json b/src/main/resources/data/minecraft/tags/blocks/slabs.json index c3bda06..9ab47cb 100644 --- a/src/main/resources/data/minecraft/tags/blocks/slabs.json +++ b/src/main/resources/data/minecraft/tags/blocks/slabs.json @@ -5,6 +5,7 @@ "otemod:clinker_brick_stained_slab", "otemod:slag_brick_slab", "otemod:rebar_concrete_slab", + "otemod:panzerglass_slab", "otemod:pool_tile_slab", "otemod:blue_pool_tile_slab", diff --git a/src/main/resources/data/minecraft/tags/blocks/wither_immune.json b/src/main/resources/data/minecraft/tags/blocks/wither_immune.json index 62caaa0..634ccef 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wither_immune.json +++ b/src/main/resources/data/minecraft/tags/blocks/wither_immune.json @@ -4,6 +4,16 @@ "otemod:ilusium_block", "otemod:item_scrubber", "otemod:magical_scrubber", - "otemod:layered_compressed_obsidian_block" + "otemod:layered_compressed_obsidian_block", + + "otemod:panzerglass_block", + "otemod:panzerglass_slab", + "otemod:rebar_concrete", + "otemod:rebar_concrete_slab", + "otemod:rebar_concrete_stairs", + "otemod:rebar_concrete_wall", + "otemod:rebar_concrete_tile", + "otemod:rebar_concrete_tile_slab", + "otemod:rebar_concrete_tile_stairs" ] } \ No newline at end of file diff --git a/src/main/resources/data/otemod/recipes/engineersdecor/independent/panzerglass_block_recipe.json b/src/main/resources/data/otemod/recipes/engineersdecor/independent/panzerglass_block_recipe.json new file mode 100644 index 0000000..6c8bd18 --- /dev/null +++ b/src/main/resources/data/otemod/recipes/engineersdecor/independent/panzerglass_block_recipe.json @@ -0,0 +1,37 @@ +{ + "type": "forge:conditional", + "recipes": [ + { + "conditions": [ + { + "type": "otemod:optional", + "result": "otemod:panzerglass_block", + "required": [ + "otemod:metal_bar", + "minecraft:glass" + ] + } + ], + "recipe": { + "type": "minecraft:crafting_shaped", + "pattern": [ + "SGS", + "GSG", + "SGS" + ], + "key": { + "G": { + "item": "minecraft:glass" + }, + "S": { + "item": "otemod:metal_bar" + } + }, + "result": { + "item": "otemod:panzerglass_block", + "count": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/otemod/recipes/engineersdecor/independent/panzerglass_slab_recipe.json b/src/main/resources/data/otemod/recipes/engineersdecor/independent/panzerglass_slab_recipe.json new file mode 100644 index 0000000..5152f8f --- /dev/null +++ b/src/main/resources/data/otemod/recipes/engineersdecor/independent/panzerglass_slab_recipe.json @@ -0,0 +1,33 @@ +{ + "type": "forge:conditional", + "recipes": [ + { + "conditions": [ + { + "type": "otemod:optional", + "result": "otemod:panzerglass_block", + "required": [ + "otemod:rebar_concrete_tile" + ] + } + ], + "recipe": { + "type": "minecraft:crafting_shaped", + "pattern": [ + " ", + " ", + "CCC" + ], + "key": { + "C": { + "item": "otemod:panzerglass_block" + } + }, + "result": { + "item": "otemod:panzerglass_slab", + "count": 6 + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/otemod/tags/blocks/engineersdecor.json b/src/main/resources/data/otemod/tags/blocks/engineersdecor.json index ca11b26..93554a4 100644 --- a/src/main/resources/data/otemod/tags/blocks/engineersdecor.json +++ b/src/main/resources/data/otemod/tags/blocks/engineersdecor.json @@ -25,6 +25,9 @@ "otemod:rebar_concrete_tile", "otemod:rebar_concrete_tile_slab", - "otemod:rebar_concrete_tile_stairs" + "otemod:rebar_concrete_tile_stairs", + + "otemod:panzerglass_block", + "otemod:panzerglass_slab" ] } \ No newline at end of file