use of net.silentchaos512.gear.gear.part.PartData in project Silent-Gear by SilentChaos512.
the class TooltipHandler method onTooltip.
@SubscribeEvent(receiveCanceled = true)
public void onTooltip(ItemTooltipEvent event) {
/*
LoaderState state = Loader.instance().getLoaderState();
if (state == LoaderState.INITIALIZATION || state == LoaderState.SERVER_ABOUT_TO_START || state == LoaderState.SERVER_STOPPING) {
// Skip tooltips during block/item remapping
// JEI tooltip caches are done in AVAILABLE, in-game is SERVER_STARTED
return;
}
*/
ItemStack stack = event.getItemStack();
if (TagUtils.contains(ModTags.Items.GRADER_CATALYSTS, stack)) {
onGraderCatalystTooltip(event);
}
if (TagUtils.contains(ModTags.Items.STARLIGHT_CHARGER_CATALYSTS, stack)) {
onStarlightChargerCatalystTooltip(event);
}
MaterialInstance material = MaterialInstance.from(stack);
if (material != null) {
onMaterialTooltip(event, stack, material);
return;
}
PartData part = PartData.from(stack);
if (part != null) /*&& !part.isBlacklisted(stack)*/
{
onPartTooltip(event, stack, part);
return;
}
// Nerfed gear?
if (Config.Common.isNerfedItem(stack.getItem())) {
List<Component> toolTip = event.getToolTip();
toolTip.add(Math.min(1, toolTip.size()), new TranslatableComponent("misc.silentgear.poorlyMade").withStyle(ChatFormatting.RED));
}
}
Aggregations