From af62599a1e9ecb0efb77b3fc64675d3dd3aceff4 Mon Sep 17 00:00:00 2001 From: 90 <90@national.shitposting.agency> Date: Mon, 19 Dec 2022 21:34:03 +0000 Subject: [PATCH] Fix stone-cutting recipes for sky stone blocks (#6843) * Fix stone-cutting recipes for sky stone blocks * Fix stone-cutting recipes for sky stone blocks * Remove unnecessary SkyStoneBlock class --- .../appeng/core/definitions/AEBlocks.java | 11 ++--- .../recipes/DecorationBlockRecipes.java | 38 +++++++++++------- .../decorative/solid/SkyStoneBlock.java | 40 ------------------- 3 files changed, 27 insertions(+), 62 deletions(-) delete mode 100644 src/main/java/appeng/decorative/solid/SkyStoneBlock.java diff --git a/src/main/java/appeng/core/definitions/AEBlocks.java b/src/main/java/appeng/core/definitions/AEBlocks.java index bb1a4efff06..64188df263e 100644 --- a/src/main/java/appeng/core/definitions/AEBlocks.java +++ b/src/main/java/appeng/core/definitions/AEBlocks.java @@ -98,8 +98,6 @@ import appeng.decorative.solid.QuartzGlassBlock; import appeng.decorative.solid.QuartzLampBlock; import appeng.decorative.solid.QuartzPillarBlock; -import appeng.decorative.solid.SkyStoneBlock; -import appeng.decorative.solid.SkyStoneBlock.SkystoneType; /** * Internal implementation for the API blocks @@ -144,12 +142,11 @@ public final class AEBlocks { public static final BlockDefinition QUARTZ_FIXTURE = block("Charged Quartz Fixture", AEBlockIds.QUARTZ_FIXTURE, QuartzFixtureBlock::new); public static final BlockDefinition FLUIX_BLOCK = block("Fluix Block", AEBlockIds.FLUIX_BLOCK, () -> new AEDecorativeBlock(QUARTZ_PROPERTIES)); - public static final BlockDefinition SKY_STONE_BLOCK = block("Sky Stone", AEBlockIds.SKY_STONE_BLOCK, () -> new SkyStoneBlock(SkystoneType.STONE, - defaultProps(Material.STONE).strength(50, 150).requiresCorrectToolForDrops())); + public static final BlockDefinition SKY_STONE_BLOCK = block("Sky Stone", AEBlockIds.SKY_STONE_BLOCK, () -> new AEDecorativeBlock(defaultProps(Material.STONE).strength(50, 150).requiresCorrectToolForDrops())); - public static final BlockDefinition SMOOTH_SKY_STONE_BLOCK = block("Sky Stone Block", AEBlockIds.SMOOTH_SKY_STONE_BLOCK, () -> new SkyStoneBlock(SkystoneType.BLOCK, SKYSTONE_PROPERTIES)); - public static final BlockDefinition SKY_STONE_BRICK = block("Sky Stone Brick", AEBlockIds.SKY_STONE_BRICK, () -> new SkyStoneBlock(SkystoneType.BRICK, SKYSTONE_PROPERTIES)); - public static final BlockDefinition SKY_STONE_SMALL_BRICK = block("Sky Stone Small Brick", AEBlockIds.SKY_STONE_SMALL_BRICK, () -> new SkyStoneBlock(SkystoneType.SMALL_BRICK, SKYSTONE_PROPERTIES)); + public static final BlockDefinition SMOOTH_SKY_STONE_BLOCK = block("Sky Stone Block", AEBlockIds.SMOOTH_SKY_STONE_BLOCK, () -> new AEDecorativeBlock(SKYSTONE_PROPERTIES)); + public static final BlockDefinition SKY_STONE_BRICK = block("Sky Stone Brick", AEBlockIds.SKY_STONE_BRICK, () -> new AEDecorativeBlock(SKYSTONE_PROPERTIES)); + public static final BlockDefinition SKY_STONE_SMALL_BRICK = block("Sky Stone Small Brick", AEBlockIds.SKY_STONE_SMALL_BRICK, () -> new AEDecorativeBlock(SKYSTONE_PROPERTIES)); public static final BlockDefinition SKY_STONE_CHEST = block("Sky Stone Chest", AEBlockIds.SKY_STONE_CHEST, () -> new SkyChestBlock(SkyChestBlock.SkyChestType.STONE, SKY_STONE_CHEST_PROPS)); public static final BlockDefinition SMOOTH_SKY_STONE_CHEST = block("Sky Stone Block Chest", AEBlockIds.SMOOTH_SKY_STONE_CHEST, () -> new SkyChestBlock(SkyChestBlock.SkyChestType.BLOCK, SKY_STONE_CHEST_PROPS)); diff --git a/src/main/java/appeng/datagen/providers/recipes/DecorationBlockRecipes.java b/src/main/java/appeng/datagen/providers/recipes/DecorationBlockRecipes.java index f9229eada4c..fd872051f6b 100644 --- a/src/main/java/appeng/datagen/providers/recipes/DecorationBlockRecipes.java +++ b/src/main/java/appeng/datagen/providers/recipes/DecorationBlockRecipes.java @@ -55,8 +55,29 @@ public void buildRecipes(Consumer consumer) { crystalBlock(consumer, AEItems.CERTUS_QUARTZ_CRYSTAL, AEBlocks.QUARTZ_BLOCK); crystalBlock(consumer, AEItems.FLUIX_CRYSTAL, AEBlocks.FLUIX_BLOCK); - skyStoneBlock(consumer, AEBlocks.SMOOTH_SKY_STONE_BLOCK, AEBlocks.SKY_STONE_BRICK); - skyStoneBlock(consumer, AEBlocks.SKY_STONE_BRICK, AEBlocks.SKY_STONE_SMALL_BRICK); + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, AEBlocks.SKY_STONE_BRICK, 4) + .pattern("aa") + .pattern("aa") + .define('a', AEBlocks.SMOOTH_SKY_STONE_BLOCK) + .unlockedBy(criterionName(AEBlocks.SMOOTH_SKY_STONE_BLOCK), has(AEBlocks.SMOOTH_SKY_STONE_BLOCK)) + .save(consumer, AppEng.makeId("decorative/sky_stone_brick")); + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, AEBlocks.SKY_STONE_SMALL_BRICK, 4) + .pattern("aa") + .pattern("aa") + .define('a', AEBlocks.SKY_STONE_BRICK) + .unlockedBy(criterionName(AEBlocks.SKY_STONE_BRICK), has(AEBlocks.SKY_STONE_BRICK)) + .save(consumer, AppEng.makeId("decorative/sky_stone_small_brick")); + + SingleItemRecipeBuilder + .stonecutting(Ingredient.of(AEBlocks.SMOOTH_SKY_STONE_BLOCK), RecipeCategory.MISC, + AEBlocks.SKY_STONE_BRICK) + .unlockedBy(criterionName(AEBlocks.SMOOTH_SKY_STONE_BLOCK), has(AEBlocks.SMOOTH_SKY_STONE_BLOCK)) + .save(consumer, AppEng.makeId("decorative/sky_stone_brick_from_stonecutting")); + SingleItemRecipeBuilder + .stonecutting(Ingredient.of(AEBlocks.SMOOTH_SKY_STONE_BLOCK), RecipeCategory.MISC, + AEBlocks.SKY_STONE_SMALL_BRICK) + .unlockedBy(criterionName(AEBlocks.SMOOTH_SKY_STONE_BLOCK), has(AEBlocks.SMOOTH_SKY_STONE_BLOCK)) + .save(consumer, AppEng.makeId("decorative/sky_stone_small_brick_from_stonecutting")); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, AEBlocks.CUT_QUARTZ_BLOCK, 4) .pattern("aa") @@ -148,17 +169,4 @@ private void crystalBlock(Consumer consumer, ItemDefinition c .unlockedBy(criterionName(crystal), has(crystal)) .save(consumer, AppEng.makeId("decorative/" + block.id().getPath())); } - - private void skyStoneBlock(Consumer consumer, BlockDefinition input, BlockDefinition output) { - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, output, 4) - .pattern("aa") - .pattern("aa") - .define('a', input) - .unlockedBy(criterionName(input), has(input)) - .save(consumer, AppEng.makeId("decorative/" + output.id().getPath())); - SingleItemRecipeBuilder.stonecutting(Ingredient.of(input), RecipeCategory.MISC, output) - .unlockedBy(criterionName(input), has(input)) - .save(consumer, AppEng.makeId("decorative/" + output.id().getPath() + "_from_stonecutting")); - } - } diff --git a/src/main/java/appeng/decorative/solid/SkyStoneBlock.java b/src/main/java/appeng/decorative/solid/SkyStoneBlock.java deleted file mode 100644 index bd1767bea19..00000000000 --- a/src/main/java/appeng/decorative/solid/SkyStoneBlock.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.decorative.solid; - -import net.minecraft.world.level.block.state.BlockBehaviour; - -import appeng.block.AEBaseBlock; - -public class SkyStoneBlock extends AEBaseBlock { - private final SkystoneType type; - - public SkyStoneBlock(SkystoneType type, BlockBehaviour.Properties props) { - super(props); - this.type = type; - } - - public SkystoneType getType() { - return type; - } - - public enum SkystoneType { - STONE, BLOCK, BRICK, SMALL_BRICK - } -}