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

@@ -5,7 +5,7 @@
this.m_38897_(new Slot(this.f_39449_, 1, 35, 47) {
public boolean m_5857_(ItemStack p_39517_) {
- return p_39517_.m_150930_(Items.f_42534_);
+ return net.minecraftforge.common.Tags.Items.GEMS_LAPIS.m_8110_(p_39517_.m_41720_());
+ return p_39517_.m_150922_(net.minecraftforge.common.Tags.Items.ENCHANTING_FUELS);
}
});
@@ -76,3 +76,12 @@
}
for(int j1 = 0; j1 < 3; ++j1) {
@@ -253,7 +_,7 @@
if (!this.m_38903_(itemstack1, 2, 38, true)) {
return ItemStack.f_41583_;
}
- } else if (itemstack1.m_150930_(Items.f_42534_)) {
+ } else if (itemstack1.m_150922_(net.minecraftforge.common.Tags.Items.ENCHANTING_FUELS)) {
if (!this.m_38903_(itemstack1, 1, 2, true)) {
return ItemStack.f_41583_;
}
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"#forge:gems/lapis"
]
}
@@ -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);