From a70f2569d696c7fab0088c11fbe7457496197d92 Mon Sep 17 00:00:00 2001 From: Shane Clark Date: Wed, 2 Mar 2022 12:24:28 -0700 Subject: [PATCH] Fix block breaking issues. --- gradle.properties | 2 +- .../steampowered/registrate/SPBlocks.java | 22 +++++++++++++++++ .../minecraft/tags/blocks/minable/axe.json | 8 +++++++ .../tags/blocks/minable/pickaxe.json | 24 +++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/data/minecraft/tags/blocks/minable/axe.json create mode 100644 src/main/resources/data/minecraft/tags/blocks/minable/pickaxe.json diff --git a/gradle.properties b/gradle.properties index 0a0c4f7..c9e52d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false # mod version info -mod_version = 2.0.0-alpha +mod_version = 2.0.1-alpha minecraft_version = 1.18.1 forge_version = 39.0.79 diff --git a/src/main/java/com/teammoeg/steampowered/registrate/SPBlocks.java b/src/main/java/com/teammoeg/steampowered/registrate/SPBlocks.java index 8dd16a3..4e760b0 100644 --- a/src/main/java/com/teammoeg/steampowered/registrate/SPBlocks.java +++ b/src/main/java/com/teammoeg/steampowered/registrate/SPBlocks.java @@ -19,6 +19,9 @@ package com.teammoeg.steampowered.registrate; import static com.simibubi.create.foundation.data.ModelGen.customItemModel; +import static com.simibubi.create.AllTags.axeOnly; +import static com.simibubi.create.AllTags.axeOrPickaxe; +import static com.simibubi.create.AllTags.pickaxeOnly; import javax.annotation.Nonnull; @@ -60,60 +63,70 @@ public class SPBlocks { public static final BlockEntry BRONZE_BURNER = REGISTRATE.block("bronze_burner", BronzeBurnerBlock::new) .initialProperties(SharedProperties::softMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry CAST_IRON_BURNER = REGISTRATE.block("cast_iron_burner", CastIronBurnerBlock::new) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry STEEL_BURNER = REGISTRATE.block("steel_burner", SteelBurnerBlock::new) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry BRONZE_BOILER = REGISTRATE.block("bronze_boiler", BronzeBoilerBlock::new) .initialProperties(SharedProperties::softMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry CAST_IRON_BOILER = REGISTRATE.block("cast_iron_boiler", CastIronBoilerBlock::new) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry STEEL_BOILER = REGISTRATE.block("steel_boiler", SteelBoilerBlock::new) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry BRONZE_STEAM_ENGINE = REGISTRATE.block("bronze_steam_engine", BronzeSteamEngineBlock::new) .initialProperties(SharedProperties::softMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry CAST_IRON_STEAM_ENGINE = REGISTRATE.block("cast_iron_steam_engine", CastIronSteamEngineBlock::new) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry STEEL_STEAM_ENGINE = REGISTRATE.block("steel_steam_engine", SteelSteamEngineBlock::new) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .item() .transform(customItemModel()) .register(); public static final BlockEntry STEEL_COGWHEEL = REGISTRATE.block("steel_cogwheel", MetalCogwheelBlock::small) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .transform(BlockStressDefaults.setNoImpact()) .properties(p -> p.sound(SoundType.METAL)) .blockstate(BlockStateGen.axisBlockProvider(false)) @@ -124,6 +137,7 @@ public class SPBlocks { public static final BlockEntry STEEL_LARGE_COGWHEEL = REGISTRATE.block("steel_large_cogwheel", MetalCogwheelBlock::large) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .transform(BlockStressDefaults.setNoImpact()) .properties(p -> p.sound(SoundType.METAL)) .blockstate(BlockStateGen.axisBlockProvider(false)) @@ -134,6 +148,7 @@ public class SPBlocks { public static final BlockEntry CAST_IRON_COGWHEEL = REGISTRATE.block("cast_iron_cogwheel", MetalCogwheelBlock::small) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .transform(BlockStressDefaults.setNoImpact()) .properties(p -> p.sound(SoundType.METAL)) .blockstate(BlockStateGen.axisBlockProvider(false)) @@ -144,6 +159,7 @@ public class SPBlocks { public static final BlockEntry CAST_IRON_LARGE_COGWHEEL = REGISTRATE.block("cast_iron_large_cogwheel", MetalCogwheelBlock::large) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .transform(BlockStressDefaults.setNoImpact()) .properties(p -> p.sound(SoundType.METAL)) .blockstate(BlockStateGen.axisBlockProvider(false)) @@ -154,6 +170,7 @@ public class SPBlocks { public static final BlockEntry BRONZE_COGWHEEL = REGISTRATE.block("bronze_cogwheel", MetalCogwheelBlock::small) .initialProperties(SharedProperties::softMetal) + .transform(pickaxeOnly()) .transform(BlockStressDefaults.setNoImpact()) .properties(p -> p.sound(SoundType.METAL)) .blockstate(BlockStateGen.axisBlockProvider(false)) @@ -164,6 +181,7 @@ public class SPBlocks { public static final BlockEntry BRONZE_LARGE_COGWHEEL = REGISTRATE.block("bronze_large_cogwheel", MetalCogwheelBlock::large) .initialProperties(SharedProperties::softMetal) + .transform(pickaxeOnly()) .transform(BlockStressDefaults.setNoImpact()) .properties(p -> p.sound(SoundType.METAL)) .blockstate(BlockStateGen.axisBlockProvider(false)) @@ -174,6 +192,7 @@ public class SPBlocks { public static final BlockEntry DYNAMO = REGISTRATE.block("alternator", DynamoBlock::new) .initialProperties(SPBlocks::hardMetal) + .transform(pickaxeOnly()) .transform(BlockStressDefaults.setImpact(4.0)) .tag(AllTags.AllBlockTags.SAFE_NBT.tag) //Dono what this tag means (contraption safe?). .item() @@ -183,6 +202,7 @@ public class SPBlocks { public static final BlockEntry BRONZE_FLYWHEEL = REGISTRATE.block("bronze_flywheel", BronzeSteamFlywheelBlock::new) .initialProperties(SharedProperties::softMetal) .properties(BlockBehaviour.Properties::noOcclusion) + .transform(axeOrPickaxe()) .transform(BlockStressDefaults.setNoImpact()) .blockstate(new FlywheelGenerator()::generate) .item() @@ -192,6 +212,7 @@ public class SPBlocks { public static final BlockEntry CAST_IRON_FLYWHEEL = REGISTRATE.block("cast_iron_flywheel", CastIronSteamFlywheelBlock::new) .initialProperties(SPBlocks::hardMetal) .properties(BlockBehaviour.Properties::noOcclusion) + .transform(axeOrPickaxe()) .transform(BlockStressDefaults.setNoImpact()) .blockstate(new FlywheelGenerator()::generate) .item() @@ -201,6 +222,7 @@ public class SPBlocks { public static final BlockEntry STEEL_FLYWHEEL = REGISTRATE.block("steel_flywheel", SteelSteamFlywheelBlock::new) .initialProperties(SPBlocks::hardMetal) .properties(BlockBehaviour.Properties::noOcclusion) + .transform(axeOrPickaxe()) .transform(BlockStressDefaults.setNoImpact()) .blockstate(new FlywheelGenerator()::generate) .item() diff --git a/src/main/resources/data/minecraft/tags/blocks/minable/axe.json b/src/main/resources/data/minecraft/tags/blocks/minable/axe.json new file mode 100644 index 0000000..29ba317 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/minable/axe.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "steampowered:bronze_flywheel", + "steampowered:cast_iron_flywheel", + "steampowered:steel_flywheel" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/minable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/minable/pickaxe.json new file mode 100644 index 0000000..78cfc38 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/minable/pickaxe.json @@ -0,0 +1,24 @@ +{ + "replace": false, + "values": [ + "steampowered:bronze_burner", + "steampowered:cast_iron_burner", + "steampowered:steel_burner", + "steampowered:bronze_boiler", + "steampowered:cast_iron_boiler", + "steampowered:steel_boiler", + "steampowered:bronze_steam_engine", + "steampowered:cast_iron_steam_engine", + "steampowered:steel_steam_engine", + "steampowered:steel_cogwheel", + "steampowered:steel_large_cogwheel", + "steampowered:cast_iron_cogwheel", + "steampowered:cast_iron_large_cogwheel", + "steampowered:bronze_cogwheel", + "steampowered:bronze_large_cogwheel", + "steampowered:alternator", + "steampowered:bronze_flywheel", + "steampowered:cast_iron_flywheel", + "steampowered:steel_flywheel" + ] +} \ No newline at end of file