diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java index b51a9b26cf..8d8823a6e2 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java @@ -24,6 +24,7 @@ import com.gregtechceu.gtceu.common.pipelike.item.longdistance.LDItemPipeType; import com.gregtechceu.gtceu.common.pipelike.laser.LaserPipeType; import com.gregtechceu.gtceu.common.pipelike.optical.OpticalPipeType; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.core.mixins.BlockPropertiesAccessor; import com.gregtechceu.gtceu.data.recipe.CustomTags; import com.gregtechceu.gtceu.utils.SupplierMemoizer; @@ -76,10 +77,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; +import java.util.*; import java.util.function.Supplier; import static com.gregtechceu.gtceu.api.GTValues.*; @@ -220,9 +218,9 @@ private static void registerDuctPipeBlock(int index) { // Multiblock Machine Casing Blocks public static final BlockEntry CASING_WOOD_WALL = createSidedCasingBlock("wood_wall", GTCEu.id("block/casings/wood_wall")); - public static final BlockEntry CASING_COKE_BRICKS = createCasingBlock("coke_oven_bricks", + public static final BlockEntry CASING_COKE_BRICKS = createBrickCasingBlock("coke_oven_bricks", GTCEu.id("block/casings/solid/machine_coke_bricks")); - public static final BlockEntry CASING_PRIMITIVE_BRICKS = createCasingBlock("firebricks", + public static final BlockEntry CASING_PRIMITIVE_BRICKS = createBrickCasingBlock("firebricks", GTCEu.id("block/casings/solid/machine_primitive_bricks")); public static final BlockEntry CASING_BRONZE_BRICKS = createCasingBlock("steam_machine_casing", GTCEu.id("block/casings/solid/machine_casing_bronze_plated_bricks")); @@ -500,9 +498,32 @@ private static BlockEntry createSidedCasingBlock(String name, ResourceLoc .register(); } + private static BlockEntry createBrickCasingBlock(String name, ResourceLocation texture) { + // return createCasingBlock(name, GlassBlock::new, texture, () -> Blocks.GLASS, type); + NonNullFunction supplier = Block::new; + return REGISTRATE.block(name, supplier) + .initialProperties(() -> Blocks.IRON_BLOCK) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) + .addLayer(() -> RenderType::cutoutMipped) + .blockstate(GTModels.cubeAllModel(name, texture)) + .tag(BlockTags.MINEABLE_WITH_PICKAXE) + .item(BlockItem::new) + .build() + .register(); + } + private static BlockEntry createGlassCasingBlock(String name, ResourceLocation texture, Supplier> type) { - return createCasingBlock(name, GlassBlock::new, texture, () -> Blocks.GLASS, type); + NonNullFunction supplier = GlassBlock::new; + return REGISTRATE.block(name, supplier) + .initialProperties(() -> Blocks.GLASS) + .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) + .addLayer(type) + .blockstate(GTModels.cubeAllModel(name, texture)) + .tag(BlockTags.MINEABLE_WITH_PICKAXE) + .item(BlockItem::new) + .build() + .register(); } public static BlockEntry createCasingBlock(String name, ResourceLocation texture) { @@ -515,12 +536,16 @@ public static BlockEntry createCasingBlock(String name, ResourceLocation texture, NonNullSupplier properties, Supplier> type) { - return REGISTRATE.block(name, blockSupplier) + var builder = REGISTRATE.block(name, blockSupplier) .initialProperties(properties) .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(type) .blockstate(GTModels.cubeAllModel(name, texture)) - .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(BlockTags.MINEABLE_WITH_PICKAXE); + } + return builder .item(BlockItem::new) .build() .register(); @@ -528,15 +553,19 @@ public static BlockEntry createCasingBlock(String name, private static BlockEntry createMachineCasingBlock(int tier) { String tierName = GTValues.VN[tier].toLowerCase(Locale.ROOT); - BlockEntry entry = REGISTRATE + var builder = REGISTRATE .block("%s_machine_casing".formatted(tierName), Block::new) .lang("%s Machine Casing".formatted(GTValues.VN[tier])) .initialProperties(() -> Blocks.IRON_BLOCK) .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createMachineCasingModel(tierName)) - .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) - .item(BlockItem::new) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(BlockTags.MINEABLE_WITH_PICKAXE); + } + + BlockEntry entry = builder.item(BlockItem::new) .build() .register(); if (!GTCEuAPI.isHighTier() && tier > GTValues.UHV) { @@ -547,14 +576,19 @@ private static BlockEntry createMachineCasingBlock(int tier) { private static BlockEntry createHermeticCasing(int tier) { String tierName = GTValues.VN[tier].toLowerCase(Locale.ROOT); - BlockEntry entry = REGISTRATE + var builder = REGISTRATE .block("%s_hermetic_casing".formatted(tierName), Block::new) .lang("Hermetic Casing %s".formatted(GTValues.LVT[tier])) .initialProperties(() -> Blocks.IRON_BLOCK) .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createHermeticCasingModel(tierName)) - .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(BlockTags.MINEABLE_WITH_PICKAXE); + } + + BlockEntry entry = builder .item(BlockItem::new) .build() .register(); @@ -565,25 +599,33 @@ private static BlockEntry createHermeticCasing(int tier) { } private static BlockEntry createSteamCasing(String name, String material) { - return REGISTRATE.block(name, Block::new) + var builder = REGISTRATE.block(name, Block::new) .initialProperties(() -> Blocks.IRON_BLOCK) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createSteamCasingModel(name, material)) - .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) - .item(BlockItem::new) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(BlockTags.MINEABLE_WITH_PICKAXE); + } + + return builder.item(BlockItem::new) .build() .register(); } private static BlockEntry createCoilBlock(ICoilType coilType) { - BlockEntry coilBlock = REGISTRATE + var builder = REGISTRATE .block("%s_coil_block".formatted(coilType.getName()), p -> new CoilBlock(p, coilType)) .initialProperties(() -> Blocks.IRON_BLOCK) .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createCoilModel("%s_coil_block".formatted(coilType.getName()), coilType)) - .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) - .item(BlockItem::new) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(BlockTags.MINEABLE_WITH_PICKAXE); + } + + BlockEntry coilBlock = builder.item(BlockItem::new) .build() .register(); GTCEuAPI.HEATING_COILS.put(coilType, coilBlock); @@ -591,30 +633,39 @@ private static BlockEntry createCoilBlock(ICoilType coilType) { } private static BlockEntry createBatteryBlock(IBatteryData batteryData) { - BlockEntry batteryBlock = REGISTRATE.block("%s_battery".formatted(batteryData.getBatteryName()), + var builder = REGISTRATE.block("%s_battery".formatted(batteryData.getBatteryName()), p -> new BatteryBlock(p, batteryData)) .initialProperties(() -> Blocks.IRON_BLOCK) .properties(p -> p.isValidSpawn((state, level, pos, entityType) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createBatteryBlockModel("%s_battery".formatted(batteryData.getBatteryName()), batteryData)) - .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) - .item(BlockItem::new) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(BlockTags.MINEABLE_WITH_PICKAXE); + } + + BlockEntry batteryBlock = builder.item(BlockItem::new) .build() .register(); + GTCEuAPI.PSS_BATTERIES.put(batteryData, batteryBlock); return batteryBlock; } private static BlockEntry createFusionCasing(IFusionCasingType casingType) { - BlockEntry casingBlock = REGISTRATE + var builder = REGISTRATE .block(casingType.getSerializedName(), p -> new FusionCasingBlock(p, casingType)) .initialProperties(() -> Blocks.IRON_BLOCK) .properties(properties -> properties.strength(5.0f, 10.0f).sound(SoundType.METAL)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createFusionCasingModel(casingType.getSerializedName(), casingType)) - .tag(GTToolType.WRENCH.harvestTags.get(0), CustomTags.TOOL_TIERS[casingType.getHarvestLevel()]) - .item(BlockItem::new) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(CustomTags.TOOL_TIERS[casingType.getHarvestLevel()]); + } + + BlockEntry casingBlock = builder.item(BlockItem::new) .build() .register(); ALL_FUSION_CASINGS.put(casingType, casingBlock); @@ -622,13 +673,17 @@ private static BlockEntry createFusionCasing(IFusionCasingTyp } private static BlockEntry createCleanroomFilter(IFilterType filterType) { - var filterBlock = REGISTRATE.block(filterType.getSerializedName(), Block::new) + var builder = REGISTRATE.block(filterType.getSerializedName(), Block::new) .initialProperties(() -> Blocks.IRON_BLOCK) .properties(properties -> properties.strength(2.0f, 8.0f).sound(SoundType.METAL) .isValidSpawn((blockState, blockGetter, blockPos, entityType) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createCleanroomFilterModel(filterType.getSerializedName(), filterType)) - .tag(GTToolType.WRENCH.harvestTags.get(0), CustomTags.TOOL_TIERS[1]) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(CustomTags.TOOL_TIERS[1]); + } + var filterBlock = builder .item(BlockItem::new) .build() .register(); @@ -637,26 +692,32 @@ private static BlockEntry createCleanroomFilter(IFilterType filterType) { } protected static BlockEntry createActiveCasing(String name, String baseModelPath) { - return REGISTRATE.block(name, ActiveBlock::new) + var builder = REGISTRATE.block(name, ActiveBlock::new) .initialProperties(() -> Blocks.IRON_BLOCK) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createActiveModel(GTCEu.id(baseModelPath))) - .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) - .item(BlockItem::new) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(BlockTags.MINEABLE_WITH_PICKAXE); + } + return builder.item(BlockItem::new) .model((ctx, prov) -> prov.withExistingParent(prov.name(ctx), GTCEu.id(baseModelPath))) .build() .register(); } private static BlockEntry createFireboxCasing(BoilerFireboxType type) { - BlockEntry block = REGISTRATE + var builder = REGISTRATE .block("%s_casing".formatted(type.name()), ActiveBlock::new) .initialProperties(() -> Blocks.IRON_BLOCK) .properties(p -> p.isValidSpawn((state, level, pos, ent) -> false)) .addLayer(() -> RenderType::cutoutMipped) .blockstate(GTModels.createFireboxModel("%s_casing".formatted(type.name()), type)) - .tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE) - .item(BlockItem::new) + .tag(GTToolType.WRENCH.harvestTags.get(0)); + if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { + builder.tag(BlockTags.MINEABLE_WITH_PICKAXE); + } + BlockEntry block = builder.item(BlockItem::new) .build() .register(); ALL_FIREBOXES.put(type, block); diff --git a/src/main/java/com/gregtechceu/gtceu/data/lang/BlockLang.java b/src/main/java/com/gregtechceu/gtceu/data/lang/BlockLang.java index ec5fffe40b..f8e1b3a0d4 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/lang/BlockLang.java +++ b/src/main/java/com/gregtechceu/gtceu/data/lang/BlockLang.java @@ -46,13 +46,14 @@ private static void initCasingLang(RegistrateLangProvider provider) { replace(provider, "block.gtceu.inert_machine_casing", "Chemically Inert PTFE Machine Casing"); replace(provider, "block.gtceu.sturdy_machine_casing", "Sturdy HSS-E Machine Casing"); replace(provider, "block.gtceu.casing_grate", "Grate Machine Casing"); - replace(provider, "block.gtceu.assembly_line_unit", "Assembly Control Casing"); + replace(provider, "block.gtceu.assembly_line_unit", "Assembly Line Casing"); replace(provider, "block.gtceu.ptfe_pipe_casing", "PTFE Pipe Casing"); replace(provider, "block.gtceu.bronze_gearbox", "Bronze Gearbox Casing"); replace(provider, "block.gtceu.steel_gearbox", "Steel Gearbox Casing"); replace(provider, "block.gtceu.stainless_steel_gearbox", "Stainless Steel Gearbox Casing"); replace(provider, "block.gtceu.titanium_gearbox", "Titanium Gearbox Casing"); replace(provider, "block.gtceu.tungstensteel_gearbox", "Tungstensteel Gearbox Casing"); + replace(provider, "block.gtceu.steel_turbine_casing", "Magnalium Turbine Casing"); replace(provider, "block.gtceu.titanium_turbine_casing", "Titanium Turbine Casing"); replace(provider, "block.gtceu.stainless_steel_turbine_casing", "Stainless Turbine Casing"); replace(provider, "block.gtceu.tungstensteel_turbine_casing", "Tungstensteel Turbine Casing"); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java index 9da21d0b69..31ee0e24ca 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MachineRecipeLoader.java @@ -726,6 +726,39 @@ private static void registerAssemblerRecipes(Consumer provider) .inputFluids(Polytetrafluoroethylene.getFluid(216)).circuitMeta(6) .outputItems(GTBlocks.CASING_PTFE_INERT.asStack()).duration(50).save(provider); + ASSEMBLER_RECIPES.recipeBuilder("casing_bronze_firebox") + .inputItems(rod, Bronze, 3) + .inputItems(frameGt, Bronze) + .inputItems(plate, Bronze, 3) + .outputItems(GTBlocks.FIREBOX_BRONZE, 2) + .duration(100) + .EUt(VA[LV]) + .save(provider); + ASSEMBLER_RECIPES.recipeBuilder("casing_steel_firebox") + .inputItems(rod, Steel, 3) + .inputItems(frameGt, Steel) + .inputItems(plate, Steel, 3) + .outputItems(GTBlocks.FIREBOX_STEEL, 2) + .duration(200) + .EUt(VA[LV]) + .save(provider); + ASSEMBLER_RECIPES.recipeBuilder("casing_titanium_firebox") + .inputItems(rod, Titanium, 3) + .inputItems(frameGt, Titanium) + .inputItems(plate, Titanium, 3) + .outputItems(GTBlocks.FIREBOX_TITANIUM, 2) + .duration(300) + .EUt(VA[HV]) + .save(provider); + ASSEMBLER_RECIPES.recipeBuilder("casing_tungstensteel_firebox") + .inputItems(rod, TungstenSteel, 3) + .inputItems(frameGt, TungstenSteel) + .inputItems(plate, TungstenSteel, 3) + .outputItems(GTBlocks.FIREBOX_TUNGSTENSTEEL, 2) + .duration(400) + .EUt(VA[EV]) + .save(provider); + ASSEMBLER_RECIPES.recipeBuilder("superconducting_coil_luv").EUt(VA[LuV]) .inputItems(wireGtDouble, IndiumTinBariumTitaniumCuprate, 32).inputItems(foil, NiobiumTitanium, 32) .inputFluids(Trinium.getFluid(GTValues.L * 24)).outputItems(GTBlocks.SUPERCONDUCTING_COIL.asStack()) @@ -786,6 +819,38 @@ private static void registerAssemblerRecipes(Consumer provider) GTBlocks.CASING_TUNGSTENSTEEL_TURBINE.asStack(ConfigHolder.INSTANCE.recipes.casingsPerCraft)) .duration(50).save(provider); + ASSEMBLER_RECIPES.recipeBuilder("casing_grate_casing") + .inputItems(Items.IRON_BARS, 6) + .inputItems(frameGt, Steel) + .inputItems(ELECTRIC_MOTOR_MV) + .inputItems(rotor, Steel) + .outputItems(GTBlocks.CASING_GRATE, ConfigHolder.INSTANCE.recipes.casingsPerCraft) + .duration(800) + .EUt(VA[IV]) + .save(provider); + + ASSEMBLER_RECIPES.recipeBuilder("assembly_line_casing") + .inputItems(gear, Ruridit, 2) + .inputItems(plate, Steel, 4) + .inputItems(ROBOT_ARM_IV, 2) + .inputItems(frameGt, TungstenSteel) + .outputItems(GTBlocks.CASING_ASSEMBLY_LINE, ConfigHolder.INSTANCE.recipes.casingsPerCraft) + .duration(650) + .EUt(VA[IV]) + .save(provider); + + ASSEMBLER_RECIPES.recipeBuilder("assembly_control_casing") + .inputItems(HIGH_POWER_INTEGRATED_CIRCUIT) + .inputItems(CustomTags.EV_CIRCUITS, 4) + .inputItems(SENSOR_IV) + .inputItems(EMITTER_IV) + .inputItems(ELECTRIC_MOTOR_IV) + .inputItems(frameGt, TungstenSteel) + .outputItems(GTBlocks.CASING_ASSEMBLY_CONTROL, ConfigHolder.INSTANCE.recipes.casingsPerCraft) + .duration(650) + .EUt(VA[IV]) + .save(provider); + ASSEMBLER_RECIPES.recipeBuilder("plascrete").EUt(48).inputItems(frameGt, Steel) .inputItems(plate, Polyethylene, 6).inputFluids(Concrete.getFluid(L)) .outputItems(GTBlocks.PLASTCRETE.asStack(2)).duration(200).save(provider); diff --git a/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java b/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java index 489d6267ba..16acba2a0a 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java @@ -3,6 +3,7 @@ import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper; import com.gregtechceu.gtceu.api.data.chemical.material.Material; import com.gregtechceu.gtceu.api.data.tag.TagPrefix; +import com.gregtechceu.gtceu.common.data.GTBlocks; import com.gregtechceu.gtceu.common.data.GTMachines; import com.gregtechceu.gtceu.common.data.GTMaterials; import com.gregtechceu.gtceu.data.recipe.CustomTags; @@ -14,6 +15,7 @@ import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; +import net.minecraftforge.common.Tags; import com.tterrag.registrate.providers.RegistrateTagsProvider; @@ -32,6 +34,8 @@ public static void init(RegistrateTagsProvider provider) { Blocks.BLUE_CONCRETE_POWDER, Blocks.BROWN_CONCRETE_POWDER, Blocks.GREEN_CONCRETE_POWDER, Blocks.RED_CONCRETE_POWDER, Blocks.BLACK_CONCRETE_POWDER); create(provider, CustomTags.ENDSTONE_ORE_REPLACEABLES, Blocks.END_STONE); + create(provider, Tags.Blocks.STORAGE_BLOCKS, Blocks.NETHER_BRICKS, + GTBlocks.CASING_PRIMITIVE_BRICKS.get(), GTBlocks.CASING_COKE_BRICKS.get()); create(provider, BlockTags.REPLACEABLE, GTMaterials.Oil.getFluid().defaultFluidState().createLegacyBlock().getBlock(),