Added rebar concrete blocks from engineers decor

This commit is contained in:
Zontreck 2024-02-28 13:10:13 -07:00
parent a687ac3179
commit 2595a8b906
121 changed files with 4939 additions and 12 deletions

View file

@ -5,6 +5,7 @@ import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.implementation.CreativeModeTabs;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Item;
@ -46,6 +47,9 @@ public class ModBlocks {
}
private static boolean neverSpawn(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, EntityType<?> entityType) {
return false;
}
public static void register(IEventBus bus){
BLOCKS.register(bus);
@ -287,4 +291,12 @@ public class ModBlocks {
public static final RegistryObject<Block> SLAG_BRICK_WALL = registerWithItem(BLOCKS.register("slag_brick_wall", ()-> new WallBlock(BlockBehaviour.Properties.copy(Blocks.STONE_BRICK_WALL))), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_BLOCK = registerWithItem(BLOCKS.register("rebar_concrete", ()-> new Block(BlockBehaviour.Properties.copy(Blocks.STONE).isValidSpawn(ModBlocks::neverSpawn).strength(1f, 2000f))), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_SLAB = registerWithItem(BLOCKS.register("rebar_concrete_slab", ()-> new SlabBlock(BlockBehaviour.Properties.copy(Blocks.STONE).strength(1f, 2000f).isValidSpawn(ModBlocks::neverSpawn))), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_STAIRS = registerWithItem(BLOCKS.register("rebar_concrete_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<Block> REBAR_CONCRETE_WALL = registerWithItem(BLOCKS.register("rebar_concrete_wall", ()-> new WallBlock(BlockBehaviour.Properties.copy(Blocks.STONE).strength(1f, 2000f).isValidSpawn(ModBlocks::neverSpawn))), new Item.Properties());
}

View file

@ -107,6 +107,17 @@ public class ModBlockStatesProvider extends BlockStateProvider {
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/slag_brick/slag_brick_texture7")
};
ResourceLocation[] rebarConcrete = new ResourceLocation[] {
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_texture0"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_texture1"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_texture2"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_texture3"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_texture4"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_texture5"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_texture6"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/concrete/rebar_concrete_texture7")
};
variantCubeBlock(ModBlocks.CLINKER_BRICK_BLOCK, clinkerBlock);
customSlabBlock(ModBlocks.CLINKER_BRICK_SLAB, clinkerBlock);
customStairBlock(ModBlocks.CLINKER_BRICK_STAIRS, clinkerBlock);
@ -120,13 +131,19 @@ public class ModBlockStatesProvider extends BlockStateProvider {
customSlabBlock(ModBlocks.SLAG_BRICK_SLAB, slagBricks);
customStairBlock(ModBlocks.SLAG_BRICK_STAIRS, slagBricks);
wallBlock(ModBlocks.SLAG_BRICK_WALL, new ResourceLocation(OTEMod.MOD_ID, "block/engineersdecor/slag_brick/slag_brick_wall0"));
variantCubeBlock(ModBlocks.REBAR_CONCRETE_BLOCK, rebarConcrete);
customSlabBlock(ModBlocks.REBAR_CONCRETE_SLAB, rebarConcrete);
customStairBlock(ModBlocks.REBAR_CONCRETE_STAIRS, rebarConcrete);
wallBlock(ModBlocks.REBAR_CONCRETE_WALL, new ResourceLocation(OTEMod.MOD_ID, "block/" + rebarConcrete[0].getPath()));
}
private void wallBlock(RegistryObject<Block> blk, ResourceLocation texture)
{
wallBlock((WallBlock) blk.get(), texture);
var wallInv = models().wallInventory(name(blk.get()) + "_inventory", texture);
simpleBlockItem(blk.get(), models().withExistingParent(name(blk.get()), blk.getId()));
simpleBlockItem(blk.get(), wallInv);
}
private void blockWithItem(RegistryObject<Block> blockRegistryObject) {

View file

@ -128,6 +128,11 @@ public class ModBlockLootTablesProvider extends BlockLootSubProvider
dropSelf(ModBlocks.SLAG_BRICK_WALL.get());
dropSelf(ModBlocks.SLAG_BRICK_STAIRS.get());
dropSelf(ModBlocks.REBAR_CONCRETE_BLOCK.get());
dropSelf(ModBlocks.REBAR_CONCRETE_SLAB.get());
dropSelf(ModBlocks.REBAR_CONCRETE_STAIRS.get());
dropSelf(ModBlocks.REBAR_CONCRETE_WALL.get());
}