Skip to content

Commit

Permalink
Fixes Diagonal Glass tag using the wrong blocks & added fence support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeryn99 committed Dec 9, 2024
1 parent 7afe86d commit 69a66b8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public class TRTagKeys {
public static TagKey<Biome> IS_MOUNTAIN_OR_OCEAN = RegistryHelper.makeGenericBiomeTagCollection("is_mountain_or_ocean");
public static TagKey<Biome> TARDIS_ROOT_CLUSTER = RegistryHelper.makeBiomeTagForFeature("tardis_root_cluster");
public static TagKey<Block> DIAGONAL_COMPAT_WALLS = RegistryHelper.makeBlockTag("diagonalwalls", "non_diagonal_walls");
public static TagKey<Block> DIAGONAL_COMPAT_GLASS = RegistryHelper.makeBlockTag("diagonalwalls", "non_diagonal_windows");
public static TagKey<Block> DIAGONAL_COMPAT_GLASS = RegistryHelper.makeBlockTag("diagonalwindows", "non_diagonal_windows");
public static TagKey<Block> DIAGONAL_COMPAT_FENCES = RegistryHelper.makeBlockTag("diagonalfences", "non_diagonal_fences");
public static TagKey<Item> CURIOS_HEAD = RegistryHelper.makeItemTag("curios", "timelord_sight");
public static TagKey<Item> TRINKETS_HEAD = RegistryHelper.makeItemTag("trinkets", "head/hat");
public static TagKey<Item> TRINKETS_FACE = RegistryHelper.makeItemTag("trinkets", "head/face");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.FenceBlock;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.*;
import net.neoforged.neoforge.common.data.BlockTagsProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -97,10 +94,22 @@ protected void addTags(HolderLookup.Provider provider) {
Set<Block> glassBlocks = new HashSet<>();
ManipulatorRecipes.MANIPULATOR_CRAFTING_RECIPES.forEach((resourceLocation, manipulatorCraftingRecipe) -> {
for (ManipulatorCraftingIngredient ingredient : manipulatorCraftingRecipe.ingredients()) {
glassBlocks.add(ingredient.inputBlockState().getBlock());
if(ingredient.inputBlockState().getBlock() instanceof GlassBlock) {
glassBlocks.add(ingredient.inputBlockState().getBlock());
}
}
});
tag(TRTagKeys.DIAGONAL_COMPAT_GLASS).add(glassBlocks.toArray(new Block[0]));

Set<Block> fenceBlocks = new HashSet<>();
ManipulatorRecipes.MANIPULATOR_CRAFTING_RECIPES.forEach((resourceLocation, manipulatorCraftingRecipe) -> {
for (ManipulatorCraftingIngredient ingredient : manipulatorCraftingRecipe.ingredients()) {
if(ingredient.inputBlockState().getBlock() instanceof FenceBlock) {
fenceBlocks.add(ingredient.inputBlockState().getBlock());
}
}
});
tag(TRTagKeys.DIAGONAL_COMPAT_GLASS).add(normalBlocks.toArray(new Block[0]));
tag(TRTagKeys.DIAGONAL_COMPAT_FENCES).add(fenceBlocks.toArray(new Block[0]));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ protected ModBlockLoot() {
@Override
protected void generate() {
for (Block block : getKnownBlocks()) {
if(block == TRBlockRegistry.ARS_EGG.get()){
continue;
}
dropSelf(block);
}

Expand Down

0 comments on commit 69a66b8

Please sign in to comment.