|
|
|
|
@ -53,8 +53,8 @@ public class CinderEventHandler implements IFuelHandler {
|
|
|
|
|
if (attacker instanceof EntityPlayerMP player) {
|
|
|
|
|
ItemStack bow = player.getHeldItem();
|
|
|
|
|
if (bow != null && bow.isItemStackDamageable() && (bow.getItem() instanceof LOTRItemBow || bow.getItem() instanceof ItemBow)) {
|
|
|
|
|
float[] durabilityThresholds = {0.6f, 0.5f, 0.4f};
|
|
|
|
|
double[] probabilities = {0.02, 0.05, 0.1}; // Corrected probabilities
|
|
|
|
|
float[] durabilityThresholds = {0.5f, 0.4f, 0.25f};
|
|
|
|
|
double[] probabilities = {0.0005, 0.001, 0.005}; // Corrected probabilities
|
|
|
|
|
|
|
|
|
|
// Corrected durabilityPercent calculation
|
|
|
|
|
float durabilityPercent = (float) (bow.getMaxDamage() - bow.getItemDamage()) / bow.getMaxDamage();
|
|
|
|
|
@ -77,8 +77,8 @@ public class CinderEventHandler implements IFuelHandler {
|
|
|
|
|
ItemStack weapon = player.getHeldItem();
|
|
|
|
|
// smithing rework for melee
|
|
|
|
|
if (weapon != null && (weapon.getItem() instanceof LOTRItemSpear || weapon.getItem() instanceof LOTRItemSword || weapon.getItem() instanceof LOTRItemDagger || weapon.getItem() instanceof LOTRItemBattleaxe || weapon.getItem() instanceof LOTRItemHammer || weapon.getItem() instanceof ItemSword)) {
|
|
|
|
|
float[] durabilityThresholds = {0.6f, 0.5f, 0.4f};
|
|
|
|
|
double[] probabilities = {0.02, 0.05, 0.1}; // Corrected probabilities
|
|
|
|
|
float[] durabilityThresholds = {0.5f, 0.4f, 0.25f};
|
|
|
|
|
double[] probabilities = {0.0005, 0.001, 0.005}; // Corrected probabilities
|
|
|
|
|
if (weapon.isItemStackDamageable()) {
|
|
|
|
|
// Corrected durabilityPercent calculation
|
|
|
|
|
float durabilityPercent = (float) (weapon.getMaxDamage() - weapon.getItemDamage()) / weapon.getMaxDamage();
|
|
|
|
|
|