本文整理汇总了Java中net.minecraft.enchantment.Enchantment.enchantmentsBookList方法的典型用法代码示例。如果您正苦于以下问题:Java Enchantment.enchantmentsBookList方法的具体用法?Java Enchantment.enchantmentsBookList怎么用?Java Enchantment.enchantmentsBookList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.enchantment.Enchantment
的用法示例。
在下文中一共展示了Enchantment.enchantmentsBookList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEnchantmentBooksToList
import net.minecraft.enchantment.Enchantment; //导入方法依赖的package包/类
/**
* Adds the enchantment books from the supplied EnumEnchantmentType to the given list.
*/
public void addEnchantmentBooksToList(List<ItemStack> itemList, EnumEnchantmentType... enchantmentType)
{
for (Enchantment enchantment : Enchantment.enchantmentsBookList)
{
if (enchantment != null && enchantment.type != null)
{
boolean flag = false;
for (int i = 0; i < enchantmentType.length && !flag; ++i)
{
if (enchantment.type == enchantmentType[i])
{
flag = true;
}
}
if (flag)
{
itemList.add(Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, enchantment.getMaxLevel())));
}
}
}
}
示例2: modifyMerchantRecipeList
import net.minecraft.enchantment.Enchantment; //导入方法依赖的package包/类
public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random)
{
Enchantment enchantment = Enchantment.enchantmentsBookList[random.nextInt(Enchantment.enchantmentsBookList.length)];
int i = MathHelper.getRandomIntegerInRange(random, enchantment.getMinLevel(), enchantment.getMaxLevel());
ItemStack itemstack = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, i));
int j = 2 + random.nextInt(5 + i * 10) + 3 * i;
if (j > 64)
{
j = 64;
}
recipeList.add(new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, j), itemstack));
}
示例3: updateCreativeSearch
import net.minecraft.enchantment.Enchantment; //导入方法依赖的package包/类
private void updateCreativeSearch()
{
GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
guicontainercreative$containercreative.itemList.clear();
for (Item item : Item.itemRegistry)
{
if (item != null && item.getCreativeTab() != null)
{
item.getSubItems(item, (CreativeTabs)null, guicontainercreative$containercreative.itemList);
}
}
for (Enchantment enchantment : Enchantment.enchantmentsBookList)
{
if (enchantment != null && enchantment.type != null)
{
Items.enchanted_book.getAll(enchantment, guicontainercreative$containercreative.itemList);
}
}
Iterator<ItemStack> iterator = guicontainercreative$containercreative.itemList.iterator();
String s1 = this.searchField.getText().toLowerCase();
while (iterator.hasNext())
{
ItemStack itemstack = (ItemStack)iterator.next();
boolean flag = false;
for (String s : itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips))
{
if (EnumChatFormatting.getTextWithoutFormattingCodes(s).toLowerCase().contains(s1))
{
flag = true;
break;
}
}
if (!flag)
{
iterator.remove();
}
}
this.currentScroll = 0.0F;
guicontainercreative$containercreative.scrollTo(0.0F);
}