本文整理匯總了Java中net.minecraft.enchantment.Enchantment.enchantmentsList方法的典型用法代碼示例。如果您正苦於以下問題:Java Enchantment.enchantmentsList方法的具體用法?Java Enchantment.enchantmentsList怎麽用?Java Enchantment.enchantmentsList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.enchantment.Enchantment
的用法示例。
在下文中一共展示了Enchantment.enchantmentsList方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawScreen
import net.minecraft.enchantment.Enchantment; //導入方法依賴的package包/類
/**
* Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
*/
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
boolean var4 = mc.thePlayer.capabilities.isCreativeMode;
int var5 = field_147075_G.func_178147_e();
for (int var6 = 0; var6 < 3; ++var6) {
int var7 = field_147075_G.enchantLevels[var6];
int var8 = field_147075_G.field_178151_h[var6];
int var9 = var6 + 1;
if (func_146978_c(60, 14 + 19 * var6, 108, 17, mouseX, mouseY) && var7 > 0 && var8 >= 0) {
ArrayList<Object> var10 = Lists.newArrayList();
String var11;
if (var8 >= 0 && Enchantment.enchantmentsList[var8 & 255] != null) {
var11 = Enchantment.enchantmentsList[var8 & 255].getTranslatedName((var8 & 65280) >> 8);
var10.add(EnumChatFormatting.WHITE.toString() + EnumChatFormatting.ITALIC.toString() + I18n.format("container.enchant.clue", new Object[] { var11 }));
}
if (!var4) {
if (var8 >= 0)
var10.add("");
if (mc.thePlayer.experienceLevel < var7)
var10.add(EnumChatFormatting.RED.toString() + I18n.format("container.enchant.level.required", new Object[0]) + ": " + field_147075_G.enchantLevels[var6]);
else {
var11 = "";
if (var9 == 1)
var11 = I18n.format("container.enchant.lapis.one", new Object[0]);
else
var11 = I18n.format("container.enchant.lapis.many", new Object[] { Integer.valueOf(var9) });
if (var5 >= var9)
var10.add(EnumChatFormatting.GRAY.toString() + "" + var11);
else
var10.add(EnumChatFormatting.RED.toString() + "" + var11);
if (var9 == 1)
var11 = I18n.format("container.enchant.level.one", new Object[0]);
else
var11 = I18n.format("container.enchant.level.many", new Object[] { Integer.valueOf(var9) });
var10.add(EnumChatFormatting.GRAY.toString() + "" + var11);
}
}
drawHoveringText(var10, mouseX, mouseY, fontRendererObj);
break;
}
}
}