mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Add custom mobs automatically as they're killed.
This commit is contained in:
@ -5,6 +5,7 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
@ -98,7 +99,7 @@ public class AxesManager extends SkillManager {
|
||||
if (ItemUtils.isArmor(armor) && Axes.impactChance > Misc.getRandom().nextInt(getActivationChance())) {
|
||||
double durabilityModifier = 1 / (armor.getEnchantmentLevel(Enchantment.DURABILITY) + 1); // Modifier to simulate the durability enchantment behavior
|
||||
double modifiedDurabilityDamage = durabilityDamage * durabilityModifier;
|
||||
short maxDurability = armor.getType().getMaxDurability();
|
||||
short maxDurability = mcMMO.getRepairableManager().getRepairable(armor.getType()).getMaximumDurability();
|
||||
double maxDurabilityDamage = maxDurability * Axes.impactMaxDurabilityModifier;
|
||||
|
||||
armor.setDurability((short) (Math.min(modifiedDurabilityDamage, maxDurabilityDamage) + armor.getDurability()));
|
||||
|
@ -87,7 +87,7 @@ public class Repair {
|
||||
protected static int getSalvagedAmount(ItemStack inHand) {
|
||||
// Temporary workaround until they get their stuff fixed.
|
||||
if (mcMMO.p.getServer().getName().equals("MCPC+")) {
|
||||
if (ItemUtils.isPickaxe(inHand) || ItemUtils.isAxe(inHand) || inHand.getType() == Material.BOW || inHand.getType() == Material.BUCKET) {
|
||||
if (ItemUtils.isPickaxe(inHand) || ItemUtils.isAxe(inHand) || ItemUtils.isBow(inHand) || inHand.getType() == Material.BUCKET) {
|
||||
return 3;
|
||||
}
|
||||
else if (ItemUtils.isShovel(inHand) || inHand.getType() == Material.FLINT_AND_STEEL) {
|
||||
@ -120,7 +120,7 @@ public class Repair {
|
||||
int quantity = 0;
|
||||
MaterialData repairData = new MaterialData(repairMaterial, repairMetadata);
|
||||
Recipe recipe = mcMMO.p.getServer().getRecipesFor(item).get(0);
|
||||
|
||||
|
||||
if (recipe instanceof ShapelessRecipe) {
|
||||
for (ItemStack ingredient : ((ShapelessRecipe) recipe).getIngredientList()) {
|
||||
if (ingredient != null && ingredient.getType() == repairMaterial && (repairMetadata == -1 || ingredient.getData() == repairData)) {
|
||||
|
Reference in New Issue
Block a user