当前位置: 首页>>代码示例>>Java>>正文


Java HoverChecker.checkHover方法代码示例

本文整理汇总了Java中net.minecraftforge.fml.client.config.HoverChecker.checkHover方法的典型用法代码示例。如果您正苦于以下问题:Java HoverChecker.checkHover方法的具体用法?Java HoverChecker.checkHover怎么用?Java HoverChecker.checkHover使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fml.client.config.HoverChecker的用法示例。


在下文中一共展示了HoverChecker.checkHover方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入方法依赖的package包/类
private void drawTooltips(NBTTagCompound nbt, int mouseX, int mouseY)
{	
	for (int i = 0; i < attributes.length; i++)
	{
		HoverChecker checker = new HoverChecker(attributes[i], 0);

		if (checker.checkHover(mouseX, mouseY))
		{
			int cost = 1;
			
			if (ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getRarity() == Rarity.UNCOMMON && !ShieldAttribute.SHIELD_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 1;
			else if (ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getRarity() == Rarity.RARE && !ShieldAttribute.SHIELD_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 2;
			else if (ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getRarity() == Rarity.LEGENDARY && !ShieldAttribute.SHIELD_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 3;
			else if (ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getAttributeTier(nbt) == 3) cost = 0;
			
			List<String> list = new ArrayList<String>();
			list.add(ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getColor() + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getName(nbt));
			list.add(TextFormatting.GRAY + "Cost: " + cost + " token(s)");
			list.add("");
			list.add(I18n.format("levels.attributes.shields.info." + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).ordinal()));
			list.add("");
			list.add("Tiers:");
			list.add(" I - " + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.shields.info." + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).ordinal() + ".tier1"));
			list.add(" II - " + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.shields.info." + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).ordinal() + ".tier2"));
			list.add(" III - " + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.shields.info." + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).ordinal() + ".tier3"));
			drawHoveringText(list, mouseX + 3, mouseY + 3);
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:30,代码来源:GuiShieldSelection.java

示例2: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入方法依赖的package包/类
private void drawTooltips(NBTTagCompound nbt, int mouseX, int mouseY)
{	
	for (int i = 0; i < attributes.length; i++)
	{
		HoverChecker checker = new HoverChecker(attributes[i], 0);

		if (checker.checkHover(mouseX, mouseY))
		{
			int cost = 1;
			
			if (WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getRarity() == Rarity.UNCOMMON && !WeaponAttribute.WEAPON_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 1;
			else if (WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getRarity() == Rarity.RARE && !WeaponAttribute.WEAPON_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 2;
			else if (WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getRarity() == Rarity.LEGENDARY && !WeaponAttribute.WEAPON_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 3;
			else if (WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getAttributeTier(nbt) == 3) cost = 0;
			
			List<String> list = new ArrayList<String>();
			list.add(WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getColor() + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getName(nbt));
			list.add(TextFormatting.GRAY + "Cost: " + cost + " token(s)");
			list.add("");
			list.add(I18n.format("levels.attributes.weapons.info." + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).ordinal()));
			list.add("");
			list.add("Tiers:");
			list.add(" I - " + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.weapons.info." + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).ordinal() + ".tier1"));
			list.add(" II - " + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.weapons.info." + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).ordinal() + ".tier2"));
			list.add(" III - " + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.weapons.info." + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).ordinal() + ".tier3"));
			drawHoveringText(list, mouseX + 3, mouseY + 3);
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:30,代码来源:GuiWeaponSelection.java

示例3: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入方法依赖的package包/类
private void drawTooltips(NBTTagCompound nbt, int mouseX, int mouseY)
{	
	for (int i = 0; i < attributes.length; i++)
	{
		HoverChecker checker = new HoverChecker(attributes[i], 0);

		if (checker.checkHover(mouseX, mouseY))
		{
			int cost = 1;
			
			if (BowAttribute.BOW_ATTRIBUTES.get(i).getRarity() == Rarity.UNCOMMON && !BowAttribute.BOW_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 1;
			else if (BowAttribute.BOW_ATTRIBUTES.get(i).getRarity() == Rarity.RARE && !BowAttribute.BOW_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 2;
			else if (BowAttribute.BOW_ATTRIBUTES.get(i).getRarity() == Rarity.LEGENDARY && !BowAttribute.BOW_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 3;
			else if (BowAttribute.BOW_ATTRIBUTES.get(i).getAttributeTier(nbt) == 3) cost = 0;
			
			List<String> list = new ArrayList<String>();
			list.add(BowAttribute.BOW_ATTRIBUTES.get(i).getColor() + BowAttribute.BOW_ATTRIBUTES.get(i).getName(nbt));
			list.add(TextFormatting.GRAY + "Cost: " + cost + " token(s)");
			list.add("");
			list.add(I18n.format("levels.attributes.bows.info." + BowAttribute.BOW_ATTRIBUTES.get(i).ordinal()));
			list.add("");
			list.add("Tiers:");
			list.add(" I - " + BowAttribute.BOW_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.bows.info." + BowAttribute.BOW_ATTRIBUTES.get(i).ordinal() + ".tier1"));
			list.add(" II - " + BowAttribute.BOW_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.bows.info." + BowAttribute.BOW_ATTRIBUTES.get(i).ordinal() + ".tier2"));
			list.add(" III - " + BowAttribute.BOW_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.bows.info." + BowAttribute.BOW_ATTRIBUTES.get(i).ordinal() + ".tier3"));
			drawHoveringText(list, mouseX + 3, mouseY + 3);
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:30,代码来源:GuiBowSelection.java

示例4: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入方法依赖的package包/类
private void drawTooltips(NBTTagCompound nbt, int mouseX, int mouseY)
{	
	for (int i = 0; i < attributes.length; i++)
	{
		HoverChecker checker = new HoverChecker(attributes[i], 0);

		if (checker.checkHover(mouseX, mouseY))
		{
			int cost = 1;
			
			if (ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getRarity() == Rarity.UNCOMMON && !ArmorAttribute.ARMOR_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 1;
			else if (ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getRarity() == Rarity.RARE && !ArmorAttribute.ARMOR_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 2;
			else if (ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getRarity() == Rarity.LEGENDARY && !ArmorAttribute.ARMOR_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 3;
			else if (ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getAttributeTier(nbt) == 3) cost = 0;
			
			List<String> list = new ArrayList<String>();
			list.add(ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getColor() + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getName(nbt));
			list.add(TextFormatting.GRAY + "Cost: " + cost + " token(s)");
			list.add("");
			list.add(I18n.format("levels.attributes.armors.info." + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).ordinal()));
			list.add("");
			list.add("Tiers:");
			list.add(" I - " + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.armors.info." + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).ordinal() + ".tier1"));
			list.add(" II - " + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.armors.info." + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).ordinal() + ".tier2"));
			list.add(" III - " + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.armors.info." + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).ordinal() + ".tier3"));
			drawHoveringText(list, mouseX + 3, mouseY + 3);
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:30,代码来源:GuiArmorSelection.java

示例5: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入方法依赖的package包/类
/**
 * Check to see if mouse is hovering over a BUTTON. If so, display tooltip of button.
 * @param mouseX
 * @param mouseY
 */
private void drawTooltips(int mouseX, int mouseY)
{
	HoverChecker warriorCheck = new HoverChecker(warrior, 0);
	HoverChecker mageCheck = new HoverChecker(mage, 0);
	HoverChecker hunterCheck = new HoverChecker(hunter, 0);
	
	List<String> list = new ArrayList<String>();
	
	if (warriorCheck.checkHover(mouseX, mouseY))
	{
		list.add(TextFormatting.RED + I18n.format("gui.class.warrior.title")); // title
		list.add(TextFormatting.GRAY + I18n.format("gui.class.warrior.info")); // information about class
		list.add("");
		list.add(TextFormatting.ITALIC  + "" + TextFormatting.GRAY + I18n.format("gui.class.abilities")); // Abilities title
		
		// add specific ability information.
		
		drawHoveringText(list, mouseX + 3, mouseY + 3); // draw tooltip box; offset from center of mouse.
	}
	else if (mageCheck.checkHover(mouseX, mouseY))
	{
		list.add(TextFormatting.BLUE + I18n.format("gui.class.mage.title")); // title
		list.add(TextFormatting.GRAY + I18n.format("gui.class.mage.info")); // information about class
		list.add("");
		list.add(TextFormatting.ITALIC  + "" + TextFormatting.GRAY + I18n.format("gui.class.abilities")); // Abilities title
		
		// add specific ability information.
		
		drawHoveringText(list, mouseX + 3, mouseY + 3); // draw tooltip box; offset from center of mouse.
	}
	else if (hunterCheck.checkHover(mouseX, mouseY))
	{
		list.add(TextFormatting.DARK_GREEN + I18n.format("gui.class.hunter.title")); // title
		list.add(TextFormatting.GRAY + I18n.format("gui.class.hunter.info")); // information about class
		list.add("");
		list.add(TextFormatting.ITALIC  + "" + TextFormatting.GRAY + I18n.format("gui.class.abilities")); // Abilities title
		
		// add specific ability information.
		
		drawHoveringText(list, mouseX + 3, mouseY + 3); // draw tooltip box; offset from center of mouse.
	}
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:48,代码来源:GuiClassSelection.java


注:本文中的net.minecraftforge.fml.client.config.HoverChecker.checkHover方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。