diff --git a/src/main/java/dan200/computercraft/shared/peripheral/generic/data/DataHelpers.java b/src/main/java/dan200/computercraft/shared/peripheral/generic/data/DataHelpers.java index 8cdfeab0b..cc53c86f4 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/generic/data/DataHelpers.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/generic/data/DataHelpers.java @@ -5,9 +5,10 @@ */ package dan200.computercraft.shared.peripheral.generic.data; -import net.minecraft.client.Minecraft; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.tags.ItemTags; import net.minecraft.world.item.Item; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.level.block.Block; @@ -34,14 +35,15 @@ public final class DataHelpers @Nonnull static Map getTags( @Nonnull Block block ) { - Collection tags = Minecraft.getInstance().getConnection().getTags().getOrEmpty( Registry.BLOCK_REGISTRY ).getMatchingTags( block ); + Collection tags = BlockTags.getAllTags().getMatchingTags( block ); return getTags( tags ); } + //TODO fix this @Nonnull static Map getTags( @Nonnull Item item ) { - Collection tags = Minecraft.getInstance().getConnection().getTags().getOrEmpty( Registry.ITEM_REGISTRY ).getMatchingTags( item ); + Collection tags = ItemTags.getAllTags().getMatchingTags( item ); return getTags( tags ); }