summaryrefslogtreecommitdiff
path: root/src/main/java/gmail/Lance5057/armor
diff options
context:
space:
mode:
authorLance5057 <Lance5057@gmail.com>2015-09-01 02:37:19 -0500
committerLance5057 <Lance5057@gmail.com>2015-09-01 02:37:19 -0500
commit21c92007da84b33e44afcac5eecd48760cf1b107 (patch)
tree1bd30b6e1c373b714f67d9043f99012b6ef70d87 /src/main/java/gmail/Lance5057/armor
parent8aebbe3f2cabe013bc2bbdf400e084629d58a672 (diff)
Experimented with model rendering for armor.
Diffstat (limited to 'src/main/java/gmail/Lance5057/armor')
-rw-r--r--src/main/java/gmail/Lance5057/armor/items/Sheath.java6
-rw-r--r--src/main/java/gmail/Lance5057/armor/renderers/ModelSheath.java23
-rw-r--r--src/main/java/gmail/Lance5057/armor/tools/Item_Cloth.java52
-rw-r--r--src/main/java/gmail/Lance5057/armor/tools/Item_Glowthread.java52
-rw-r--r--src/main/java/gmail/Lance5057/armor/tools/Item_Thread.java52
5 files changed, 26 insertions, 159 deletions
diff --git a/src/main/java/gmail/Lance5057/armor/items/Sheath.java b/src/main/java/gmail/Lance5057/armor/items/Sheath.java
index c3563f1..92b5695 100644
--- a/src/main/java/gmail/Lance5057/armor/items/Sheath.java
+++ b/src/main/java/gmail/Lance5057/armor/items/Sheath.java
@@ -15,7 +15,7 @@ public class Sheath extends AccessoryCore implements IAccessoryModel
{
public Sheath() {
- super("tinkersdefense:textures/armor/Sheath");
+ super("tinkersdefense:textures/armor/Sheath/_sheath_base");
}
@Override
@@ -34,10 +34,10 @@ public class Sheath extends AccessoryCore implements IAccessoryModel
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
String type) {
- return "tinkersdefense:textures/armor/Sheath.png";
+ return "tinkersdefense:textures/armor/Sheath/_sheath_base.png";
}
- ResourceLocation texture = new ResourceLocation("tinkersdefense", "textures/armor/Sheath.png");
+ ResourceLocation texture = new ResourceLocation("tinkersdefense", "textures/armor/Sheath/_sheath_base.png");
@Override
@SideOnly(Side.CLIENT)
diff --git a/src/main/java/gmail/Lance5057/armor/renderers/ModelSheath.java b/src/main/java/gmail/Lance5057/armor/renderers/ModelSheath.java
index 3ca4395..3a1760c 100644
--- a/src/main/java/gmail/Lance5057/armor/renderers/ModelSheath.java
+++ b/src/main/java/gmail/Lance5057/armor/renderers/ModelSheath.java
@@ -3,8 +3,12 @@ package gmail.Lance5057.armor.renderers;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
+import net.minecraft.util.ResourceLocation;
+
import org.lwjgl.opengl.GL11;
+import cpw.mods.fml.client.FMLClientHandler;
+
/**
* ModelBiped - Either Mojang or a mod author
* Created using Tabula 4.1.1
@@ -28,8 +32,25 @@ public class ModelSheath extends ModelBiped {
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
+
+ GL11.glPushMatrix();
this.shape10.render(f5);
GL11.glPushMatrix();
+ GL11.glColor3d(0, 0, 1.0);
+ GL11.glTranslatef(this.shape9.offsetX, this.shape9.offsetY, this.shape9.offsetZ);
+ GL11.glTranslatef(this.shape9.rotationPointX * f5, this.shape9.rotationPointY * f5, this.shape9.rotationPointZ * f5);
+ GL11.glScaled(0.65D, 0.65D, 0.5D);
+ GL11.glTranslatef(-this.shape9.offsetX, -this.shape9.offsetY, -this.shape9.offsetZ);
+ GL11.glTranslatef(-this.shape9.rotationPointX * f5, -this.shape9.rotationPointY * f5, -this.shape9.rotationPointZ * f5);
+ this.shape9.render(f5);
+ GL11.glPopMatrix();
+
+ FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/armor/Sheath/_sheath_filigree.png"));
+ GL11.glPushMatrix();
+
+
+ GL11.glColor3d(1.0, 1.0, 0);
+ this.shape10.render(f5);
GL11.glTranslatef(this.shape9.offsetX, this.shape9.offsetY, this.shape9.offsetZ);
GL11.glTranslatef(this.shape9.rotationPointX * f5, this.shape9.rotationPointY * f5, this.shape9.rotationPointZ * f5);
GL11.glScaled(0.65D, 0.65D, 0.5D);
@@ -37,6 +58,8 @@ public class ModelSheath extends ModelBiped {
GL11.glTranslatef(-this.shape9.rotationPointX * f5, -this.shape9.rotationPointY * f5, -this.shape9.rotationPointZ * f5);
this.shape9.render(f5);
GL11.glPopMatrix();
+
+ GL11.glPopMatrix();
}
/**
diff --git a/src/main/java/gmail/Lance5057/armor/tools/Item_Cloth.java b/src/main/java/gmail/Lance5057/armor/tools/Item_Cloth.java
deleted file mode 100644
index d236ac7..0000000
--- a/src/main/java/gmail/Lance5057/armor/tools/Item_Cloth.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package gmail.Lance5057.armor.tools;
-
-import gmail.Lance5057.TinkersDefense;
-
-import java.util.List;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-public class Item_Cloth extends Item
-{
- public IIcon[] icons = new IIcon[16];
- public static final String[] colors = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "grey", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"};
-
- public Item_Cloth()
- {
- super();
- this.setHasSubtypes(true);
- this.setUnlocalizedName("Cloth");
- this.setCreativeTab(TinkersDefense.tabName);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- for (int i = 0; i < 16; i ++) {
- this.icons[i] = reg.registerIcon("tinkersdefense:" + colors[i] + "_cloth" );
- }
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- if (meta > 15)
- meta = 0;
-
- return this.icons[meta];
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 16; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return colors[stack.getItemDamage()] + "_" + this.getUnlocalizedName();
- }
-}
diff --git a/src/main/java/gmail/Lance5057/armor/tools/Item_Glowthread.java b/src/main/java/gmail/Lance5057/armor/tools/Item_Glowthread.java
deleted file mode 100644
index 7fbed32..0000000
--- a/src/main/java/gmail/Lance5057/armor/tools/Item_Glowthread.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package gmail.Lance5057.armor.tools;
-
-import gmail.Lance5057.TinkersDefense;
-
-import java.util.List;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-public class Item_Glowthread extends Item
-{
- public IIcon[] icons = new IIcon[16];
- public static final String[] colors = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "grey", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"};
-
- public Item_Glowthread()
- {
- super();
- this.setHasSubtypes(true);
- this.setUnlocalizedName("GlowThread");
- this.setCreativeTab(TinkersDefense.tabName);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- for (int i = 0; i < 16; i ++) {
- this.icons[i] = reg.registerIcon("tinkersdefense:" + colors[i] + "_glowthread" );
- }
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- if (meta > 15)
- meta = 0;
-
- return this.icons[meta];
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 16; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return colors[stack.getItemDamage()] + "_" + this.getUnlocalizedName();
- }
-}
diff --git a/src/main/java/gmail/Lance5057/armor/tools/Item_Thread.java b/src/main/java/gmail/Lance5057/armor/tools/Item_Thread.java
deleted file mode 100644
index dda0d14..0000000
--- a/src/main/java/gmail/Lance5057/armor/tools/Item_Thread.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package gmail.Lance5057.armor.tools;
-
-import gmail.Lance5057.TinkersDefense;
-
-import java.util.List;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-public class Item_Thread extends Item
-{
- public IIcon[] icons = new IIcon[16];
- public static final String[] colors = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "grey", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"};
-
- public Item_Thread()
- {
- super();
- this.setHasSubtypes(true);
- this.setUnlocalizedName("Thread");
- this.setCreativeTab(TinkersDefense.tabName);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- for (int i = 0; i < 16; i ++) {
- this.icons[i] = reg.registerIcon("tinkersdefense:" + colors[i] + "_thread" );
- }
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- if (meta > 15)
- meta = 0;
-
- return this.icons[meta];
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 16; i ++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return colors[stack.getItemDamage()] + "_" + this.getUnlocalizedName();
- }
-}