Move engineers decor stuff from Thresholds to AE
This commit is contained in:
parent
a927a03c98
commit
3124f58f77
218 changed files with 5844 additions and 2 deletions
|
@ -0,0 +1,22 @@
|
|||
package dev.zontreck.essentials.blocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
public class BlockCustomVoxels extends PartialTransparentBlock
|
||||
{
|
||||
private VoxelShape superShape;
|
||||
protected BlockCustomVoxels(Properties p_54120_, VoxelShape shape) {
|
||||
super(p_54120_);
|
||||
this.superShape = shape;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState p_60555_, BlockGetter p_60556_, BlockPos p_60557_, CollisionContext p_60558_) {
|
||||
return superShape;
|
||||
}
|
||||
}
|
321
src/main/java/dev/zontreck/essentials/blocks/ModBlocks.java
Normal file
321
src/main/java/dev/zontreck/essentials/blocks/ModBlocks.java
Normal file
|
@ -0,0 +1,321 @@
|
|||
package dev.zontreck.essentials.blocks;
|
||||
|
||||
import dev.zontreck.essentials.AriasEssentials;
|
||||
import dev.zontreck.essentials.items.CreativeModeTabs;
|
||||
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
|
||||
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.*;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BlockSetType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.shapes.BooleanOp;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class ModBlocks {
|
||||
|
||||
private static BlockBehaviour.StatePredicate shulkerState = (p_152653_, p_152654_, p_152655_) -> {
|
||||
BlockEntity blockentity = p_152654_.getBlockEntity(p_152655_);
|
||||
if (!(blockentity instanceof ShulkerBoxBlockEntity)) {
|
||||
return true;
|
||||
} else {
|
||||
ShulkerBoxBlockEntity shulkerboxblockentity = (ShulkerBoxBlockEntity)blockentity;
|
||||
return shulkerboxblockentity.isClosed();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, AriasEssentials.MODID);
|
||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, AriasEssentials.MODID);
|
||||
|
||||
private static boolean never(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
|
||||
return false;
|
||||
}
|
||||
private static boolean always(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private static boolean neverSpawn(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, EntityType<?> entityType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void register(IEventBus bus){
|
||||
BLOCKS.register(bus);
|
||||
ITEMS.register(bus);
|
||||
AriasEssentials.LOGGER.info("Registering all blocks...");
|
||||
}
|
||||
|
||||
private static BlockBehaviour.Properties standardBehavior()
|
||||
{
|
||||
return BlockBehaviour.Properties.of().requiresCorrectToolForDrops().strength(7F).destroyTime(6).isValidSpawn(ModBlocks::neverSpawn);
|
||||
}
|
||||
private static BlockBehaviour.Properties gratingBlock()
|
||||
{
|
||||
return standardBehavior()
|
||||
.noOcclusion()
|
||||
.strength(0.5f, 2000f)
|
||||
.isViewBlocking(ModBlocks::never);
|
||||
}
|
||||
|
||||
private static BlockBehaviour.Properties stoneLikeBehavior()
|
||||
{
|
||||
return BlockBehaviour.Properties.copy(Blocks.COBBLESTONE).isValidSpawn(ModBlocks::neverSpawn);
|
||||
}
|
||||
|
||||
private static BlockBehaviour.Properties explosionResistance()
|
||||
{
|
||||
return standardBehavior().explosionResistance(1200);
|
||||
}
|
||||
|
||||
private static BlockBehaviour.Properties noViewBlocking()
|
||||
{
|
||||
return standardBehavior().noOcclusion().isViewBlocking(ModBlocks::never);
|
||||
}
|
||||
|
||||
private static BlockBehaviour.Properties fullBright()
|
||||
{
|
||||
return standardBehavior().lightLevel((X)->{
|
||||
return 15;
|
||||
}).noOcclusion();
|
||||
}
|
||||
|
||||
private static BlockBehaviour.Properties standard = standardBehavior();
|
||||
|
||||
private static BlockBehaviour.Properties explosionResistance = explosionResistance();
|
||||
|
||||
private static BlockBehaviour.Properties noViewBlocking = noViewBlocking();
|
||||
|
||||
private static BlockBehaviour.Properties stone = stoneLikeBehavior();
|
||||
|
||||
private static BlockBehaviour.Properties gratingBlock = gratingBlock();
|
||||
|
||||
private static BlockBehaviour.Properties poolLightClean = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 15);
|
||||
private static BlockBehaviour.Properties poolLightDirty = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 12);
|
||||
private static BlockBehaviour.Properties poolLightFilthy = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 4);
|
||||
|
||||
|
||||
public static RegistryObject<Block> registerWithItem(RegistryObject<Block> blk, Item.Properties props)
|
||||
{
|
||||
CreativeModeTabs.addToAETab(ITEMS.register(blk.getId().getPath(), ()->new BlockItem(blk.get(), props)));
|
||||
|
||||
return blk;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
ENGINEERS DECOR BLOCKS
|
||||
|
||||
*/
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_BLOCK = registerWithItem(BLOCKS.register("clinker_brick_block", ()->new StandardBlocks.BaseBlock(
|
||||
StandardBlocks.CFG_DEFAULT,
|
||||
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
|
||||
)), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_RECESSED = registerWithItem(BLOCKS.register("clinker_brick_recessed", ()->new StandardBlocks.HorizontalWaterLoggable(
|
||||
StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT,
|
||||
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
|
||||
new AABB[] {
|
||||
Auxiliaries.getPixeledAABB( 3,0, 0, 13,16, 1),
|
||||
Auxiliaries.getPixeledAABB( 0,0, 1, 16,16,11),
|
||||
Auxiliaries.getPixeledAABB( 4,0,11, 12,16,13)
|
||||
}
|
||||
)), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_VERTICALLY_SLIT = registerWithItem(BLOCKS.register("clinker_brick_vertically_slit", ()->new StandardBlocks.HorizontalWaterLoggable(
|
||||
StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT,
|
||||
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
|
||||
new AABB[] {
|
||||
Auxiliaries.getPixeledAABB( 3,0, 0, 13,16, 1),
|
||||
Auxiliaries.getPixeledAABB( 3,0,15, 13,16,16),
|
||||
Auxiliaries.getPixeledAABB( 0,0, 1, 16,16,15)
|
||||
}
|
||||
)), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_SLAB = registerWithItem(BLOCKS.register("clinker_brick_slab", ()->new SlabBlock(BlockBehaviour.Properties.copy(Blocks.STONE_SLAB))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_STAIRS = registerWithItem(BLOCKS.register("clinker_brick_stairs", ()->new StairBlock(CLINKER_BRICK_BLOCK.get()::defaultBlockState, BlockBehaviour.Properties.copy(Blocks.STONE_STAIRS))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_WALL = registerWithItem(BLOCKS.register("clinker_brick_wall", ()->new WallBlock(BlockBehaviour.Properties.copy(Blocks.STONE_BRICK_WALL))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_STAINED_BLOCK = registerWithItem(BLOCKS.register("clinker_brick_stained_block", ()->new Block(BlockBehaviour.Properties.copy(Blocks.STONE))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_STAINED_SLAB = registerWithItem(BLOCKS.register("clinker_brick_stained_slab", ()-> new SlabBlock(BlockBehaviour.Properties.copy(Blocks.STONE))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_STAINED_STAIRS = registerWithItem(BLOCKS.register("clinker_brick_stained_stairs", ()-> new StairBlock(CLINKER_BRICK_STAINED_BLOCK.get()::defaultBlockState, BlockBehaviour.Properties.copy(Blocks.STONE))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> CLINKER_BRICK_SASTOR_CORNER_BLOCK = registerWithItem(BLOCKS.register("clinker_brick_sastor_corner_block", ()-> new RotatableBlock(BlockBehaviour.Properties.copy(Blocks.STONE))), new Item.Properties());
|
||||
|
||||
/*public static final RegistryObject<Block> CLINKER_BRICK_VERTICAL_SLAB_STRUCTURED = registerWithItem(BLOCKS.register("clinker_brick_vertical_slab_structured", () -> new StandardBlocks.HorizontalWaterLoggable(
|
||||
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
|
||||
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
|
||||
new AABB[]{
|
||||
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 8),
|
||||
}
|
||||
)), new Item.Properties());*/
|
||||
|
||||
public static final RegistryObject<Block> SLAG_BRICK_BLOCK = registerWithItem(BLOCKS.register("slag_brick_block", ()-> new Block(BlockBehaviour.Properties.copy(Blocks.STONE))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> SLAG_BRICK_SLAB = registerWithItem(BLOCKS.register("slag_brick_slab", ()-> new SlabBlock(BlockBehaviour.Properties.copy(Blocks.STONE))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> SLAG_BRICK_STAIRS = registerWithItem(BLOCKS.register("slag_brick_stairs", ()-> new StairBlock(SLAG_BRICK_BLOCK.get()::defaultBlockState, BlockBehaviour.Properties.copy(Blocks.STONE))), new Item.Properties());
|
||||
|
||||
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());
|
||||
|
||||
public static final RegistryObject<Block> REBAR_CONCRETE_TILE_BLOCK = registerWithItem(BLOCKS.register("rebar_concrete_tile", ()-> new Block(BlockBehaviour.Properties.copy(Blocks.STONE).isValidSpawn(ModBlocks::neverSpawn).strength(1f, 2000f))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> REBAR_CONCRETE_TILE_SLAB = registerWithItem(BLOCKS.register("rebar_concrete_tile_slab", ()-> new SlabBlock(BlockBehaviour.Properties.copy(Blocks.STONE).strength(1f, 2000f).isValidSpawn(ModBlocks::neverSpawn))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> 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<Block> REBAR_CONCRETE_HALFSLAB = registerWithItem(BLOCKS.register("halfslab_rebar_concrete", () -> new SlabSliceBlock(
|
||||
StandardBlocks.CFG_CUTOUT,
|
||||
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModBlocks::neverSpawn)
|
||||
)), new Item.Properties());*/
|
||||
|
||||
public static final RegistryObject<Block> PANZER_GLASS_BLOCK = registerWithItem(BLOCKS.register("panzerglass_block", ()-> new PartialTransparentBlock(BlockBehaviour.Properties.of().noOcclusion().strength(0.5f, 2000f).isValidSpawn(ModBlocks::neverSpawn).sound(SoundType.METAL))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> PANZER_GLASS_SLAB = registerWithItem(BLOCKS.register("panzerglass_slab", ()-> new PartialTransparentSlabBlock(BlockBehaviour.Properties.of().noOcclusion().strength(0.5f, 2000f).isValidSpawn(ModBlocks::neverSpawn).sound(SoundType.METAL))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_PLANKS = registerWithItem(BLOCKS.register("old_industrial_wood_planks", ()-> new Block(BlockBehaviour.Properties.copy(Blocks.OAK_PLANKS).strength(0.5f, 6f).sound(SoundType.WOOD))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_SLAB = registerWithItem(BLOCKS.register("old_industrial_wood_slab", ()-> new SlabBlock(BlockBehaviour.Properties.copy(Blocks.OAK_PLANKS).strength(0.5f, 6f).sound(SoundType.WOOD))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_STAIRS = registerWithItem(BLOCKS.register("old_industrial_wood_stairs", ()-> new StairBlock(ModBlocks.OLD_INDUSTRIAL_WOOD_PLANKS.get()::defaultBlockState, BlockBehaviour.Properties.copy(Blocks.OAK_PLANKS).strength(0.5f, 6f).sound(SoundType.WOOD))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_DOOR = registerWithItem(BLOCKS.register("old_industrial_wood_door", ()-> new DoorBlock(BlockBehaviour.Properties.copy(Blocks.OAK_PLANKS).strength(0.5f, 6f).noOcclusion(), BlockSetType.DARK_OAK)), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> STEEL_CATWALK = registerWithItem(BLOCKS.register("steel_catwalk", ()-> new BlockCustomVoxels(gratingBlock, Block.box(0, 0, 0, 16, 2, 16))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> STEEL_CATWALK_TOP = registerWithItem(BLOCKS.register("steel_catwalk_top", ()-> new BlockCustomVoxels(gratingBlock, Block.box(0, 14, 0, 16, 16, 16))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> STEEL_GRATING = registerWithItem(BLOCKS.register("steel_floor_grating", ()-> new BlockCustomVoxels(gratingBlock, Block.box(0, 0, 0, 16, 2, 16))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> STEEL_GRATING_TOP = registerWithItem(BLOCKS.register("steel_floor_grating_top", ()-> new BlockCustomVoxels(gratingBlock, Block.box(0, 14, 0, 16, 16, 16))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> STEEL_TABLE = registerWithItem(BLOCKS.register("steel_table", ()-> new BlockCustomVoxels(gratingBlock, Block.box(0, 0, 0, 16, 16, 16))), new Item.Properties());
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_NORTH = Shapes.join(Block.box(1, 10, 0, 15, 12, 8), Block.box(1, 2, 8, 15, 4, 16), BooleanOp.OR);
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_SOUTH = Shapes.join(Block.box(1, 10, 8, 15, 12, 16), Block.box(1, 2, 0, 15, 4, 8), BooleanOp.OR);
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_EAST = Shapes.join(Block.box(8, 10, 1, 16, 12, 15), Block.box(0, 2, 1, 8, 4, 15), BooleanOp.OR);
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_WEST = Shapes.join(Block.box(0, 10, 1, 8, 12, 15), Block.box(8, 2, 1, 16, 4, 15), BooleanOp.OR);
|
||||
|
||||
public static final RegistryObject<Block> STEEL_CATWALK_STAIRS = registerWithItem(BLOCKS.register("steel_catwalk_stairs", ()-> new RotatableBlockCustomVoxels(gratingBlock, STEEL_CATWALK_STAIRS_NORTH, STEEL_CATWALK_STAIRS_SOUTH, STEEL_CATWALK_STAIRS_WEST, STEEL_CATWALK_STAIRS_EAST)), new Item.Properties());
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_LR_NORTH = Stream.of(
|
||||
Block.box(1, 2, 8, 15, 4, 16),
|
||||
Block.box(1, 10, 0, 15, 12, 8),
|
||||
Block.box(0, 0, 0, 1, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_LR_SOUTH = Stream.of(
|
||||
Block.box(1, 2, 0, 15, 4, 8),
|
||||
Block.box(1, 10, 8, 15, 12, 16),
|
||||
Block.box(15, 0, 0, 16, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_LR_EAST = Stream.of(
|
||||
Block.box(0, 2, 1, 8, 4, 15),
|
||||
Block.box(8, 10, 1, 16, 12, 15),
|
||||
Block.box(0, 0, 0, 16, 21, 1)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_LR_WEST = Stream.of(
|
||||
Block.box(8, 2, 1, 16, 4, 15),
|
||||
Block.box(0, 10, 1, 8, 12, 15),
|
||||
Block.box(0, 0, 15, 16, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
public static final RegistryObject<Block> STEEL_CATWALK_STAIRS_LR = registerWithItem(BLOCKS.register("steel_catwalk_stairs_lr", ()-> new RotatableBlockCustomVoxels(gratingBlock, STEEL_CATWALK_STAIRS_LR_NORTH, STEEL_CATWALK_STAIRS_LR_SOUTH, STEEL_CATWALK_STAIRS_LR_WEST, STEEL_CATWALK_STAIRS_LR_EAST)), new Item.Properties());
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_RR_NORTH = Stream.of(
|
||||
Block.box(1, 2, 8, 15, 4, 16),
|
||||
Block.box(1, 10, 0, 15, 12, 8),
|
||||
Block.box(15, 0, 0, 16, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_RR_SOUTH = Stream.of(
|
||||
Block.box(1, 2, 0, 15, 4, 8),
|
||||
Block.box(1, 10, 8, 15, 12, 16),
|
||||
Block.box(0, 0, 0, 1, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_RR_EAST = Stream.of(
|
||||
Block.box(0, 2, 1, 8, 4, 15),
|
||||
Block.box(8, 10, 1, 16, 12, 15),
|
||||
Block.box(0, 0, 15, 16, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_RR_WEST = Stream.of(
|
||||
Block.box(8, 2, 1, 16, 4, 15),
|
||||
Block.box(0, 10, 1, 8, 12, 15),
|
||||
Block.box(0, 0, 0, 16, 21, 1)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
public static final RegistryObject<Block> STEEL_CATWALK_STAIRS_RR = registerWithItem(BLOCKS.register("steel_catwalk_stairs_rr", ()-> new RotatableBlockCustomVoxels(gratingBlock, STEEL_CATWALK_STAIRS_RR_NORTH, STEEL_CATWALK_STAIRS_RR_SOUTH, STEEL_CATWALK_STAIRS_RR_WEST, STEEL_CATWALK_STAIRS_RR_EAST)), new Item.Properties());
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_DR_NORTH = Stream.of(
|
||||
Block.box(1, 10, 0, 15, 12, 8),
|
||||
Block.box(1, 2, 8, 15, 4, 16),
|
||||
Block.box(0, 0, 0, 1, 21, 16),
|
||||
Block.box(15, 0, 0, 16, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_DR_SOUTH = Stream.of(
|
||||
Block.box(1, 10, 8, 15, 12, 16),
|
||||
Block.box(1, 2, 0, 15, 4, 8),
|
||||
Block.box(15, 0, 0, 16, 21, 16),
|
||||
Block.box(0, 0, 0, 1, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_DR_WEST = Stream.of(
|
||||
Block.box(8, 10, 1, 16, 12, 15),
|
||||
Block.box(0, 2, 1, 8, 4, 15),
|
||||
Block.box(0, 0, 0, 16, 21, 1),
|
||||
Block.box(0, 0, 15, 16, 21, 16)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
private static final VoxelShape STEEL_CATWALK_STAIRS_DR_EAST = Stream.of(
|
||||
Block.box(0, 10, 1, 8, 12, 15),
|
||||
Block.box(8, 2, 1, 16, 4, 15),
|
||||
Block.box(0, 0, 15, 16, 21, 16),
|
||||
Block.box(0, 0, 0, 16, 21, 1)
|
||||
).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get();
|
||||
|
||||
public static final RegistryObject<Block> STEEL_CATWALK_STAIRS_DR = registerWithItem(BLOCKS.register("steel_catwalk_stairs_dr", ()-> new RotatableBlockCustomVoxels(gratingBlock, STEEL_CATWALK_STAIRS_DR_NORTH, STEEL_CATWALK_STAIRS_DR_SOUTH, STEEL_CATWALK_STAIRS_DR_WEST, STEEL_CATWALK_STAIRS_DR_EAST)), new Item.Properties());
|
||||
|
||||
private static final VoxelShape STEEL_RAILING_NORTH = Block.box(0.25, 0.25, 0.25, 15.75, 16, 1.25);
|
||||
private static final VoxelShape STEEL_RAILING_SOUTH = Block.box(0.25, 0.25, 14.75, 15.75, 16, 15.75);
|
||||
|
||||
private static final VoxelShape STEEL_RAILING_WEST = Block.box(14.75, 0.25, 0.25, 15.75, 16, 15.75);
|
||||
private static final VoxelShape STEEL_RAILING_EAST = Block.box(0.25, 0.25, 0.25, 1.25, 16, 15.75);
|
||||
public static final RegistryObject<Block> STEEL_RAILING = registerWithItem(BLOCKS.register("steel_railing", ()->new RotatableBlockCustomVoxels(gratingBlock, STEEL_RAILING_NORTH, STEEL_RAILING_SOUTH, STEEL_RAILING_WEST, STEEL_RAILING_EAST)), new Item.Properties());
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package dev.zontreck.essentials.blocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.AbstractGlassBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class PartialTransparentBlock extends AbstractGlassBlock
|
||||
{
|
||||
protected PartialTransparentBlock(Properties p_48729_) {
|
||||
super(p_48729_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState p_48740_, BlockGetter p_48741_, BlockPos p_48742_) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package dev.zontreck.essentials.blocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.AbstractGlassBlock;
|
||||
import net.minecraft.world.level.block.SlabBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class PartialTransparentSlabBlock extends SlabBlock
|
||||
{
|
||||
protected PartialTransparentSlabBlock(Properties p_48729_) {
|
||||
super(p_48729_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState p_48740_, BlockGetter p_48741_, BlockPos p_48742_) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package dev.zontreck.essentials.blocks;
|
||||
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
|
||||
public class RotatableBlock extends HorizontalDirectionalBlock
|
||||
{
|
||||
protected RotatableBlock(Properties pProperties) {
|
||||
super(pProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) {
|
||||
super.createBlockStateDefinition(pBuilder);
|
||||
pBuilder.add(FACING);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext pContext) {
|
||||
return defaultBlockState().setValue(FACING, pContext.getHorizontalDirection());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package dev.zontreck.essentials.blocks;
|
||||
|
||||
import dev.zontreck.ariaslib.util.Maps;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class RotatableBlockCustomVoxels extends RotatableBlock
|
||||
{
|
||||
private Map<Direction, VoxelShape> rotatedShapes = new HashMap<>();
|
||||
|
||||
protected RotatableBlockCustomVoxels(Properties properties, VoxelShape north, VoxelShape south, VoxelShape east, VoxelShape west) {
|
||||
super(properties);
|
||||
rotatedShapes = Maps.of(new Maps.Entry<>(Direction.NORTH, north), new Maps.Entry<>(Direction.SOUTH, south), new Maps.Entry<>(Direction.WEST, west), new Maps.Entry<>(Direction.EAST, east), new Maps.Entry<>(Direction.NORTH, north), new Maps.Entry<>(Direction.DOWN, north));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||
Direction facing = state.getValue(FACING);
|
||||
return rotatedShapes.get(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState p_49928_, BlockGetter p_49929_, BlockPos p_49930_) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,467 @@
|
|||
package dev.zontreck.essentials.data;
|
||||
|
||||
import dev.zontreck.essentials.AriasEssentials;
|
||||
import dev.zontreck.essentials.blocks.ModBlocks;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.*;
|
||||
import net.minecraft.world.level.block.state.properties.*;
|
||||
import net.minecraftforge.client.model.generators.BlockStateProvider;
|
||||
import net.minecraftforge.client.model.generators.ConfiguredModel;
|
||||
import net.minecraftforge.client.model.generators.ModelFile;
|
||||
import net.minecraftforge.client.model.generators.VariantBlockStateBuilder;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class ModBlockStatesProvider extends BlockStateProvider {
|
||||
public ModBlockStatesProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
|
||||
super(output, AriasEssentials.MODID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerStatesAndModels() {
|
||||
|
||||
|
||||
ResourceLocation[] clinkerBlock = new ResourceLocation[]{
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_texture0"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_texture1"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_texture2"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_texture3"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_texture4"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_texture5"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_texture6"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_texture7")
|
||||
};
|
||||
ResourceLocation[] clinkerStainedBlock = new ResourceLocation[]{
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_stained_texture0"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_stained_texture1"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_stained_texture2"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_stained_texture3"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_stained_texture4"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_stained_texture5"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_stained_texture6"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/clinker_brick/clinker_brick_stained_texture7")
|
||||
};
|
||||
|
||||
ResourceLocation[] slagBricks = new ResourceLocation[]{
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/slag_brick/slag_brick_texture0"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/slag_brick/slag_brick_texture1"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/slag_brick/slag_brick_texture2"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/slag_brick/slag_brick_texture3"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/slag_brick/slag_brick_texture4"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/slag_brick/slag_brick_texture5"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/slag_brick/slag_brick_texture6"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/slag_brick/slag_brick_texture7")
|
||||
};
|
||||
|
||||
ResourceLocation[] rebarConcrete = new ResourceLocation[] {
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_texture0"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_texture1"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_texture2"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_texture3"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_texture4"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_texture5"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_texture6"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_texture7")
|
||||
};
|
||||
|
||||
ResourceLocation[] rebarConcreteTile = new ResourceLocation[] {
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_tile_texture0"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_tile_texture1"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_tile_texture2"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_tile_texture3"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_tile_texture4"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_tile_texture5"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_tile_texture6"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/concrete/rebar_concrete_tile_texture7")
|
||||
};
|
||||
|
||||
ResourceLocation[] panzerglass = new ResourceLocation[]{
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/glass/panzerglass_block_texture0"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/glass/panzerglass_block_texture1"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/glass/panzerglass_block_texture2"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/glass/panzerglass_block_texture3")
|
||||
};
|
||||
|
||||
ResourceLocation[] oldIndustrialWood = new ResourceLocation[]{
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/material/industrial_planks_texture0"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/material/industrial_planks_texture1"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/material/industrial_planks_texture2"),
|
||||
new ResourceLocation(AriasEssentials.MODID, "engineersdecor/material/industrial_planks_texture3"),
|
||||
};
|
||||
|
||||
variantCubeBlock(ModBlocks.CLINKER_BRICK_BLOCK, clinkerBlock);
|
||||
customSlabBlock(ModBlocks.CLINKER_BRICK_SLAB, clinkerBlock);
|
||||
customStairBlock(ModBlocks.CLINKER_BRICK_STAIRS, clinkerBlock);
|
||||
variantCubeBlock(ModBlocks.CLINKER_BRICK_STAINED_BLOCK, clinkerStainedBlock);
|
||||
customSlabBlock(ModBlocks.CLINKER_BRICK_STAINED_SLAB, clinkerStainedBlock);
|
||||
customStairBlock(ModBlocks.CLINKER_BRICK_STAINED_STAIRS, clinkerStainedBlock);
|
||||
|
||||
wallBlock(ModBlocks.CLINKER_BRICK_WALL, new ResourceLocation(AriasEssentials.MODID, "block/engineersdecor/clinker_brick/clinker_brick_wall0"));
|
||||
|
||||
variantCubeBlock(ModBlocks.SLAG_BRICK_BLOCK, slagBricks);
|
||||
customSlabBlock(ModBlocks.SLAG_BRICK_SLAB, slagBricks);
|
||||
customStairBlock(ModBlocks.SLAG_BRICK_STAIRS, slagBricks);
|
||||
wallBlock(ModBlocks.SLAG_BRICK_WALL, new ResourceLocation(AriasEssentials.MODID, "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(AriasEssentials.MODID, "block/" + rebarConcrete[0].getPath()));
|
||||
|
||||
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(AriasEssentials.MODID, "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(AriasEssentials.MODID, "block/engineersdecor/door/old_industrial_door_texture_bottom"), new ResourceLocation(AriasEssentials.MODID, "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(AriasEssentials.MODID, 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)
|
||||
{
|
||||
wallBlock((WallBlock) blk.get(), texture);
|
||||
var wallInv = models().wallInventory(name(blk.get()) + "_inventory", texture);
|
||||
|
||||
simpleBlockItem(blk.get(), wallInv);
|
||||
}
|
||||
|
||||
private void blockWithItem(RegistryObject<Block> blockRegistryObject) {
|
||||
simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get()));
|
||||
}
|
||||
|
||||
private void blockWithItem(RegistryObject<Block> blockRegistryObject, ModelFile model) {
|
||||
simpleBlockWithItem(blockRegistryObject.get(), model);
|
||||
}
|
||||
|
||||
private void stairBlock(RegistryObject<Block> blk, RegistryObject<Block> texture) {
|
||||
stairsBlock((StairBlock) blk.get(), blockTexture(texture.get()));
|
||||
simpleBlockItem(blk.get(), stairsModel(blk.get(), texture.get()));
|
||||
}
|
||||
|
||||
private void carpetBlock(RegistryObject<Block> blk, RegistryObject<Block> texture) {
|
||||
simpleBlockWithItem(blk.get(), carpetModel(blk.get(), texture.get()));
|
||||
}
|
||||
|
||||
private String name(Block block) {
|
||||
return this.key(block).getPath();
|
||||
}
|
||||
|
||||
private ResourceLocation key(Block block) {
|
||||
return ForgeRegistries.BLOCKS.getKey(block);
|
||||
}
|
||||
|
||||
public ModelFile stairsModel(Block block, Block texture) {
|
||||
return this.models().stairs(name(block), blockTexture(texture), blockTexture(texture), blockTexture(texture));
|
||||
}
|
||||
|
||||
public ModelFile carpetModel(Block block, Block texture) {
|
||||
return this.models().carpet(name(block), blockTexture(texture));
|
||||
}
|
||||
|
||||
public ModelFile slabModel(Block block, Block texture) {
|
||||
return this.models().slab(name(block), blockTexture(texture), blockTexture(texture), blockTexture(texture));
|
||||
}
|
||||
|
||||
private void slabBlock(RegistryObject<Block> blk, RegistryObject<Block> texture) {
|
||||
slabBlock((SlabBlock) blk.get(), blockTexture(texture.get()), blockTexture(texture.get()));
|
||||
simpleBlockItem(blk.get(), slabModel(blk.get(), texture.get()));
|
||||
}
|
||||
|
||||
private void customSlabBlock(RegistryObject<Block> blockId, ResourceLocation... variations) {
|
||||
VariantBlockStateBuilder builder = getVariantBuilder(blockId.get());
|
||||
|
||||
|
||||
AtomicReference<ModelFile> 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);
|
||||
else if(type == SlabType.BOTTOM)
|
||||
model = models().slab(name(blockId.get()) + "_model" + i + appendName, rss, rss, rss);
|
||||
else if(type == SlabType.DOUBLE)
|
||||
model = models().cubeAll(name(blockId.get()) + "_model" + i + appendName, rss);
|
||||
|
||||
|
||||
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 customStairBlock(RegistryObject<Block> blockId, ResourceLocation... variations) {
|
||||
VariantBlockStateBuilder builder = getVariantBuilder(blockId.get());
|
||||
ResourceLocation blockDefault = blockTexture(blockId.get());
|
||||
|
||||
|
||||
AtomicReference<ModelFile> 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
|
||||
);
|
||||
|
||||
if(inner)
|
||||
cubeModel = models().stairsInner(blockId.getId().getPath()+"_model"+i + modelName, rss, rss, rss);
|
||||
else if(!inner && !straight)
|
||||
cubeModel = models().stairsOuter(blockId.getId().getPath() + "_model"+i+modelName, rss, rss, rss);
|
||||
|
||||
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());
|
||||
}
|
||||
private void customTransparentSlabBlock(RegistryObject<Block> blockId, ResourceLocation... variations) {
|
||||
VariantBlockStateBuilder builder = getVariantBuilder(blockId.get());
|
||||
|
||||
|
||||
AtomicReference<ModelFile> 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<Block> blockId, ResourceLocation... variations) {
|
||||
VariantBlockStateBuilder builder = getVariantBuilder(blockId.get());
|
||||
ResourceLocation blockDefault = blockTexture(blockId.get());
|
||||
|
||||
|
||||
AtomicReference<ModelFile> 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());
|
||||
}
|
||||
|
||||
public void variantCubeBlock(RegistryObject<Block> blockId, ResourceLocation... variations) {
|
||||
VariantBlockStateBuilder builder = getVariantBuilder(blockId.get());
|
||||
ResourceLocation blockDefault = blockTexture(blockId.get());
|
||||
|
||||
ModelFile model0 = null;
|
||||
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
|
||||
);
|
||||
var cfgModel = ConfiguredModel.builder().modelFile(cubeModel).build();
|
||||
if(i==0)model0 = cubeModel;
|
||||
builder.partialState().addModels(cfgModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
simpleBlockItem(blockId.get(), model0);
|
||||
}
|
||||
|
||||
public void variantTransparentCubeBlock(RegistryObject<Block> 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);
|
||||
}
|
||||
}
|
28
src/main/java/dev/zontreck/essentials/data/ModDatagen.java
Normal file
28
src/main/java/dev/zontreck/essentials/data/ModDatagen.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package dev.zontreck.essentials.data;
|
||||
|
||||
|
||||
import dev.zontreck.essentials.AriasEssentials;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.data.event.GatherDataEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = AriasEssentials.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class ModDatagen
|
||||
{
|
||||
|
||||
@SubscribeEvent
|
||||
public static void gatherData(GatherDataEvent event)
|
||||
{
|
||||
DataGenerator gen = event.getGenerator();
|
||||
PackOutput output = gen.getPackOutput();
|
||||
|
||||
ExistingFileHelper helper = event.getExistingFileHelper();
|
||||
|
||||
gen.addProvider(true, new ModBlockStatesProvider(output, helper));
|
||||
gen.addProvider(true, new ModItemModelsProvider(output,helper));
|
||||
gen.addProvider(true, ModLootTablesProvider.create(output));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package dev.zontreck.essentials.data;
|
||||
|
||||
import dev.zontreck.essentials.AriasEssentials;
|
||||
import dev.zontreck.essentials.items.ModItems;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.client.model.generators.ItemModelBuilder;
|
||||
import net.minecraftforge.client.model.generators.ItemModelProvider;
|
||||
import net.minecraftforge.client.model.generators.ModelFile;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class ModItemModelsProvider extends ItemModelProvider
|
||||
{
|
||||
public ModItemModelsProvider(PackOutput output, ExistingFileHelper helper)
|
||||
{
|
||||
super(output, AriasEssentials.MODID, helper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerModels() {
|
||||
|
||||
item(ModItems.METAL_BAR);
|
||||
item(ModItems.TIME_IN_A_BOTTLE);
|
||||
|
||||
/*
|
||||
Engineer's Decor Items
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
DEPRECATED ITEMS
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ItemModelBuilder item(RegistryObject<Item> ite) {
|
||||
return this.item((ResourceLocation) Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(ite.get())));
|
||||
}
|
||||
|
||||
private ItemModelBuilder item(ResourceLocation item) {
|
||||
return (ItemModelBuilder)((ItemModelBuilder)((ItemModelBuilder)this.getBuilder(item.toString())).parent(new ModelFile.UncheckedModelFile("item/generated"))).texture("layer0", new ResourceLocation(item.getNamespace(), "item/" + item.getPath()));
|
||||
}
|
||||
private ItemModelBuilder deprecated(RegistryObject<Item> ite) {
|
||||
return this.deprecated((ResourceLocation) Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(ite.get())));
|
||||
}
|
||||
|
||||
private ItemModelBuilder deprecated(ResourceLocation item) {
|
||||
return (ItemModelBuilder)((ItemModelBuilder)((ItemModelBuilder)this.getBuilder(item.toString())).parent(new ModelFile.UncheckedModelFile("item/generated"))).texture("layer0", new ResourceLocation(item.getNamespace(), "item/deprecated"));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package dev.zontreck.essentials.data;
|
||||
|
||||
import dev.zontreck.essentials.data.loot.ModBlockLootTablesProvider;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.loot.LootTableProvider;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ModLootTablesProvider
|
||||
{
|
||||
public static LootTableProvider create(PackOutput output)
|
||||
{
|
||||
return new LootTableProvider(output, Set.of(), List.of(
|
||||
new LootTableProvider.SubProviderEntry(ModBlockLootTablesProvider::new, LootContextParamSets.BLOCK)
|
||||
));
|
||||
}
|
||||
}
|
7
src/main/java/dev/zontreck/essentials/data/README.md
Normal file
7
src/main/java/dev/zontreck/essentials/data/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
Datagen
|
||||
======
|
||||
____________
|
||||
|
||||
This is the datagen system for Aria's Essentials.
|
||||
|
||||
Please exercise caution when updating this, and test everything.
|
|
@ -0,0 +1,108 @@
|
|||
package dev.zontreck.essentials.data.loot;
|
||||
|
||||
import dev.zontreck.essentials.blocks.ModBlocks;
|
||||
import net.minecraft.data.loot.BlockLootSubProvider;
|
||||
import net.minecraft.world.flag.FeatureFlags;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.block.*;
|
||||
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.registries.RegistryObject;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class ModBlockLootTablesProvider extends BlockLootSubProvider
|
||||
{
|
||||
public ModBlockLootTablesProvider()
|
||||
{
|
||||
super(Set.of(), FeatureFlags.REGISTRY.allFlags());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generate() {
|
||||
|
||||
|
||||
/*
|
||||
Engineer's Decor Blocks
|
||||
*/
|
||||
dropSelf(ModBlocks.CLINKER_BRICK_BLOCK.get());
|
||||
dropSelf(ModBlocks.CLINKER_BRICK_RECESSED.get());
|
||||
dropSelf(ModBlocks.CLINKER_BRICK_VERTICALLY_SLIT.get());
|
||||
createSlabItemTable(ModBlocks.CLINKER_BRICK_SLAB);
|
||||
dropSelf(ModBlocks.CLINKER_BRICK_STAIRS.get());
|
||||
dropSelf(ModBlocks.CLINKER_BRICK_STAINED_BLOCK.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());
|
||||
createSlabItemTable(ModBlocks.SLAG_BRICK_SLAB);
|
||||
dropSelf(ModBlocks.SLAG_BRICK_WALL.get());
|
||||
dropSelf(ModBlocks.SLAG_BRICK_STAIRS.get());
|
||||
|
||||
dropSelf(ModBlocks.REBAR_CONCRETE_BLOCK.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());
|
||||
createSlabItemTable(ModBlocks.REBAR_CONCRETE_TILE_SLAB);
|
||||
dropSelf(ModBlocks.REBAR_CONCRETE_TILE_STAIRS.get());
|
||||
|
||||
dropSelf(ModBlocks.PANZER_GLASS_BLOCK.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;
|
||||
}
|
||||
|
||||
|
||||
protected LootTable.Builder createCopperOreDrops(Block block, Item rawOre) {
|
||||
return createSilkTouchDispatchTable(block, (LootPoolEntryContainer.Builder) this.applyExplosionDecay(block, LootItem.lootTableItem(rawOre).apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 5.0F))).apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE))));
|
||||
}
|
||||
|
||||
protected LootTable.Builder createOreDrop(Block block, Item rawOre) {
|
||||
return createSilkTouchDispatchTable(block, (LootPoolEntryContainer.Builder)this.applyExplosionDecay(block, LootItem.lootTableItem(rawOre).apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE))));
|
||||
}
|
||||
}
|
|
@ -17,4 +17,6 @@ public class ModItems
|
|||
}
|
||||
|
||||
public static RegistryObject<Item> TIME_IN_A_BOTTLE = CreativeModeTabs.addToAETab(REGISTRY.register("tiab", ()->new TimeBottle()));
|
||||
|
||||
public static RegistryObject<Item> METAL_BAR = CreativeModeTabs.addToAETab(REGISTRY.register("metal_bar", ()->new Item(new Item.Properties())));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue