Implement getCreatorModId on the flower item

Replaces the tooltip containing the creator mod's modid with an override
for the method returning it, allowing mods like JEI to show the mod
that actually added the flower and return it in mod searches, like
Forge's universal bucket already does with mod fluids.
This commit is contained in:
Hubry committed 2018-08-15 23:02:38 +02:00
1 parent 15f71c8a53
commit 04cbee8ae7
1 file changed
+7 -3
@@ -104,10 +104,14 @@ public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyPr
if(!refLocalized.equals(refUnlocalized))
stacks.add(TextFormatting.ITALIC + refLocalized);
}
}
String mod = BotaniaAPI.subTileMods.get(type);
if(mod != null && !mod.equals(LibMisc.MOD_ID))
stacks.add(TextFormatting.ITALIC + "[" + mod + "]");
@Override
public String getCreatorModId(ItemStack itemStack) {
String mod = BotaniaAPI.subTileMods.get(getType(itemStack));
if(mod != null)
return mod;
return LibMisc.MOD_ID;
}
public static String getType(ItemStack stack) {