Make some more QOL changes to existing enchants

This commit is contained in:
zontreck 2024-04-02 14:00:57 -07:00
parent 82b2f62d27
commit 2713961cdf
4 changed files with 8 additions and 6 deletions

View file

@ -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;

View file

@ -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 + ")");

View file

@ -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);

View file

@ -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{