mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-18 03:15:00 +00:00
Secret armour rendering. Shhhhh!
This commit is contained in:
1 parent
b1ced53150
commit
151d29865c
2 files changed
+79
-1
No files matched your search
@@ -2,8 +2,12 @@ package fox.spiteful.avaritia.items;
|
||||
|
||||
import fox.spiteful.avaritia.Avaritia;
|
||||
import fox.spiteful.avaritia.Lumberjack;
|
||||
import fox.spiteful.avaritia.render.ModelArmorInfinity;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -12,10 +16,15 @@ import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemArmorInfinity extends ItemArmor {
|
||||
|
||||
public static final ArmorMaterial infinite_armor = EnumHelper.addArmorMaterial("infinity", 9999, new int[]{6, 16, 12, 6}, 1000);
|
||||
|
||||
public static final ModelArmorInfinity armorModel = new ModelArmorInfinity(1.0f);
|
||||
public static final ModelArmorInfinity legModel = new ModelArmorInfinity(0.5f);
|
||||
|
||||
public ItemArmorInfinity(int slot){
|
||||
super(infinite_armor, 0, slot);
|
||||
setCreativeTab(Avaritia.tab);
|
||||
@@ -58,5 +67,50 @@ public class ItemArmorInfinity extends ItemArmor {
|
||||
{
|
||||
return LudicrousItems.cosmic;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel (EntityLivingBase entityLiving, ItemStack itemstack, int armorSlot){
|
||||
ModelArmorInfinity model = armorSlot == 2 ? legModel : armorModel;
|
||||
|
||||
model.bipedHead.showModel = armorSlot == 0;
|
||||
model.bipedHeadwear.showModel = armorSlot == 0;
|
||||
model.bipedBody.showModel = armorSlot == 1;
|
||||
model.bipedRightArm.showModel = armorSlot == 1;
|
||||
model.bipedLeftArm.showModel = armorSlot == 1;
|
||||
model.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3;
|
||||
model.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3;
|
||||
|
||||
model.isSneak = entityLiving.isSneaking();
|
||||
model.isRiding = entityLiving.isRiding();
|
||||
model.isChild = entityLiving.isChild();
|
||||
|
||||
model.heldItemRight = 0;
|
||||
model.aimedBow = false;
|
||||
|
||||
EntityPlayer player = (EntityPlayer)entityLiving;
|
||||
|
||||
ItemStack held_item = player.getEquipmentInSlot(0);
|
||||
|
||||
if (held_item != null){
|
||||
model.heldItemRight = 1;
|
||||
|
||||
if (player.getItemInUseCount() > 0){
|
||||
|
||||
EnumAction enumaction = held_item.getItemUseAction();
|
||||
|
||||
if (enumaction == EnumAction.bow){
|
||||
model.aimedBow = true;
|
||||
}else if (enumaction == EnumAction.block){
|
||||
model.heldItemRight = 3;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package fox.spiteful.avaritia.render;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelArmorInfinity extends ModelBiped {
|
||||
|
||||
public ModelArmorInfinity(float expand) {
|
||||
super(expand, 0, 64,32);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user