use of net.minecraft.world.level.block.WeatheringCopper.WeatherState in project Create by Creators-of-Create.
the class CopperBlockSet method createEntry.
protected <T extends Block> BlockEntry<?> createEntry(AbstractRegistrate<?> registrate, Variant<T> variant, WeatherState state, boolean waxed) {
String name = "";
if (waxed) {
name += "waxed_";
}
name += getWeatherStatePrefix(state);
name += this.name;
String suffix = variant.getSuffix();
if (!suffix.equals(""))
name = Lang.nonPluralId(name);
name += suffix;
Supplier<Block> baseBlock = BASE_BLOCKS.get(state);
BlockBuilder<T, ?> builder = registrate.block(name, variant.getFactory(this, state, waxed)).initialProperties(() -> baseBlock.get()).loot((lt, block) -> variant.generateLootTable(lt, block, this, state, waxed)).blockstate((ctx, prov) -> variant.generateBlockState(ctx, prov, this, state, waxed)).recipe((c, p) -> variant.generateRecipes(entries.get(BlockVariant.INSTANCE)[state.ordinal()], c, p)).transform(AllTags.pickaxeOnly()).tag(BlockTags.NEEDS_STONE_TOOL).simpleItem();
if (variant == BlockVariant.INSTANCE && state == WeatherState.UNAFFECTED)
builder.recipe((c, p) -> mainBlockRecipe.accept(c, p));
if (waxed) {
builder.recipe((ctx, prov) -> {
Block unwaxed = get(variant, state, false).get();
ShapelessRecipeBuilder.shapeless(ctx.get()).requires(unwaxed).requires(Items.HONEYCOMB).unlockedBy("has_unwaxed", RegistrateRecipeProvider.has(unwaxed)).save(prov, new ResourceLocation(ctx.getId().getNamespace(), "crafting/" + generalDirectory + ctx.getName() + "_from_honeycomb"));
});
}
return builder.register();
}
Aggregations