Add steel catwalk blocks, and fix recipes

This commit is contained in:
Zontreck 2024-03-01 03:01:52 -07:00
parent 21c459bd95
commit f2ce7d33d6
206 changed files with 4343 additions and 1418 deletions

View file

@ -136,6 +136,13 @@ public class ModBlockStatesProvider extends BlockStateProvider {
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/glass/panzerglass_block_texture3")
};
ResourceLocation[] oldIndustrialWood = new ResourceLocation[]{
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/material/industrial_planks_texture0"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/material/industrial_planks_texture1"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/material/industrial_planks_texture2"),
new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/material/industrial_planks_texture3"),
};
variantCubeBlock(ModBlocks.CLINKER_BRICK_BLOCK, clinkerBlock);
customSlabBlock(ModBlocks.CLINKER_BRICK_SLAB, clinkerBlock);
customStairBlock(ModBlocks.CLINKER_BRICK_STAIRS, clinkerBlock);
@ -161,6 +168,43 @@ public class ModBlockStatesProvider extends BlockStateProvider {
variantTransparentCubeBlock(ModBlocks.PANZER_GLASS_BLOCK, new ResourceLocation(OTEMod.MOD_ID, "engineersdecor/glass/panzerglass_block_texture_inventory"), panzerglass);
customTransparentSlabBlock(ModBlocks.PANZER_GLASS_SLAB, panzerglass);
variantCubeBlock(ModBlocks.OLD_INDUSTRIAL_WOOD_PLANKS, oldIndustrialWood);
customSlabBlock(ModBlocks.OLD_INDUSTRIAL_WOOD_SLAB, oldIndustrialWood);
customStairBlock(ModBlocks.OLD_INDUSTRIAL_WOOD_STAIRS, oldIndustrialWood);
doorBlock(ModBlocks.OLD_INDUSTRIAL_WOOD_DOOR, new ResourceLocation(OTEMod.MOD_ID, "block/engineersdecor/door/old_industrial_door_texture_bottom"), new ResourceLocation(OTEMod.MOD_ID, "block/engineersdecor/door/old_industrial_door_texture_top"));
blockWithExistingModel(ModBlocks.STEEL_GRATING, "block/engineersdecor/furniture/steel_floor_grating", false);
blockWithExistingModel(ModBlocks.STEEL_GRATING_TOP, "block/engineersdecor/furniture/steel_floor_grating_top", false);
blockWithExistingModel(ModBlocks.STEEL_TABLE, "block/engineersdecor/furniture/steel_table", false);
blockWithExistingModel(ModBlocks.STEEL_CATWALK, "block/engineersdecor/furniture/steel_catwalk", false);
blockWithExistingModel(ModBlocks.STEEL_CATWALK_TOP, "block/engineersdecor/furniture/steel_catwalk_top", false);
blockWithExistingModel(ModBlocks.STEEL_RAILING, "block/engineersdecor/furniture/steel_railing", true);
blockWithExistingModel(ModBlocks.STEEL_CATWALK_STAIRS, "block/engineersdecor/furniture/steel_catwalk_stairs", true);
blockWithExistingModel(ModBlocks.STEEL_CATWALK_STAIRS_LR, "block/engineersdecor/furniture/steel_catwalk_stairs_lr", true);
blockWithExistingModel(ModBlocks.STEEL_CATWALK_STAIRS_RR, "block/engineersdecor/furniture/steel_catwalk_stairs_rr", true);
blockWithExistingModel(ModBlocks.STEEL_CATWALK_STAIRS_DR, "block/engineersdecor/furniture/steel_catwalk_stairs_dr", true);
}
private void blockWithExistingModel(RegistryObject<Block> blk, String model, boolean rotatable)
{
ResourceLocation modelLoc = new ResourceLocation(OTEMod.MOD_ID, model);
ModelFile mFile = models().withExistingParent(name(blk.get()), modelLoc);
if(!rotatable)
simpleBlock(blk.get(), mFile);
else horizontalBlock(blk.get(), mFile);
simpleBlockItem(blk.get(), mFile);
}
private void doorBlock(RegistryObject<Block> blk, ResourceLocation textureTop, ResourceLocation textureBottom)
{
doorBlockWithRenderType((DoorBlock) blk.get(), textureBottom, textureTop, new ResourceLocation("translucent"));
simpleBlockItem(blk.get(), models().doorBottomLeft(name(blk.get()), textureBottom, textureTop));
}
private void wallBlock(RegistryObject<Block> blk, ResourceLocation texture)

