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.
78 lines
2.3 KiB
Java
78 lines
2.3 KiB
Java
package com.zivilon.cinder_loe.mixins;
|
|
|
|
import com.zivilon.cinder_loe.CinderLoE;
|
|
import lotr.common.LOTRMod;
|
|
import lotr.common.entity.npc.LOTREntityWarg;
|
|
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(LOTREntityWarg.class)
|
|
public abstract class MixinLOTREntityWarg extends Entity {
|
|
|
|
public MixinLOTREntityWarg(World worldIn) {
|
|
super(worldIn);
|
|
}
|
|
|
|
/**
|
|
* @author KeyLime17
|
|
* @reason Mevans
|
|
*/
|
|
|
|
@Shadow
|
|
public abstract LOTREntityWarg.WargType getWargType();
|
|
|
|
@Overwrite(remap = false)
|
|
protected void func_70628_a(boolean flag, int i) {
|
|
Item furItem = null;
|
|
int furMeta = 0;
|
|
switch(getWargType().wargID) {
|
|
case 0:
|
|
furItem = LOTRMod.fur;
|
|
break;
|
|
case 1:
|
|
furItem = CinderLoE.cinderFurItem;
|
|
break;
|
|
case 2:
|
|
furItem = CinderLoE.cinderFurItem;
|
|
furMeta = 1;
|
|
break;
|
|
case 3:
|
|
furItem = CinderLoE.cinderFurItem;
|
|
furMeta = 2;
|
|
break;
|
|
case 4:
|
|
furItem = CinderLoE.cinderFurItem;
|
|
furMeta = 0; // Needs ice fur to be added
|
|
break;
|
|
case 5:
|
|
furItem = CinderLoE.cinderFurItem;
|
|
furMeta = 3;
|
|
break;
|
|
case 6:
|
|
furItem = CinderLoE.cinderFurItem;
|
|
furMeta = 0; // Needs fire fur to be added
|
|
break;
|
|
}
|
|
|
|
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);
|
|
int bones = 2 + this.rand.nextInt(2) + this.rand.nextInt(i + 1);
|
|
for (int j = 0; j < bones; j++)
|
|
dropItem(LOTRMod.wargBone, 1);
|
|
if (flag) {
|
|
int rugChance = 50 - i * 8;
|
|
rugChance = Math.max(rugChance, 1);
|
|
if (this.rand.nextInt(rugChance) == 0)
|
|
entityDropItem(new ItemStack(LOTRMod.wargskinRug, 1, (getWargType()).wargID), 0.0F);
|
|
}
|
|
}
|
|
|
|
}
|