mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 03:25:18 +00:00
Add Item.getModId to show which mod is associated with a subitem (#4330)
This commit is contained in:
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();
|
||||
|
||||
Reference in new issue
Block a user