Search in sources :

Example 1 with NonNullConsumer

use of com.tterrag.registrate.util.nullness.NonNullConsumer in project Create by Creators-of-Create.

the class WindowGen method connectedGlassPane.

private static BlockEntry<ConnectedGlassPaneBlock> connectedGlassPane(String name, Supplier<? extends Block> parent, Supplier<CTSpriteShiftEntry> ctshift, ResourceLocation sideTexture, ResourceLocation itemSideTexture, ResourceLocation topTexture, Supplier<Supplier<RenderType>> renderType) {
    NonNullConsumer<? super ConnectedGlassPaneBlock> connectedTextures = connectedTextures(() -> new GlassPaneCTBehaviour(ctshift.get()));
    String CGPparents = "block/connected_glass_pane/";
    String prefix = name + "_pane_";
    Function<RegistrateBlockstateProvider, ModelFile> post = getPaneModelProvider(CGPparents, prefix, "post", sideTexture, topTexture), side = getPaneModelProvider(CGPparents, prefix, "side", sideTexture, topTexture), sideAlt = getPaneModelProvider(CGPparents, prefix, "side_alt", sideTexture, topTexture), noSide = getPaneModelProvider(CGPparents, prefix, "noside", sideTexture, topTexture), noSideAlt = getPaneModelProvider(CGPparents, prefix, "noside_alt", sideTexture, topTexture);
    NonNullBiConsumer<DataGenContext<Block, ConnectedGlassPaneBlock>, RegistrateBlockstateProvider> stateProvider = (c, p) -> p.paneBlock(c.get(), post.apply(p), side.apply(p), sideAlt.apply(p), noSide.apply(p), noSideAlt.apply(p));
    return glassPane(name, parent, itemSideTexture, topTexture, ConnectedGlassPaneBlock::new, renderType, connectedTextures, stateProvider);
}
Also used : HorizontalCTBehaviour(com.simibubi.create.foundation.block.connected.HorizontalCTBehaviour) BlockEntry(com.tterrag.registrate.util.entry.BlockEntry) ResourceLocation(net.minecraft.resources.ResourceLocation) Tags(net.minecraftforge.common.Tags) ShapedRecipeBuilder(net.minecraft.data.recipes.ShapedRecipeBuilder) EntityType(net.minecraft.world.entity.EntityType) ModelFile(net.minecraftforge.client.model.generators.ModelFile) BlockState(net.minecraft.world.level.block.state.BlockState) ConnectedGlassBlock(com.simibubi.create.content.palettes.ConnectedGlassBlock) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Properties(net.minecraft.world.level.block.state.BlockBehaviour.Properties) RegistrateRecipeProvider(com.tterrag.registrate.providers.RegistrateRecipeProvider) BlockGetter(net.minecraft.world.level.BlockGetter) ConnectedGlassPaneBlock(com.simibubi.create.content.palettes.ConnectedGlassPaneBlock) CreateRegistrate.connectedTextures(com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures) Create(com.simibubi.create.Create) ItemLike(net.minecraft.world.level.ItemLike) BlockTags(net.minecraft.tags.BlockTags) AllSpriteShifts(com.simibubi.create.AllSpriteShifts) NonNullFunction(com.tterrag.registrate.util.nullness.NonNullFunction) DataGenContext(com.tterrag.registrate.providers.DataGenContext) WindowBlock(com.simibubi.create.content.palettes.WindowBlock) RenderType(net.minecraft.client.renderer.RenderType) RegistrateBlockstateProvider(com.tterrag.registrate.providers.RegistrateBlockstateProvider) DataIngredient(com.tterrag.registrate.util.DataIngredient) NonNullConsumer(com.tterrag.registrate.util.nullness.NonNullConsumer) Blocks(net.minecraft.world.level.block.Blocks) ConnectedTextureBehaviour(com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour) CTSpriteShiftEntry(com.simibubi.create.foundation.block.connected.CTSpriteShiftEntry) NonNullBiConsumer(com.tterrag.registrate.util.nullness.NonNullBiConsumer) BlockPos(net.minecraft.core.BlockPos) Block(net.minecraft.world.level.block.Block) WoodType(net.minecraft.world.level.block.state.properties.WoodType) GlassPaneCTBehaviour(com.simibubi.create.foundation.block.connected.GlassPaneCTBehaviour) GlassPaneBlock(com.simibubi.create.content.palettes.GlassPaneBlock) GlassPaneCTBehaviour(com.simibubi.create.foundation.block.connected.GlassPaneCTBehaviour) ModelFile(net.minecraftforge.client.model.generators.ModelFile) RegistrateBlockstateProvider(com.tterrag.registrate.providers.RegistrateBlockstateProvider) DataGenContext(com.tterrag.registrate.providers.DataGenContext) ConnectedGlassPaneBlock(com.simibubi.create.content.palettes.ConnectedGlassPaneBlock)

Aggregations

AllSpriteShifts (com.simibubi.create.AllSpriteShifts)1 Create (com.simibubi.create.Create)1 ConnectedGlassBlock (com.simibubi.create.content.palettes.ConnectedGlassBlock)1 ConnectedGlassPaneBlock (com.simibubi.create.content.palettes.ConnectedGlassPaneBlock)1 GlassPaneBlock (com.simibubi.create.content.palettes.GlassPaneBlock)1 WindowBlock (com.simibubi.create.content.palettes.WindowBlock)1 CTSpriteShiftEntry (com.simibubi.create.foundation.block.connected.CTSpriteShiftEntry)1 ConnectedTextureBehaviour (com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour)1 GlassPaneCTBehaviour (com.simibubi.create.foundation.block.connected.GlassPaneCTBehaviour)1 HorizontalCTBehaviour (com.simibubi.create.foundation.block.connected.HorizontalCTBehaviour)1 CreateRegistrate.connectedTextures (com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures)1 DataGenContext (com.tterrag.registrate.providers.DataGenContext)1 RegistrateBlockstateProvider (com.tterrag.registrate.providers.RegistrateBlockstateProvider)1 RegistrateRecipeProvider (com.tterrag.registrate.providers.RegistrateRecipeProvider)1 DataIngredient (com.tterrag.registrate.util.DataIngredient)1 BlockEntry (com.tterrag.registrate.util.entry.BlockEntry)1 NonNullBiConsumer (com.tterrag.registrate.util.nullness.NonNullBiConsumer)1 NonNullConsumer (com.tterrag.registrate.util.nullness.NonNullConsumer)1 NonNullFunction (com.tterrag.registrate.util.nullness.NonNullFunction)1 Function (java.util.function.Function)1