本文整理汇总了Java中codechicken.nei.guihook.IContainerTooltipHandler类的典型用法代码示例。如果您正苦于以下问题:Java IContainerTooltipHandler类的具体用法?Java IContainerTooltipHandler怎么用?Java IContainerTooltipHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IContainerTooltipHandler类属于codechicken.nei.guihook包,在下文中一共展示了IContainerTooltipHandler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: guiOpenEvent
import codechicken.nei.guihook.IContainerTooltipHandler; //导入依赖的package包/类
@SubscribeEvent
public void guiOpenEvent(GuiOpenEvent event) {
if (event.getGui() instanceof GuiContainer) {
if (lastGui != event.getGui()) {
if (event.getGui() == null) {
instanceTooltipHandlers = null;
} else {
instanceTooltipHandlers = new LinkedList<>();
if (event.getGui() instanceof IContainerTooltipHandler) {
instanceTooltipHandlers.add(((IContainerTooltipHandler) event.getGui()));
}
instanceTooltipHandlers.addAll(tooltipHandlers);
}
lastGui = event.getGui();
}
}
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:18,代码来源:NEIClientEventHandler.java
示例2: itemDisplayNameMultiline
import codechicken.nei.guihook.IContainerTooltipHandler; //导入依赖的package包/类
/**
* Extra lines are often used for more information. For example enchantments, potion effects and mob spawner contents.
*
* @param itemstack The item to get the name for.
* @param gui An instance of the currentscreen passed to tooltip handlers. If null, only gui inspecific handlers should respond
* @param includeHandlers If true tooltip handlers will add to the item tip
* @return A list of Strings representing the text to be displayed on each line of the tool tip.
*/
public static List<String> itemDisplayNameMultiline(ItemStack itemstack, GuiContainer gui, boolean includeHandlers) {
List<String> namelist = null;
try {
namelist = itemstack.getTooltip(Minecraft.getMinecraft().player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips ? TooltipFlags.ADVANCED : TooltipFlags.NORMAL);
} catch (Throwable ignored) {
}
if (namelist == null) {
namelist = new ArrayList<>();
}
if (namelist.size() == 0) {
namelist.add("Unnamed");
}
if (namelist.get(0) == null || namelist.get(0).equals("")) {
namelist.set(0, "Unnamed");
}
if (includeHandlers) {
for (IContainerTooltipHandler handler : NEIClientEventHandler.tooltipHandlers) {
handler.handleItemDisplayName(gui, itemstack, namelist);
}
}
namelist.set(0, itemstack.getRarity().rarityColor.toString() + namelist.get(0));
for (int i = 1; i < namelist.size(); i++) {
namelist.set(i, "\u00a77" + namelist.get(i));
}
return namelist;
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:41,代码来源:GuiHelper.java
示例3: addTooltipHandler
import codechicken.nei.guihook.IContainerTooltipHandler; //导入依赖的package包/类
/**
* Register a new Tooltip render handler;
*
* @param handler The handler to register
*/
public static void addTooltipHandler(IContainerTooltipHandler handler) {
tooltipHandlers.add(handler);
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:9,代码来源:NEIClientEventHandler.java
注:本文中的codechicken.nei.guihook.IContainerTooltipHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论