Add "forge:enchanting_materials" tag in place of Lapis in the Enchanting Table (#8149)

This commit is contained in:
Silver_David authored and GitHub committed 2021-10-20 12:08:53 -07:00
1 parent 8bd517ca91
commit e431bb1caa
4 files changed
+29 -2

No files matched your search

@@ -19,6 +19,11 @@
package net.minecraftforge.common;
import java.util.Set;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.item.DyeColor;
@@ -182,6 +187,7 @@ public class Tags
public static final IOptionalNamedTag<Item> DYES_WHITE = DyeColor.WHITE.getTag();
public static final IOptionalNamedTag<Item> EGGS = tag("eggs");
public static final IOptionalNamedTag<Item> ENCHANTING_FUELS = tag("enchanting_fuels", Set.of(() -> net.minecraft.world.item.Items.LAPIS_LAZULI));
public static final IOptionalNamedTag<Item> END_STONES = tag("end_stones");
public static final IOptionalNamedTag<Item> ENDER_PEARLS = tag("ender_pearls");
public static final IOptionalNamedTag<Item> FEATHERS = tag("feathers");
@@ -293,9 +299,14 @@ public class Tags
public static final IOptionalNamedTag<Item> STORAGE_BLOCKS_REDSTONE = tag("storage_blocks/redstone");
public static final IOptionalNamedTag<Item> STRING = tag("string");
private static IOptionalNamedTag<Item> tag(String name, @Nullable Set<Supplier<Item>> defaults)
{
return ItemTags.createOptional(new ResourceLocation("forge", name), defaults);
}
private static IOptionalNamedTag<Item> tag(String name)
{
return ItemTags.createOptional(new ResourceLocation("forge", name));
return tag(name, null);
}
}
@@ -66,6 +66,7 @@ public final class ForgeItemTagsProvider extends ItemTagsProvider
tag(Tags.Items.DUSTS_REDSTONE).add(Items.REDSTONE);
addColored(tag(Tags.Items.DYES)::addTags, Tags.Items.DYES, "{color}_dye");
tag(Tags.Items.EGGS).add(Items.EGG);
tag(Tags.Items.ENCHANTING_FUELS).addTag(Tags.Items.GEMS_LAPIS);
copy(Tags.Blocks.END_STONES, Tags.Items.END_STONES);
tag(Tags.Items.ENDER_PEARLS).add(Items.ENDER_PEARL);
tag(Tags.Items.FEATHERS).add(Items.FEATHER);