Add item tag 'beacon_payment' for items that can activate a beacon (#6328)

This commit is contained in:
bl4ckscor3 authored and LexManos committed 2019-12-02 14:52:45 -08:00
1 parent 68b0075fe6
commit 4dd32d6f72
4 files changed
+13 -1

No files matched your search

@@ -124,6 +124,7 @@ public class Tags
public static class Items
{
public static final Tag<Item> ARROWS = tag("arrows");
public static final Tag<Item> BEACON_PAYMENT = tag("beacon_payment");
public static final Tag<Item> BONES = tag("bones");
public static final Tag<Item> BOOKSHELVES = tag("bookshelves");
public static final Tag<Item> CHESTS = tag("chests");
@@ -52,6 +52,7 @@ public class ForgeItemTagsProvider extends ItemTagsProvider
filter = this.tagToBuilder.entrySet().stream().map(e -> e.getKey().getId()).collect(Collectors.toSet());
getBuilder(Tags.Items.ARROWS).add(Items.ARROW, Items.TIPPED_ARROW, Items.SPECTRAL_ARROW);
getBuilder(Tags.Items.BEACON_PAYMENT).add(Items.EMERALD, Items.DIAMOND, Items.GOLD_INGOT, Items.IRON_INGOT);
getBuilder(Tags.Items.BONES).add(Items.BONE);
getBuilder(Tags.Items.BOOKSHELVES).add(Items.BOOKSHELF);
copy(Tags.Blocks.CHESTS, Tags.Items.CHESTS);
@@ -51,6 +51,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.Tags;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.common.animation.ITimeValue;
@@ -615,7 +616,7 @@ public interface IForgeItem
*/
default boolean isBeaconPayment(ItemStack stack)
{
return this == Items.EMERALD || this == Items.DIAMOND || this == Items.GOLD_INGOT || this == Items.IRON_INGOT;
return Tags.Items.BEACON_PAYMENT.contains(stack.getItem());
}
/**