Compare commits
No commits in common. '646849e0d417ccf055ccb15852fbb136afe8641c' and 'b62b012e70ebb6eea11d071eb443e10f77f855ce' have entirely different histories.
646849e0d4
...
b62b012e70
@ -1,38 +0,0 @@
|
||||
package com.zivilon.cinder_loe.mixins;
|
||||
|
||||
import lotr.common.entity.animal.LOTREntityHorse;
|
||||
import lotr.common.enchant.LOTREnchantment;
|
||||
import lotr.common.enchant.LOTREnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import lotr.common.item.LOTRItemArmor;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(LOTREntityHorse.class)
|
||||
public class MixinLOTREntityHorse {
|
||||
|
||||
@Inject(method = "func_70658_aO", at = @At("RETURN"), cancellable = true, remap = false)
|
||||
private void cinderloe$boostArmorFromRider(CallbackInfoReturnable<Integer> cir) {
|
||||
LOTREntityHorse horse = (LOTREntityHorse)(Object)this;
|
||||
|
||||
if (horse.riddenByEntity instanceof EntityPlayer) {
|
||||
EntityPlayer rider = (EntityPlayer) horse.riddenByEntity;
|
||||
|
||||
int bonus = 0;
|
||||
for (ItemStack armor : rider.inventory.armorInventory) {
|
||||
if (armor != null && LOTREnchantmentHelper.hasEnchant(armor, LOTREnchantment.getEnchantmentByName("mountArmor"))) {
|
||||
bonus++;
|
||||
}
|
||||
}
|
||||
|
||||
if (bonus > 0) {
|
||||
int newArmorValue = cir.getReturnValue() + bonus;
|
||||
cir.setReturnValue(newArmorValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue