public class EnchantmentHelper
extends java.lang.Object
コンストラクタと説明 |
---|
EnchantmentHelper() |
修飾子とタイプ | メソッドと説明 |
---|---|
static ItemStack |
addRandomEnchantment(java.util.Random random,
ItemStack stack,
int level,
boolean allowTreasure)
Applys a random enchantment to the specified item.
|
static void |
applyArthropodEnchantments(LivingEntity user,
Entity target) |
static void |
applyThornEnchantments(LivingEntity user,
Entity attacker) |
static boolean |
areAllCompatibleWith(java.util.Collection<Enchantment> enchantmentsIn,
Enchantment enchantmentIn) |
static java.util.List<EnchantmentData> |
buildEnchantmentList(java.util.Random randomIn,
ItemStack itemStackIn,
int level,
boolean allowTreasure)
Create a list of random EnchantmentData (enchantments) that can be added together to the ItemStack, the 3rd
parameter is the total enchantability level.
|
static int |
calcItemStackEnchantability(java.util.Random rand,
int enchantNum,
int power,
ItemStack stack)
Returns the enchantability of itemstack, using a separate calculation for each enchantNum (0, 1 or 2), cutting to
the max enchantability power of the table, which is locked to a max of 15.
|
static java.util.Map<Enchantment,java.lang.Integer> |
func_226652_a_(ListNBT p_226652_0_) |
static int |
getDepthStriderModifier(LivingEntity entityIn) |
static int |
getEfficiencyModifier(LivingEntity entityIn) |
static java.util.List<EnchantmentData> |
getEnchantmentDatas(int p_185291_0_,
ItemStack stack,
boolean allowTreasure) |
static int |
getEnchantmentLevel(Enchantment enchID,
ItemStack stack)
Returns the level of enchantment on the ItemStack passed.
|
static int |
getEnchantmentModifierDamage(java.lang.Iterable<ItemStack> stacks,
DamageSource source)
Returns the modifier of protection enchantments on armors equipped on player.
|
static java.util.Map<Enchantment,java.lang.Integer> |
getEnchantments(ItemStack stack)
Return the enchantments for the specified stack.
|
static int |
getFireAspectModifier(LivingEntity player)
Returns the fire aspect modifier of the players held item.
|
static int |
getFishingLuckBonus(ItemStack stack) |
static int |
getFishingSpeedBonus(ItemStack stack) |
static int |
getKnockbackModifier(LivingEntity player)
Returns the Knockback modifier of the enchantment on the players held item.
|
static int |
getLootingModifier(LivingEntity entityIn) |
static int |
getLoyaltyModifier(ItemStack stack) |
static int |
getMaxEnchantmentLevel(Enchantment enchantmentIn,
LivingEntity entityIn) |
static float |
getModifierForCreature(ItemStack stack,
CreatureAttribute creatureAttribute) |
static java.util.Map.Entry<EquipmentSlotType,ItemStack> |
getRandomItemWithEnchantment(Enchantment targetEnchantment,
LivingEntity entityIn)
Gets an item with a specified enchantment from a living entity.
|
static int |
getRespirationModifier(LivingEntity entityIn) |
static int |
getRiptideModifier(ItemStack stack) |
static float |
getSweepingDamageRatio(LivingEntity entityIn) |
static boolean |
hasAquaAffinity(LivingEntity entityIn) |
static boolean |
hasBindingCurse(ItemStack stack) |
static boolean |
hasChanneling(ItemStack stack) |
static boolean |
hasFrostWalker(LivingEntity player)
Checks if the player has any armor enchanted with the frost walker enchantment.
|
static boolean |
hasVanishingCurse(ItemStack stack) |
static void |
removeIncompatible(java.util.List<EnchantmentData> dataList,
EnchantmentData data) |
static void |
setEnchantments(java.util.Map<Enchantment,java.lang.Integer> enchMap,
ItemStack stack)
Set the enchantments for the specified stack.
|
public static int getEnchantmentLevel(Enchantment enchID, ItemStack stack)
public static java.util.Map<Enchantment,java.lang.Integer> getEnchantments(ItemStack stack)
public static java.util.Map<Enchantment,java.lang.Integer> func_226652_a_(ListNBT p_226652_0_)
public static void setEnchantments(java.util.Map<Enchantment,java.lang.Integer> enchMap, ItemStack stack)
public static int getEnchantmentModifierDamage(java.lang.Iterable<ItemStack> stacks, DamageSource source)
public static float getModifierForCreature(ItemStack stack, CreatureAttribute creatureAttribute)
public static float getSweepingDamageRatio(LivingEntity entityIn)
public static void applyThornEnchantments(LivingEntity user, Entity attacker)
public static void applyArthropodEnchantments(LivingEntity user, Entity target)
public static int getMaxEnchantmentLevel(Enchantment enchantmentIn, LivingEntity entityIn)
public static int getKnockbackModifier(LivingEntity player)
public static int getFireAspectModifier(LivingEntity player)
public static int getRespirationModifier(LivingEntity entityIn)
public static int getDepthStriderModifier(LivingEntity entityIn)
public static int getEfficiencyModifier(LivingEntity entityIn)
public static int getFishingLuckBonus(ItemStack stack)
public static int getFishingSpeedBonus(ItemStack stack)
public static int getLootingModifier(LivingEntity entityIn)
public static boolean hasAquaAffinity(LivingEntity entityIn)
public static boolean hasFrostWalker(LivingEntity player)
public static boolean hasBindingCurse(ItemStack stack)
public static boolean hasVanishingCurse(ItemStack stack)
public static int getLoyaltyModifier(ItemStack stack)
public static int getRiptideModifier(ItemStack stack)
public static boolean hasChanneling(ItemStack stack)
@Nullable public static java.util.Map.Entry<EquipmentSlotType,ItemStack> getRandomItemWithEnchantment(Enchantment targetEnchantment, LivingEntity entityIn)
public static int calcItemStackEnchantability(java.util.Random rand, int enchantNum, int power, ItemStack stack)
public static ItemStack addRandomEnchantment(java.util.Random random, ItemStack stack, int level, boolean allowTreasure)
public static java.util.List<EnchantmentData> buildEnchantmentList(java.util.Random randomIn, ItemStack itemStackIn, int level, boolean allowTreasure)
public static void removeIncompatible(java.util.List<EnchantmentData> dataList, EnchantmentData data)
public static boolean areAllCompatibleWith(java.util.Collection<Enchantment> enchantmentsIn, Enchantment enchantmentIn)
public static java.util.List<EnchantmentData> getEnchantmentDatas(int p_185291_0_, ItemStack stack, boolean allowTreasure)