Make some more QOL changes to existing enchants
This commit is contained in:
parent
82b2f62d27
commit
2713961cdf
4 changed files with 8 additions and 6 deletions
|
@ -84,10 +84,11 @@ public class ConsumptionMending extends Enchantment
|
|||
List<ItemStack> procList = new ArrayList<>();
|
||||
procList.addAll(append(player, player.getInventory().offhand));
|
||||
procList.addAll(append(player, player.getInventory().items));
|
||||
procList.addAll(append(player, player.getInventory().armor));
|
||||
|
||||
for(ItemStack stack : enchanted)
|
||||
{
|
||||
for(ItemStack item : player.getInventory().items)
|
||||
for(ItemStack item : procList)
|
||||
{
|
||||
// Is this a like item, and does it have the enchant?
|
||||
boolean eligible = false;
|
||||
|
|
|
@ -70,13 +70,13 @@ public class MobEggEnchantment extends Enchantment
|
|||
{
|
||||
OTEMod.LOGGER.info("Spawn Egg Chance (" + CHANCE + ")");
|
||||
}
|
||||
return rollChance((int)CHANCE);
|
||||
return rollChance(CHANCE);
|
||||
}
|
||||
|
||||
public static boolean rollChance(int percent)
|
||||
{
|
||||
Random rng = new Random();
|
||||
int test = rng.nextInt(100) + 1;
|
||||
int test = rng.nextInt(100) + 1 + (100 - percent);
|
||||
if(ServerConfig.general.debug)
|
||||
{
|
||||
OTEMod.LOGGER.info("Spawn Egg Dice Roll (" + test + " / " + percent + ")");
|
||||
|
|
|
@ -57,11 +57,11 @@ public class WaterBreathingEnchantment extends Enchantment
|
|||
|
||||
ItemStack feet = sp.getItemBySlot(EquipmentSlot.HEAD);
|
||||
|
||||
boolean hasNV = false;
|
||||
boolean hasEnchantment = false;
|
||||
|
||||
if(ItemUtils.getEnchantmentLevel(ModEnchantments.WATER_BREATHING_ENCHANT.get(), feet)>0)hasNV=true;
|
||||
if(ItemUtils.getEnchantmentLevel(ModEnchantments.WATER_BREATHING_ENCHANT.get(), feet)>0)hasEnchantment=true;
|
||||
|
||||
if(hasNV)
|
||||
if(hasEnchantment)
|
||||
{
|
||||
MobEffectInstance inst = new MobEffectInstance(MobEffects.WATER_BREATHING, 60*20, 4, false, false, true);
|
||||
|
||||
|
|
|
@ -167,6 +167,7 @@ public class EventHandler {
|
|||
|
||||
|
||||
ev.getDrops().add(new ItemEntity(killed.level(), killed.getX(), killed.getY(), killed.getZ(), egg));
|
||||
LoreHandlers.updateItem(stack, ItemStatType.EGG_CHANCE);
|
||||
LoreHandlers.updateItem(stack, ItemStatType.EGGING);
|
||||
}
|
||||
}else{
|
||||
|
|
Reference in a new issue