You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
Java
49 lines
1.4 KiB
Java
package com.zivilon.cinder_loe.mixins;
|
|
|
|
import com.zivilon.cinder_loe.CinderLoE;
|
|
import lotr.common.LOTRMod;
|
|
import lotr.common.entity.animal.LOTREntityBear;
|
|
import lotr.common.item.LOTRItemLionRug;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.world.World;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Overwrite;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
|
|
|
|
@Mixin(LOTREntityBear.class)
|
|
public abstract class MixinLOTREntityLioness extends Entity {
|
|
|
|
public MixinLOTREntityLioness(World worldIn) {
|
|
super(worldIn);
|
|
}
|
|
|
|
/**
|
|
* @author KeyLime17
|
|
* @reason Mevans
|
|
*/
|
|
|
|
|
|
protected LOTRItemLionRug.LionRugType getLionRugType() {
|
|
return LOTRItemLionRug.LionRugType.LIONESS;
|
|
}
|
|
|
|
@Overwrite(remap = false)
|
|
protected void func_70628_a(boolean flag, int i) {
|
|
Item furItem = CinderLoE.cinderFurItem;
|
|
int furMeta = 6;
|
|
|
|
int furs = 1 + this.rand.nextInt(3) + this.rand.nextInt(i + 1);
|
|
for (int l = 0; l < furs; l++)
|
|
entityDropItem(new ItemStack(furItem, 1, furMeta), 0.0F);
|
|
if (flag) {
|
|
int rugChance = 50 - i * 8;
|
|
rugChance = Math.max(rugChance, 1);
|
|
if (this.rand.nextInt(rugChance) == 0)
|
|
entityDropItem(new ItemStack(LOTRMod.lionRug, 1, (getLionRugType()).lionID), 0.0F);
|
|
}
|
|
}
|
|
}
|