From 2095a43abc41a34074350dba50fb8b381d2dd0a7 Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Mon, 30 Dec 2024 12:41:36 +0200 Subject: [PATCH] add grass-like blockstate generator --- .../gcyr/common/data/GCYRModels.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/argent_matter/gcyr/common/data/GCYRModels.java b/src/main/java/argent_matter/gcyr/common/data/GCYRModels.java index 99b37914..485b8741 100644 --- a/src/main/java/argent_matter/gcyr/common/data/GCYRModels.java +++ b/src/main/java/argent_matter/gcyr/common/data/GCYRModels.java @@ -76,4 +76,28 @@ public static NonNullBiConsumer, RegistrateBlocksta }; } + public static NonNullBiConsumer, RegistrateBlockstateProvider> grassBlockModel(String name, + ResourceLocation bottomTexture) { + return grassBlockModel(name, + GCYR.id("block/" + name + "_side"), + bottomTexture, + GCYR.id("block/" + name + "_top")); + } + + public static NonNullBiConsumer, RegistrateBlockstateProvider> grassBlockModel(String name, + ResourceLocation sideTexture, + ResourceLocation bottomTexture, + ResourceLocation topTexture) { + return (ctx, prov) -> { + ModelFile base = prov.models().cubeBottomTop(name, sideTexture, bottomTexture, topTexture); + ConfiguredModel modelY0 = new ConfiguredModel(base, 0, 0, false); + ConfiguredModel modelY90 = new ConfiguredModel(base, 0, 90, false); + ConfiguredModel modelY180 = new ConfiguredModel(base, 0, 180, false); + ConfiguredModel modelY270 = new ConfiguredModel(base, 0, 270, false); + prov.getVariantBuilder(ctx.getEntry()) + .partialState() + .setModels(modelY0, modelY90, modelY180, modelY270); + }; + } + }