View file

@ -2,30 +2,21 @@ package dev.zontreck.otemod.data.loot;
import dev.zontreck.otemod.blocks.*;
import dev.zontreck.otemod.items.ModItems;
import net.minecraft.data.PackOutput;
import net.minecraft.data.loot.BlockLootSubProvider;
import net.minecraft.data.loot.LootTableProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer;
import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount;
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.RegistryObject;
import java.util.List;
import java.util.Set;
import static dev.zontreck.otemod.blocks.ModBlocks.BLOCKS;
public class ModBlockLootTablesProvider extends BlockLootSubProvider
{
public ModBlockLootTablesProvider()
@ -67,44 +58,44 @@ public class ModBlockLootTablesProvider extends BlockLootSubProvider
dropSelf(ModBlocks.CYAN_WALL_V2.get());
dropSelf(ModBlocks.POOL_TILE.get());
dropSelf(ModBlocks.POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.POOL_TILE_SLAB);
dropSelf(ModBlocks.POOL_LIGHT.get());
dropSelf(ModBlocks.DIRTY_POOL_TILE.get());
dropSelf(ModBlocks.DIRTY_POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.DIRTY_POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.DIRTY_POOL_TILE_SLAB);
dropSelf(ModBlocks.DIRTY_POOL_LIGHT.get());
dropSelf(ModBlocks.FILTHY_POOL_LIGHT.get());
dropSelf(ModBlocks.DARK_POOL_TILE.get());
dropSelf(ModBlocks.DARK_POOL_LIGHT.get());
dropSelf(ModBlocks.DARK_POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.DARK_POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.DARK_POOL_TILE_SLAB);
dropSelf(ModBlocks.BLUE_POOL_TILE.get());
dropSelf(ModBlocks.BLUE_POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.BLUE_POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.BLUE_POOL_TILE_SLAB);
dropSelf(ModBlocks.BLUE_POOL_LIGHT.get());
dropSelf(ModBlocks.DIRTY_BLUE_POOL_TILE.get());
dropSelf(ModBlocks.DIRTY_BLUE_POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.DIRTY_BLUE_POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.DIRTY_BLUE_POOL_TILE_SLAB);
dropSelf(ModBlocks.DIRTY_BLUE_POOL_LIGHT.get());
dropSelf(ModBlocks.FILTHY_BLUE_POOL_LIGHT.get());
dropSelf(ModBlocks.RED_POOL_TILE.get());
dropSelf(ModBlocks.RED_POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.RED_POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.RED_POOL_TILE_SLAB);
dropSelf(ModBlocks.RED_POOL_LIGHT.get());
dropSelf(ModBlocks.DIRTY_RED_POOL_TILE.get());
dropSelf(ModBlocks.DIRTY_RED_POOL_LIGHT.get());
dropSelf(ModBlocks.FILTHY_RED_POOL_LIGHT.get());
dropSelf(ModBlocks.DIRTY_RED_POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.DIRTY_RED_POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.DIRTY_RED_POOL_TILE_SLAB);
dropSelf(ModBlocks.DARK_RED_WOOL.get());
dropSelf(ModBlocks.DARK_RED_CARPET.get());
dropSelf(ModBlocks.GREEN_POOL_TILE.get());
dropSelf(ModBlocks.GREEN_POOL_LIGHT.get());
dropSelf(ModBlocks.GREEN_POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.GREEN_POOL_TILE_SLAB);
dropSelf(ModBlocks.GREEN_POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.DIRTY_GREEN_POOL_TILE.get());
dropSelf(ModBlocks.DIRTY_GREEN_POOL_LIGHT.get());
dropSelf(ModBlocks.DIRTY_GREEN_POOL_TILE_SLAB.get());
createSlabItemTable(ModBlocks.DIRTY_GREEN_POOL_TILE_SLAB);
dropSelf(ModBlocks.DIRTY_GREEN_POOL_TILE_STAIRS.get());
dropSelf(ModBlocks.FILTHY_GREEN_POOL_LIGHT.get());
dropSelf(ModBlocks.UNCRAFTER.get());
@ -115,35 +106,65 @@ public class ModBlockLootTablesProvider extends BlockLootSubProvider
dropSelf(ModBlocks.CLINKER_BRICK_BLOCK.get());
dropSelf(ModBlocks.CLINKER_BRICK_RECESSED.get());
dropSelf(ModBlocks.CLINKER_BRICK_VERTICALLY_SLIT.get());
dropSelf(ModBlocks.CLINKER_BRICK_SLAB.get());
createSlabItemTable(ModBlocks.CLINKER_BRICK_SLAB);
dropSelf(ModBlocks.CLINKER_BRICK_STAIRS.get());
dropSelf(ModBlocks.CLINKER_BRICK_STAINED_BLOCK.get());
dropSelf(ModBlocks.CLINKER_BRICK_STAINED_SLAB.get());
createSlabItemTable(ModBlocks.CLINKER_BRICK_STAINED_SLAB);
dropSelf(ModBlocks.CLINKER_BRICK_STAINED_STAIRS.get());
dropSelf(ModBlocks.CLINKER_BRICK_SASTOR_CORNER_BLOCK.get());
dropSelf(ModBlocks.CLINKER_BRICK_WALL.get());
dropSelf(ModBlocks.SLAG_BRICK_BLOCK.get());
dropSelf(ModBlocks.SLAG_BRICK_SLAB.get());
createSlabItemTable(ModBlocks.SLAG_BRICK_SLAB);
dropSelf(ModBlocks.SLAG_BRICK_WALL.get());
dropSelf(ModBlocks.SLAG_BRICK_STAIRS.get());
dropSelf(ModBlocks.REBAR_CONCRETE_BLOCK.get());
dropSelf(ModBlocks.REBAR_CONCRETE_SLAB.get());
createSlabItemTable(ModBlocks.REBAR_CONCRETE_SLAB);
dropSelf(ModBlocks.REBAR_CONCRETE_STAIRS.get());
dropSelf(ModBlocks.REBAR_CONCRETE_WALL.get());
dropSelf(ModBlocks.REBAR_CONCRETE_TILE_BLOCK.get());
dropSelf(ModBlocks.REBAR_CONCRETE_TILE_SLAB.get());
createSlabItemTable(ModBlocks.REBAR_CONCRETE_TILE_SLAB);
dropSelf(ModBlocks.REBAR_CONCRETE_TILE_STAIRS.get());
dropSelf(ModBlocks.PANZER_GLASS_BLOCK.get());
dropSelf(ModBlocks.PANZER_GLASS_SLAB.get());
createSlabItemTable(ModBlocks.PANZER_GLASS_SLAB);
dropSelf(ModBlocks.OLD_INDUSTRIAL_WOOD_PLANKS.get());
createSlabItemTable(ModBlocks.OLD_INDUSTRIAL_WOOD_SLAB);
dropSelf(ModBlocks.OLD_INDUSTRIAL_WOOD_STAIRS.get());
createDoorTable(ModBlocks.OLD_INDUSTRIAL_WOOD_DOOR);
dropSelf(ModBlocks.STEEL_TABLE.get());
dropSelf(ModBlocks.STEEL_CATWALK.get());
dropSelf(ModBlocks.STEEL_RAILING.get());
dropSelf(ModBlocks.STEEL_CATWALK_STAIRS.get());
dropSelf(ModBlocks.STEEL_CATWALK_STAIRS_LR.get());
dropSelf(ModBlocks.STEEL_CATWALK_STAIRS_RR.get());
dropSelf(ModBlocks.STEEL_CATWALK_STAIRS_DR.get());
dropSelf(ModBlocks.STEEL_GRATING.get());
dropSelf(ModBlocks.STEEL_GRATING_TOP.get());
dropSelf(ModBlocks.STEEL_CATWALK_TOP.get());
}
private void createDoorTable(RegistryObject<Block> blk)
{
var loot = createDoorTable(blk.get());
add(blk.get(), loot);
}
private void createSlabItemTable(RegistryObject<Block> slab)
{
var loot = createSlabItemTable(slab.get());
add(slab.get(), loot);
}
@Override
protected Iterable<Block> getKnownBlocks() {
return ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get)::iterator;