Skip to content

Commit

Permalink
Added a fluid tag getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Apr 3, 2021
1 parent ffd48b2 commit 35cdae6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/hrznstudio/titanium/util/TagUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public static ITag<EntityType<?>> getEntityTypeTag(ResourceLocation resourceLoca
return EntityTypeTags.getTagById(resourceLocation.toString());
}

public static ITag<Fluid> getFluidTag(ResourceLocation resourceLocation) {
if (FluidTags.getCollection().getRegisteredTags().contains(resourceLocation)) {
return FluidTags.getCollection().get(resourceLocation);
}
return FluidTags.makeWrapperTag(resourceLocation.toString());
}

public static ItemStack getItemWithPreference(ITag<Item> tag){
if (tag.getAllElements().isEmpty()) return ItemStack.EMPTY;
List<Item> elements = tag.getAllElements();
Expand Down

0 comments on commit 35cdae6

Please sign in to comment.