|
|
|
@ -243,7 +243,9 @@ public class CinderEventHandler implements IFuelHandler {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Smithing Rework event handler
|
|
|
|
// Smithing Rework event handler
|
|
|
|
if (attacker instanceof EntityPlayerMP player) {
|
|
|
|
|
|
|
|
|
|
|
|
//Removed, there is a handler for when you already attack, this is redundant
|
|
|
|
|
|
|
|
/*if (attacker instanceof EntityPlayerMP player) {
|
|
|
|
ItemStack weapon = player.getHeldItem();
|
|
|
|
ItemStack weapon = player.getHeldItem();
|
|
|
|
// smithing rework for melee
|
|
|
|
// 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)) {
|
|
|
|
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)) {
|
|
|
|
@ -260,12 +262,12 @@ public class CinderEventHandler implements IFuelHandler {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
if (entity instanceof EntityPlayerMP player) {
|
|
|
|
if (entity instanceof EntityPlayerMP player) {
|
|
|
|
|
|
|
|
|
|
|
|
// Durability thresholds and corresponding probabilities for adding a negative modifier
|
|
|
|
// Durability thresholds and corresponding probabilities for adding a negative modifier
|
|
|
|
float[] durabilityThresholds = {0.6f, 0.5f, 0.4f};
|
|
|
|
float[] durabilityThresholds = {0.4f, 0.3f, 0.2f};
|
|
|
|
double[] probabilities = {0.02, 0.05, 0.1};
|
|
|
|
double[] probabilities = {0.0005, 0.001, 0.005}; // Corrected probabilities
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; ++i) {
|
|
|
|
for (int i = 0; i < 4; ++i) {
|
|
|
|
ItemStack armor = player.getEquipmentInSlot(i + 1);
|
|
|
|
ItemStack armor = player.getEquipmentInSlot(i + 1);
|
|
|
|
|