Add Item.getModId to show which mod is associated with a subitem (#4330)

This commit is contained in:
mezz authored and GitHub committed 2017-10-02 22:08:16 -07:00
1 parent 8a285e0fed
commit cf39ff18e1
4 files changed
+97 -6

No files matched your search

@@ -356,6 +356,21 @@ public abstract class FluidRegistry
return name;
}
@Nullable
public static String getModId(@Nullable FluidStack fluidStack)
{
if (fluidStack != null)
{
String defaultFluidName = getDefaultFluidName(fluidStack.getFluid());
if (defaultFluidName != null)
{
ResourceLocation fluidResourceName = new ResourceLocation(defaultFluidName);
return fluidResourceName.getResourceDomain();
}
}
return null;
}
public static void loadFluidDefaults(NBTTagCompound tag)
{
Set<String> defaults = Sets.newHashSet();