Skip to content

Commit

Permalink
Greatly expand the blocks dug by rockcutter and grinding disk
Browse files Browse the repository at this point in the history
  • Loading branch information
BluSunrize committed Mar 29, 2024
1 parent 8239583 commit 9da2b45
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 32 deletions.
8 changes: 5 additions & 3 deletions src/api/java/blusunrize/immersiveengineering/api/IETags.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ public class IETags
public static final TagKey<Block> glowstoneBlock = createBlockTag(getStorageBlock("glowstone"));
public static final TagKey<Block> colorlessSandstoneBlocks = createBlockTag(forgeLoc("sandstone/colorless"));
public static final TagKey<Block> redSandstoneBlocks = createBlockTag(forgeLoc("sandstone/red"));
public static final TagKey<Item> cutCopperBlocks = createItemWrapper(rl("cut_blocks/copper"));
public static final TagKey<Item> cutCopperStairs = createItemWrapper(rl("cut_stairs/copper"));
public static final TagKey<Item> cutCopperSlabs = createItemWrapper(rl("cut_slabs/copper"));
public static final TagKey<Block> copperBlocks = createBlockTag(rl("blocks/copper"));
public static final TagKey<Block> cutCopperBlocks = createBlockTag(rl("cut_blocks/copper"));

public static final TagKey<Block> cutCopperStairs = createBlockTag(rl("cut_stairs/copper"));
public static final TagKey<Block> cutCopperSlabs = createBlockTag(rl("cut_slabs/copper"));
//IE Blocks
public static final TagKey<Block> treatedWood = createBlockTag(forgeLoc("treated_wood"));
public static final TagKey<Block> treatedWoodSlab = createBlockTag(forgeLoc("treated_wood_slab"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,26 @@
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SlabBlock;
import net.neoforged.neoforge.common.Tags;
import net.neoforged.neoforge.common.data.BlockTagsProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;

import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.ibm.icu.lang.UCharacter.GraphemeClusterBreak.T;

public class IEBlockTags extends BlockTagsProvider
{

Expand Down Expand Up @@ -87,6 +94,19 @@ protected void addTags(Provider p_256380_)
.add(Blocks.CUT_RED_SANDSTONE)
.add(Blocks.CHISELED_RED_SANDSTONE)
.add(Blocks.SMOOTH_RED_SANDSTONE);
tag(IETags.copperBlocks)
.add(Blocks.COPPER_BLOCK, Blocks.EXPOSED_COPPER, Blocks.WEATHERED_COPPER, Blocks.OXIDIZED_COPPER)
.add(Blocks.WAXED_COPPER_BLOCK, Blocks.WAXED_EXPOSED_COPPER, Blocks.WAXED_WEATHERED_COPPER, Blocks.WAXED_OXIDIZED_COPPER);
tag(IETags.cutCopperBlocks)
.add(Blocks.CUT_COPPER, Blocks.EXPOSED_CUT_COPPER, Blocks.WEATHERED_CUT_COPPER, Blocks.OXIDIZED_CUT_COPPER)
.add(Blocks.WAXED_CUT_COPPER, Blocks.WAXED_EXPOSED_CUT_COPPER, Blocks.WAXED_WEATHERED_CUT_COPPER, Blocks.WAXED_OXIDIZED_CUT_COPPER);
tag(IETags.cutCopperStairs)
.add(Blocks.CUT_COPPER_STAIRS, Blocks.EXPOSED_CUT_COPPER_STAIRS, Blocks.WEATHERED_CUT_COPPER_STAIRS, Blocks.OXIDIZED_CUT_COPPER_STAIRS)
.add(Blocks.WAXED_CUT_COPPER_STAIRS, Blocks.WAXED_EXPOSED_CUT_COPPER_STAIRS, Blocks.WAXED_WEATHERED_CUT_COPPER_STAIRS, Blocks.WAXED_OXIDIZED_CUT_COPPER_STAIRS);
tag(IETags.cutCopperSlabs)
.add(Blocks.CUT_COPPER_SLAB, Blocks.EXPOSED_CUT_COPPER_SLAB, Blocks.WEATHERED_CUT_COPPER_SLAB, Blocks.OXIDIZED_CUT_COPPER_SLAB)
.add(Blocks.WAXED_CUT_COPPER_SLAB, Blocks.WAXED_EXPOSED_CUT_COPPER_SLAB, Blocks.WAXED_WEATHERED_CUT_COPPER_SLAB, Blocks.WAXED_OXIDIZED_CUT_COPPER_SLAB);

for(BlockEntry<MetalLadderBlock> b : MetalDecoration.METAL_LADDER.values())
tag(BlockTags.CLIMBABLE).add(b.get());
for(EnumMetals metal : EnumMetals.values())
Expand Down Expand Up @@ -233,25 +253,53 @@ private void registerHammerMineable()
}
}

// TODO rockcutter and grinding disk tags are nowhere near complete at this point, they were determined based on
// block material in <=1.19.4
private void registerRockcutterMineable()
{
IntrinsicTagAppender<Block> tag = tag(IETags.rockcutterHarvestable);
// stones & ores
tag.addTag(Tags.Blocks.COBBLESTONE);
tag.addTag(Tags.Blocks.STONE);
tag.addTag(Tags.Blocks.ORES);
// glass, ice, glowing blocks
tag.addTag(Tags.Blocks.GLASS);
tag.addTag(BlockTags.ICE);
tag.addTag(Tags.Blocks.ORES);
tag.add(Blocks.GLOWSTONE);
tag.add(Blocks.SEA_LANTERN);
// enderchest
tag.addTag(Tags.Blocks.CHESTS_ENDER);
// skulk, but intentionally only some of them
tag.add(Blocks.SCULK, Blocks.SCULK_CATALYST, Blocks.SCULK_SENSOR, Blocks.CALIBRATED_SCULK_SENSOR);
}

private void registerGrindingDiskMineable()
{
IntrinsicTagAppender<Block> tag = tag(IETags.grindingDiskHarvestable);
// storage and sheetmetal
tag.addTag(Tags.Blocks.STORAGE_BLOCKS);
tag.addTag(IETags.sheetmetals);
// storage and sheetmetal slabs
for(EnumMetals metal : EnumMetals.values())
if(!metal.isVanillaMetal())
tag.add(IEBlocks.TO_SLAB.get(Metals.STORAGE.get(metal).getId()).get());
tag.addTag(IETags.sheetmetalSlabs);
// copper
tag.addTag(IETags.copperBlocks);
tag.addTag(IETags.cutCopperBlocks);
tag.addTag(IETags.cutCopperSlabs);
tag.addTag(IETags.cutCopperStairs);
// scaffolding
tag.addTag(IETags.scaffoldingSteel);
tag.addTag(IETags.scaffoldingAlu);
tag.add(MetalDecoration.ALU_FENCE.get(), MetalDecoration.ALU_POST.get(), MetalDecoration.ALU_WALLMOUNT.get(), MetalDecoration.ALU_SLOPE.get());
tag.add(MetalDecoration.STEEL_FENCE.get(), MetalDecoration.STEEL_POST.get(), MetalDecoration.STEEL_WALLMOUNT.get(), MetalDecoration.STEEL_SLOPE.get());
MetalDecoration.METAL_LADDER.values().forEach(entry -> tag.add(entry.get()));
// chutes
MetalDevices.CHUTES.values().forEach(entry -> tag.add(entry.get()));
// fluid machines
tag.add(MetalDevices.BARREL.get(), MetalDevices.FLUID_PUMP.get(), MetalDevices.FLUID_PIPE.get(), MetalDevices.FLUID_PLACER.get());
// multiblock components
tag.add(MetalDecoration.LV_COIL.get(), MetalDecoration.MV_COIL.get(), MetalDecoration.MV_COIL.get());
tag.add(MetalDecoration.ENGINEERING_RS.get(), MetalDecoration.ENGINEERING_LIGHT.get(), MetalDecoration.ENGINEERING_HEAVY.get(), MetalDecoration.RADIATOR.get(), MetalDecoration.GENERATOR.get());
}

private void registerAxeMineable()
Expand Down Expand Up @@ -470,12 +518,12 @@ private void setStorageMiningLevel(EnumMetals metal, Tiers level)
private void setMiningLevel(Supplier<Block> block, Tiers level)
{
TagKey<Block> tag = switch(level)
{
case STONE -> BlockTags.NEEDS_STONE_TOOL;
case IRON -> BlockTags.NEEDS_IRON_TOOL;
case DIAMOND -> BlockTags.NEEDS_DIAMOND_TOOL;
default -> throw new IllegalArgumentException("No tag available for "+level.name());
};
{
case STONE -> BlockTags.NEEDS_STONE_TOOL;
case IRON -> BlockTags.NEEDS_IRON_TOOL;
case DIAMOND -> BlockTags.NEEDS_DIAMOND_TOOL;
default -> throw new IllegalArgumentException("No tag available for "+level.name());
};
tag(tag).add(block.get());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ protected void addTags(Provider p_256380_)
.addTag(ItemTags.TERRACOTTA)
.add(IEBlocks.StoneDecoration.DUROPLAST.asItem());
tag(ItemTags.CLUSTER_MAX_HARVESTABLES).add(Tools.STEEL_PICK.get());
tag(IETags.cutCopperBlocks).add(Items.CUT_COPPER, Items.EXPOSED_CUT_COPPER, Items.WEATHERED_CUT_COPPER, Items.OXIDIZED_CUT_COPPER,
Items.WAXED_CUT_COPPER, Items.WAXED_EXPOSED_CUT_COPPER, Items.WAXED_WEATHERED_CUT_COPPER, Items.WAXED_OXIDIZED_CUT_COPPER);
tag(IETags.cutCopperStairs).add(Items.CUT_COPPER_STAIRS, Items.EXPOSED_CUT_COPPER_STAIRS, Items.WEATHERED_CUT_COPPER_STAIRS, Items.OXIDIZED_CUT_COPPER_STAIRS,
Items.WAXED_CUT_COPPER_STAIRS, Items.WAXED_EXPOSED_CUT_COPPER_STAIRS, Items.WAXED_WEATHERED_CUT_COPPER_STAIRS, Items.WAXED_OXIDIZED_CUT_COPPER_STAIRS);
tag(IETags.cutCopperSlabs).add(Items.CUT_COPPER_SLAB, Items.EXPOSED_CUT_COPPER_SLAB, Items.WEATHERED_CUT_COPPER_SLAB, Items.OXIDIZED_CUT_COPPER_SLAB,
Items.WAXED_CUT_COPPER_SLAB, Items.WAXED_EXPOSED_CUT_COPPER_SLAB, Items.WAXED_WEATHERED_CUT_COPPER_SLAB, Items.WAXED_OXIDIZED_CUT_COPPER_SLAB);

generateTagsForToolbox();
tag(IETags.tools)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9da2b45

Please sign in to comment.