本文整理匯總了Java中net.minecraft.init.Enchantments.FORTUNE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Enchantments.FORTUNE屬性的具體用法?Java Enchantments.FORTUNE怎麽用?Java Enchantments.FORTUNE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.init.Enchantments
的用法示例。
在下文中一共展示了Enchantments.FORTUNE屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onEnchantmentLevelCheck
private void onEnchantmentLevelCheck(EnchantmentEvent.Level event) {
if (event.getEnchantment() == Enchantments.FORTUNE && event.getEntityLiving().isSneaking()) {
int oldLevel = event.getLevel();
int newLevel = (oldLevel + 1) * 10;
event.setLevel(newLevel);
OpenModLoader.getLogger().info("Set fortune level from " + oldLevel + " to " + newLevel);
}
}
示例2: canApplyTogether
/**
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench != Enchantments.FORTUNE;
}
示例3: canApplyTogether
@Override
public boolean canApplyTogether(Enchantment ench) {
return ench != Enchantments.SILK_TOUCH && ench != Enchantments.FORTUNE && super.canApplyTogether(ench);
}