Skip to content

Commit 483f997

Browse files
committed
make reduced destroy effects a tag
1 parent d00ec62 commit 483f997

File tree

10 files changed

+98
-121
lines changed

10 files changed

+98
-121
lines changed

src/main/java/com/simibubi/create/AllBlocks.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@
258258
import com.simibubi.create.foundation.block.DyedBlockList;
259259
import com.simibubi.create.foundation.block.ItemUseOverrides;
260260
import com.simibubi.create.foundation.block.WrenchableDirectionalBlock;
261-
import com.simibubi.create.foundation.block.render.ReducedDestroyEffects;
262261
import com.simibubi.create.foundation.data.AssetLookup;
263262
import com.simibubi.create.foundation.data.BlockStateGen;
264263
import com.simibubi.create.foundation.data.BuilderTransformers;
@@ -317,6 +316,7 @@
317316

318317
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
319318
import net.fabricmc.fabric.api.registry.FuelRegistry;
319+
import net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags;
320320

321321
import io.github.fabricators_of_create.porting_lib.models.generators.ConfiguredModel;
322322
import io.github.fabricators_of_create.porting_lib.models.generators.ModelFile;
@@ -537,7 +537,7 @@ public class AllBlocks {
537537
.transform(CStress.setNoImpact())
538538
.transform(displaySource(AllDisplaySources.ITEM_NAMES))
539539
.onRegister(CreateRegistrate.blockModel(() -> BeltModel::new))
540-
.clientExtension(() -> () -> new BeltBlock.RenderProperties())
540+
.tag(AllBlockTags.HAS_REDUCED_DESTROY_EFFECTS.tag)
541541
.register();
542542

543543
public static final BlockEntry<ChainConveyorBlock> CHAIN_CONVEYOR =
@@ -818,7 +818,7 @@ public class AllBlocks {
818818
.isRedstoneConductor((level, pos, state) -> false))
819819
.transform(pickaxeOnly())
820820
.addLayer(() -> RenderType::cutoutMipped)
821-
.clientExtension(() -> () -> new ReducedDestroyEffects())
821+
.tag(AllBlockTags.HAS_REDUCED_DESTROY_EFFECTS.tag)
822822
.blockstate(new ChuteGenerator()::generate)
823823
.item(ChuteItem::new)
824824
.transform(customItemModel("_", "block"))
@@ -832,7 +832,7 @@ public class AllBlocks {
832832
.isSuffocating((level, pos, state) -> false)
833833
.isRedstoneConductor((level, pos, state) -> false))
834834
.addLayer(() -> RenderType::cutoutMipped)
835-
.clientExtension(() -> () -> new ReducedDestroyEffects())
835+
.tag(AllBlockTags.HAS_REDUCED_DESTROY_EFFECTS.tag)
836836
.transform(pickaxeOnly())
837837
.blockstate((c, p) -> BlockStateGen.simpleBlock(c, p, AssetLookup.forPowered(c, p)))
838838
.item()
@@ -1621,7 +1621,7 @@ public class AllBlocks {
16211621
.forceSolidOn())
16221622
.addLayer(() -> RenderType::cutoutMipped)
16231623
.transform(pickaxeOnly())
1624-
.clientExtension(() -> () -> new TrackBlock.RenderProperties())
1624+
.tag(AllBlockTags.HAS_REDUCED_DESTROY_EFFECTS.tag)
16251625
.onRegister(CreateRegistrate.blockModel(() -> TrackModel::new))
16261626
.blockstate(new TrackBlockStateGenerator()::generate)
16271627
.tag(AllBlockTags.RELOCATION_NOT_SUPPORTED.tag)
@@ -1730,7 +1730,7 @@ public class AllBlocks {
17301730
.properties(p -> p.mapColor(MapColor.STONE))
17311731
.transform(pickaxeOnly())
17321732
.tag(AllBlockTags.SAFE_NBT.tag)
1733-
.clientExtension(() -> () -> new ReducedDestroyEffects())
1733+
.tag(AllBlockTags.HAS_REDUCED_DESTROY_EFFECTS.tag)
17341734
.onRegister(movementBehaviour(FunnelMovementBehaviour.andesite()))
17351735
.blockstate(new FunnelGenerator("andesite", false)::generate)
17361736
.item(FunnelItem::new)
@@ -1746,7 +1746,7 @@ public class AllBlocks {
17461746
.properties(p -> p.mapColor(MapColor.STONE))
17471747
.transform(pickaxeOnly())
17481748
.tag(AllBlockTags.SAFE_NBT.tag)
1749-
.clientExtension(() -> () -> new ReducedDestroyEffects())
1749+
.tag(AllBlockTags.HAS_REDUCED_DESTROY_EFFECTS.tag)
17501750
.blockstate(new BeltFunnelGenerator("andesite")::generate)
17511751
.loot((p, b) -> p.dropOther(b, ANDESITE_FUNNEL.get()))
17521752
.register();
@@ -1758,7 +1758,7 @@ public class AllBlocks {
17581758
.properties(p -> p.mapColor(MapColor.TERRACOTTA_YELLOW))
17591759
.transform(pickaxeOnly())
17601760
.tag(AllBlockTags.SAFE_NBT.tag)
1761-
.clientExtension(() -> () -> new ReducedDestroyEffects())
1761+
.tag(AllBlockTags.HAS_REDUCED_DESTROY_EFFECTS.tag)
17621762
.onRegister(movementBehaviour(FunnelMovementBehaviour.brass()))
17631763
.blockstate(new FunnelGenerator("brass", true)::generate)
17641764
.item(FunnelItem::new)
@@ -1774,7 +1774,7 @@ public class AllBlocks {
17741774
.properties(p -> p.mapColor(MapColor.TERRACOTTA_YELLOW))
17751775
.transform(pickaxeOnly())
17761776
.tag(AllBlockTags.SAFE_NBT.tag)
1777-
.clientExtension(() -> () -> new ReducedDestroyEffects())
1777+
.tag(AllBlockTags.HAS_REDUCED_DESTROY_EFFECTS.tag)
17781778
.blockstate(new BeltFunnelGenerator("brass")::generate)
17791779
.loot((p, b) -> p.dropOther(b, BRASS_FUNNEL.get()))
17801780
.register();
@@ -2025,7 +2025,7 @@ public class AllBlocks {
20252025
REGISTRATE.block("copper_table_cloth", p -> new TableClothBlock(p, "copper"))
20262026
.transform(BuilderTransformers.tableCloth("copper", SharedProperties::copperMetal, false))
20272027
.properties(p -> p.requiresCorrectToolForDrops())
2028-
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(net.neoforged.neoforge.common.Tags.Items.INGOTS_COPPER),
2028+
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(ConventionalItemTags.COPPER_INGOTS),
20292029
RecipeCategory.DECORATIONS, c::get, 2))
20302030
.transform(pickaxeOnly())
20312031
.lang("Copper Table Cover")
@@ -2300,15 +2300,15 @@ public class AllBlocks {
23002300
public static final BlockEntry<MetalLadderBlock> COPPER_LADDER =
23012301
REGISTRATE.block("copper_ladder", MetalLadderBlock::new)
23022302
.transform(BuilderTransformers.ladder("copper",
2303-
() -> DataIngredient.tag(net.neoforged.neoforge.common.Tags.Items.INGOTS_COPPER), MapColor.COLOR_ORANGE))
2303+
() -> DataIngredient.tag(ConventionalItemTags.COPPER_INGOTS), MapColor.COLOR_ORANGE))
23042304
.register();
23052305

23062306
public static final BlockEntry<IronBarsBlock> ANDESITE_BARS = MetalBarsGen.createBars("andesite", true,
23072307
() -> DataIngredient.items(AllItems.ANDESITE_ALLOY.get()), MapColor.STONE);
23082308
public static final BlockEntry<IronBarsBlock> BRASS_BARS = MetalBarsGen.createBars("brass", true,
23092309
() -> DataIngredient.tag(AllTags.commonItemTag("ingots/brass")), MapColor.TERRACOTTA_YELLOW);
23102310
public static final BlockEntry<IronBarsBlock> COPPER_BARS = MetalBarsGen.createBars("copper", true,
2311-
() -> DataIngredient.tag(net.neoforged.neoforge.common.Tags.Items.INGOTS_COPPER), MapColor.COLOR_ORANGE);
2311+
() -> DataIngredient.tag(ConventionalItemTags.COPPER_INGOTS), MapColor.COLOR_ORANGE);
23122312

23132313
public static final BlockEntry<MetalScaffoldingBlock> ANDESITE_SCAFFOLD = REGISTRATE
23142314
.block("andesite_scaffolding", MetalScaffoldingBlock::new)
@@ -2327,7 +2327,7 @@ public class AllBlocks {
23272327
public static final BlockEntry<MetalScaffoldingBlock> COPPER_SCAFFOLD =
23282328
REGISTRATE.block("copper_scaffolding", MetalScaffoldingBlock::new)
23292329
.transform(BuilderTransformers.scaffold("copper",
2330-
() -> DataIngredient.tag(net.neoforged.neoforge.common.Tags.Items.INGOTS_COPPER), MapColor.COLOR_ORANGE,
2330+
() -> DataIngredient.tag(ConventionalItemTags.COPPER_INGOTS), MapColor.COLOR_ORANGE,
23312331
AllSpriteShifts.COPPER_SCAFFOLD, AllSpriteShifts.COPPER_SCAFFOLD_INSIDE, AllSpriteShifts.COPPER_CASING))
23322332
.register();
23332333

@@ -2695,14 +2695,14 @@ public class AllBlocks {
26952695

26962696
public static final CopperBlockSet COPPER_SHINGLES = new CopperBlockSet(REGISTRATE, "copper_shingles",
26972697
"copper_roof_top", CopperBlockSet.DEFAULT_VARIANTS, (c, p) -> {
2698-
p.stonecutting(DataIngredient.tag(net.neoforged.neoforge.common.Tags.Items.INGOTS_COPPER), RecipeCategory.BUILDING_BLOCKS,
2698+
p.stonecutting(DataIngredient.tag(ConventionalItemTags.COPPER_INGOTS), RecipeCategory.BUILDING_BLOCKS,
26992699
c::get, 2);
27002700
}, (ws, block) -> connectedTextures(() -> new RoofBlockCTBehaviour(AllSpriteShifts.COPPER_SHINGLES.get(ws)))
27012701
.accept(block));
27022702

27032703
public static final CopperBlockSet COPPER_TILES =
27042704
new CopperBlockSet(REGISTRATE, "copper_tiles", "copper_roof_top", CopperBlockSet.DEFAULT_VARIANTS, (c, p) -> {
2705-
p.stonecutting(DataIngredient.tag(net.neoforged.neoforge.common.Tags.Items.INGOTS_COPPER), RecipeCategory.BUILDING_BLOCKS,
2705+
p.stonecutting(DataIngredient.tag(ConventionalItemTags.COPPER_INGOTS), RecipeCategory.BUILDING_BLOCKS,
27062706
c::get, 2);
27072707
}, (ws, block) -> connectedTextures(() -> new RoofBlockCTBehaviour(AllSpriteShifts.COPPER_TILES.get(ws)))
27082708
.accept(block));

src/main/java/com/simibubi/create/AllTags.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ public enum AllBlockTags {
109109
SUGAR_CANE_VARIANTS,
110110
NON_HARVESTABLE,
111111

112+
HAS_REDUCED_DESTROY_EFFECTS,
113+
112114
CORALS,
113115

114116
RELOCATION_NOT_SUPPORTED(COMMON),

src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
import com.simibubi.create.foundation.block.IBE;
3333
import com.simibubi.create.foundation.block.ProperWaterloggedBlock;
3434
import com.simibubi.create.foundation.block.render.MultiPosDestructionHandler;
35-
import com.simibubi.create.foundation.block.render.ReducedDestroyEffects;
3635
import com.simibubi.create.foundation.item.ItemHelper;
36+
import com.simibubi.create.infrastructure.fabric.transfer.TransferUtil;
3737

3838
import net.createmod.catnip.data.Iterate;
3939
import net.createmod.catnip.math.VecHelper;
@@ -96,12 +96,11 @@
9696
import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction;
9797

9898
import io.github.fabricators_of_create.porting_lib.tags.Tags;
99-
import com.simibubi.create.infrastructure.fabric.transfer.TransferUtil;
10099
import io.github.fabricators_of_create.porting_lib.util.TagUtil;
101100

102101
public class BeltBlock extends HorizontalKineticBlock
103102
implements IBE<BeltBlockEntity>, SpecialBlockItemRequirement, TransformableBlock, ProperWaterloggedBlock,
104-
BlockPickInteractionAware, ReducedDestroyEffects, MultiPosDestructionHandler {
103+
BlockPickInteractionAware, MultiPosDestructionHandler {
105104

106105
public static final Property<BeltSlope> SLOPE = EnumProperty.create("slope", BeltSlope.class);
107106
public static final Property<BeltPart> PART = EnumProperty.create("part", BeltPart.class);

src/main/java/com/simibubi/create/content/kinetics/waterwheel/WaterWheelStructuralBlock.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
import java.util.HashSet;
44
import java.util.Set;
55

6-
import net.fabricmc.api.EnvType;
7-
import net.fabricmc.api.Environment;
8-
9-
import net.fabricmc.api.EnvType;
10-
import net.fabricmc.api.Environment;
11-
126
import org.jetbrains.annotations.NotNull;
137
import org.jetbrains.annotations.Nullable;
148

@@ -45,15 +39,10 @@
4539
import net.minecraft.world.phys.BlockHitResult;
4640
import net.minecraft.world.phys.HitResult;
4741

48-
4942
import net.fabricmc.api.EnvType;
5043
import net.fabricmc.api.Environment;
5144

52-
import io.github.fabricators_of_create.porting_lib.block.CustomDestroyEffectsBlock;
53-
import io.github.fabricators_of_create.porting_lib.block.CustomHitEffectsBlock;
54-
import io.github.fabricators_of_create.porting_lib.block.CustomLandingEffectsBlock;
55-
56-
public class WaterWheelStructuralBlock extends DirectionalBlock implements IWrenchable, IProxyHoveringInformation, MultiPosDestructionHandler, CustomLandingEffectsBlock, CustomDestroyEffectsBlock, CustomHitEffectsBlock {
45+
public class WaterWheelStructuralBlock extends DirectionalBlock implements IWrenchable, IProxyHoveringInformation, MultiPosDestructionHandler {
5746

5847
public static final MapCodec<WaterWheelStructuralBlock> CODEC = simpleCodec(WaterWheelStructuralBlock::new);
5948

@@ -77,7 +66,7 @@ public InteractionResult onWrenched(BlockState state, UseOnContext context) {
7766
}
7867

7968
@Override
80-
public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) {
69+
public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
8170
return AllBlocks.LARGE_WATER_WHEEL.asStack();
8271
}
8372

@@ -100,7 +89,7 @@ public InteractionResult onSneakWrenched(BlockState state, UseOnContext context)
10089
@Override
10190
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
10291
if (AdventureUtil.isAdventure(player))
103-
return InteractionResult.PASS;
92+
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
10493
if (!stillValid(level, pos, state, false))
10594
return ItemInteractionResult.FAIL;
10695
if (!(level.getBlockEntity(getMaster(level, pos, state)) instanceof WaterWheelBlockEntity wwt))

src/main/java/com/simibubi/create/content/logistics/chute/AbstractChuteBlock.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.simibubi.create.foundation.advancement.AdvancementBehaviour;
99
import com.simibubi.create.foundation.advancement.AllAdvancements;
1010
import com.simibubi.create.foundation.block.IBE;
11-
import com.simibubi.create.foundation.block.render.ReducedDestroyEffects;
1211
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
1312
import com.simibubi.create.foundation.item.ItemHelper;
1413
import com.simibubi.create.foundation.utility.AdventureUtil;
@@ -35,7 +34,7 @@
3534
import net.minecraft.world.phys.shapes.CollisionContext;
3635
import net.minecraft.world.phys.shapes.VoxelShape;
3736

38-
public abstract class AbstractChuteBlock extends Block implements IWrenchable, IBE<ChuteBlockEntity>, ReducedDestroyEffects {
37+
public abstract class AbstractChuteBlock extends Block implements IWrenchable, IBE<ChuteBlockEntity> {
3938

4039
public AbstractChuteBlock(Properties p_i48440_1_) {
4140
super(p_i48440_1_);

src/main/java/com/simibubi/create/content/logistics/funnel/AbstractFunnelBlock.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.simibubi.create.content.equipment.wrench.IWrenchable;
77
import com.simibubi.create.foundation.block.IBE;
88
import com.simibubi.create.foundation.block.ProperWaterloggedBlock;
9-
import com.simibubi.create.foundation.block.render.ReducedDestroyEffects;
109
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
1110
import com.simibubi.create.foundation.blockEntity.behaviour.filtering.FilteringBehaviour;
1211
import com.simibubi.create.foundation.blockEntity.behaviour.inventory.InvManipulationBehaviour;
@@ -31,7 +30,7 @@
3130
import net.minecraft.world.level.pathfinder.PathComputationType;
3231

3332
public abstract class AbstractFunnelBlock extends Block
34-
implements IBE<FunnelBlockEntity>, IWrenchable, ProperWaterloggedBlock, ReducedDestroyEffects {
33+
implements IBE<FunnelBlockEntity>, IWrenchable, ProperWaterloggedBlock {
3534

3635
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
3736

src/main/java/com/simibubi/create/content/trains/track/TrackBlock.java

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@
1717
import java.util.Map.Entry;
1818
import java.util.Set;
1919

20-
import com.simibubi.create.api.contraption.train.PortalTrackProvider;
21-
22-
import com.simibubi.create.api.schematic.requirement.SpecialBlockItemRequirement;
23-
24-
import net.fabricmc.api.EnvType;
25-
import net.fabricmc.api.Environment;
26-
import net.fabricmc.fabric.api.registry.LandPathNodeTypesRegistry;
27-
28-
import net.fabricmc.api.EnvType;
29-
import net.fabricmc.api.Environment;
30-
import net.fabricmc.fabric.api.registry.LandPathNodeTypesRegistry;
31-
32-
import net.minecraft.world.level.pathfinder.PathType;
33-
3420
import org.jetbrains.annotations.Nullable;
3521

3622
import com.google.common.base.Predicates;
@@ -55,7 +41,6 @@
5541
import com.simibubi.create.foundation.block.IHaveBigOutline;
5642
import com.simibubi.create.foundation.block.ProperWaterloggedBlock;
5743
import com.simibubi.create.foundation.block.render.MultiPosDestructionHandler;
58-
import com.simibubi.create.foundation.block.render.ReducedDestroyEffects;
5944
import com.simibubi.create.foundation.utility.CreateLang;
6045

6146
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
@@ -103,14 +88,19 @@
10388
import net.minecraft.world.level.block.state.properties.EnumProperty;
10489
import net.minecraft.world.level.levelgen.structure.BoundingBox;
10590
import net.minecraft.world.level.material.FluidState;
91+
import net.minecraft.world.level.pathfinder.PathType;
10692
import net.minecraft.world.phys.BlockHitResult;
10793
import net.minecraft.world.phys.Vec3;
10894
import net.minecraft.world.phys.shapes.CollisionContext;
10995
import net.minecraft.world.phys.shapes.Shapes;
11096
import net.minecraft.world.phys.shapes.VoxelShape;
11197
import net.minecraft.world.ticks.LevelTickAccess;
11298

113-
public class TrackBlock extends Block implements IBE<TrackBlockEntity>, IWrenchable, ITrackBlock, SpecialBlockItemRequirement, ProperWaterloggedBlock, IHaveBigOutline, ReducedDestroyEffects, MultiPosDestructionHandler {
99+
import net.fabricmc.api.EnvType;
100+
import net.fabricmc.api.Environment;
101+
import net.fabricmc.fabric.api.registry.LandPathNodeTypesRegistry;
102+
103+
public class TrackBlock extends Block implements IBE<TrackBlockEntity>, IWrenchable, ITrackBlock, SpecialBlockItemRequirement, ProperWaterloggedBlock, IHaveBigOutline, MultiPosDestructionHandler {
114104

115105
public static final EnumProperty<TrackShape> SHAPE = EnumProperty.create("shape", TrackShape.class);
116106
public static final BooleanProperty HAS_BE = BooleanProperty.create("turn");

src/main/java/com/simibubi/create/foundation/block/render/ReducedDestroyEffects.java

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)