Add item tag 'beacon_payment' for items that can activate a beacon (#6328)
This commit is contained in:
parent
68b0075fe6
commit
4dd32d6f72
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:emerald",
|
||||||
|
"minecraft:diamond",
|
||||||
|
"minecraft:gold_ingot",
|
||||||
|
"minecraft:iron_ingot"
|
||||||
|
]
|
||||||
|
}
|
|
@ -124,6 +124,7 @@ public class Tags
|
||||||
public static class Items
|
public static class Items
|
||||||
{
|
{
|
||||||
public static final Tag<Item> ARROWS = tag("arrows");
|
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> BONES = tag("bones");
|
||||||
public static final Tag<Item> BOOKSHELVES = tag("bookshelves");
|
public static final Tag<Item> BOOKSHELVES = tag("bookshelves");
|
||||||
public static final Tag<Item> CHESTS = tag("chests");
|
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());
|
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.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.BONES).add(Items.BONE);
|
||||||
getBuilder(Tags.Items.BOOKSHELVES).add(Items.BOOKSHELF);
|
getBuilder(Tags.Items.BOOKSHELVES).add(Items.BOOKSHELF);
|
||||||
copy(Tags.Blocks.CHESTS, Tags.Items.CHESTS);
|
copy(Tags.Blocks.CHESTS, Tags.Items.CHESTS);
|
||||||
|
|
|
@ -51,6 +51,7 @@ import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
import net.minecraftforge.common.Tags;
|
||||||
import net.minecraftforge.common.ToolType;
|
import net.minecraftforge.common.ToolType;
|
||||||
import net.minecraftforge.common.animation.ITimeValue;
|
import net.minecraftforge.common.animation.ITimeValue;
|
||||||
|
|
||||||
|
@ -615,7 +616,7 @@ public interface IForgeItem
|
||||||
*/
|
*/
|
||||||
default boolean isBeaconPayment(ItemStack stack)
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue