summaryrefslogtreecommitdiff
path: root/src/main/java/gmail/Lance5057/blocks
diff options
context:
space:
mode:
authorLance5057 <Lance5057@gmail.com>2015-01-21 20:04:34 -0600
committerLance5057 <Lance5057@gmail.com>2015-01-21 20:04:34 -0600
commitb4eb8f2d65c62afccc898808b44fdddfde0c15d1 (patch)
treeee3a9f47a22418a6778c299cc96b4fedc2265afe /src/main/java/gmail/Lance5057/blocks
parent39642dce74d23f025b71d5766c1ac8489a41a802 (diff)
Startup
I hope I'm doing this right...
Diffstat (limited to 'src/main/java/gmail/Lance5057/blocks')
-rw-r--r--src/main/java/gmail/Lance5057/blocks/AeonSteelBlock.java15
-rw-r--r--src/main/java/gmail/Lance5057/blocks/CrestMount.java43
-rw-r--r--src/main/java/gmail/Lance5057/blocks/DogbeariumBlock.java15
-rw-r--r--src/main/java/gmail/Lance5057/blocks/ModelCrestMount.java87
-rw-r--r--src/main/java/gmail/Lance5057/blocks/QueensGoldBlock.java15
-rw-r--r--src/main/java/gmail/Lance5057/blocks/Renderer_CrestMount.java60
-rw-r--r--src/main/java/gmail/Lance5057/blocks/TileEntity_CrestMount.java7
7 files changed, 242 insertions, 0 deletions
diff --git a/src/main/java/gmail/Lance5057/blocks/AeonSteelBlock.java b/src/main/java/gmail/Lance5057/blocks/AeonSteelBlock.java
new file mode 100644
index 0000000..259132a
--- /dev/null
+++ b/src/main/java/gmail/Lance5057/blocks/AeonSteelBlock.java
@@ -0,0 +1,15 @@
+package gmail.Lance5057.blocks;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+
+public class AeonSteelBlock extends Block
+{
+
+ public AeonSteelBlock (Material material)
+ {
+ super(material);
+ setHarvestLevel("pickaxe",2);
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/gmail/Lance5057/blocks/CrestMount.java b/src/main/java/gmail/Lance5057/blocks/CrestMount.java
new file mode 100644
index 0000000..a318c77
--- /dev/null
+++ b/src/main/java/gmail/Lance5057/blocks/CrestMount.java
@@ -0,0 +1,43 @@
+package gmail.Lance5057.blocks;
+
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+public class CrestMount extends BlockContainer {
+ //Treat it like a normal block here. The Block Bounds are a good idea - the first three are X Y and Z of the botton-left corner,
+ //And the second three are the top-right corner.
+ public CrestMount() {
+ super(Material.iron);
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ //You don't want the normal render type, or it wont render properly.
+ @Override
+ public int getRenderType() {
+ return -1;
+ }
+
+ //It's not an opaque cube, so you need this.
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ //It's not a normal block, so you need this too.
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ //This is the icon to use for showing the block in your hand.
+ public void registerIcons(IIconRegister icon) {
+ this.blockIcon = icon.registerIcon("tinkersdefense:textures/items/QueensGoldIngot.png");
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
+ return new TileEntity_CrestMount();
+ }
+}
diff --git a/src/main/java/gmail/Lance5057/blocks/DogbeariumBlock.java b/src/main/java/gmail/Lance5057/blocks/DogbeariumBlock.java
new file mode 100644
index 0000000..b7f5c79
--- /dev/null
+++ b/src/main/java/gmail/Lance5057/blocks/DogbeariumBlock.java
@@ -0,0 +1,15 @@
+package gmail.Lance5057.blocks;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+
+public class DogbeariumBlock extends Block
+{
+
+ public DogbeariumBlock (Material material)
+ {
+ super(material);
+ setHarvestLevel("pickaxe",2);
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/gmail/Lance5057/blocks/ModelCrestMount.java b/src/main/java/gmail/Lance5057/blocks/ModelCrestMount.java
new file mode 100644
index 0000000..5a5759d
--- /dev/null
+++ b/src/main/java/gmail/Lance5057/blocks/ModelCrestMount.java
@@ -0,0 +1,87 @@
+// Date: 1/18/2015 9:46:49 PM
+// Template version 1.1
+// Java generated by Techne
+// Keep in mind that you still need to fill in some blanks
+// - ZeuX
+
+
+
+
+
+
+package gmail.Lance5057.blocks;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+
+public class ModelCrestMount extends ModelBase
+{
+ //fields
+ ModelRenderer ShieldMount;
+ ModelRenderer Base;
+ ModelRenderer SwordMount1;
+ ModelRenderer SwordMount2;
+ ModelRenderer SwordMount3;
+
+ public ModelCrestMount()
+ {
+ textureWidth = 32;
+ textureHeight = 32;
+
+ ShieldMount = new ModelRenderer(this, 20, 6);
+ ShieldMount.addBox(0F, 0F, 0F, 2, 7, 2);
+ ShieldMount.setRotationPoint(-1F, 17F, -1F);
+ ShieldMount.setTextureSize(32, 32);
+ ShieldMount.mirror = true;
+ setRotation(ShieldMount, 0F, 0F, 0F);
+ Base = new ModelRenderer(this, 0, 6);
+ Base.addBox(0F, 0F, 0F, 4, 4, 4);
+ Base.setRotationPoint(-2F, 20F, -2F);
+ Base.setTextureSize(32, 32);
+ Base.mirror = true;
+ setRotation(Base, 0F, 0F, 0F);
+ SwordMount1 = new ModelRenderer(this, 0, 0);
+ SwordMount1.addBox(-5F, 0F, -2F, 10, 2, 4);
+ SwordMount1.setRotationPoint(0F, 22F, 0F);
+ SwordMount1.setTextureSize(32, 32);
+ SwordMount1.mirror = true;
+ setRotation(SwordMount1, 0F, 0.7853982F, 0F);
+ SwordMount2 = new ModelRenderer(this, 0, 0);
+ SwordMount2.addBox(-5F, 0F, -2F, 10, 2, 4);
+ SwordMount2.setRotationPoint(0F, 22F, 0F);
+ SwordMount2.setTextureSize(32, 32);
+ SwordMount2.mirror = true;
+ setRotation(SwordMount2, 0F, -0.7853982F, 0F);
+ SwordMount3 = new ModelRenderer(this, 0, 0);
+ SwordMount3.addBox(-5F, 0F, -2F, 10, 2, 4);
+ SwordMount3.setRotationPoint(0F, 21.9F, 0F);
+ SwordMount3.setTextureSize(32, 32);
+ SwordMount3.mirror = true;
+ setRotation(SwordMount3, 0F, 1.570796F, 0F);
+ }
+
+ 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);
+ setRotationAngles(f, f1, f2, f3, f4, f5, entity);
+ ShieldMount.render(f5);
+ Base.render(f5);
+ SwordMount1.render(f5);
+ SwordMount2.render(f5);
+ SwordMount3.render(f5);
+ }
+
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
+ {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
+ }
+
+}
diff --git a/src/main/java/gmail/Lance5057/blocks/QueensGoldBlock.java b/src/main/java/gmail/Lance5057/blocks/QueensGoldBlock.java
new file mode 100644
index 0000000..0ad2376
--- /dev/null
+++ b/src/main/java/gmail/Lance5057/blocks/QueensGoldBlock.java
@@ -0,0 +1,15 @@
+package gmail.Lance5057.blocks;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+
+public class QueensGoldBlock extends Block
+{
+
+ public QueensGoldBlock (Material material)
+ {
+ super(material);
+ setHarvestLevel("pickaxe",2);
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/gmail/Lance5057/blocks/Renderer_CrestMount.java b/src/main/java/gmail/Lance5057/blocks/Renderer_CrestMount.java
new file mode 100644
index 0000000..f7a542f
--- /dev/null
+++ b/src/main/java/gmail/Lance5057/blocks/Renderer_CrestMount.java
@@ -0,0 +1,60 @@
+package gmail.Lance5057.blocks;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+
+import org.lwjgl.opengl.GL11;
+
+public class Renderer_CrestMount extends TileEntitySpecialRenderer {
+
+ //The model of your block
+ private final ModelCrestMount model;
+
+ public Renderer_CrestMount() {
+ this.model = new ModelCrestMount();
+ }
+
+ private void adjustRotatePivotViaMeta(World world, int x, int y, int z) {
+ int meta = world.getBlockMetadata(x, y, z);
+ GL11.glPushMatrix();
+ GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);
+ GL11.glPopMatrix();
+ }
+
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {
+ //The PushMatrix tells the renderer to "start" doing something.
+ GL11.glPushMatrix();
+ //This is setting the initial location.
+ GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
+ //This is the texture of your block. It's pathed to be the same place as your other blocks here.
+ //Outdated bindTextureByName("/mods/roads/textures/blocks/TrafficLightPoleRed.png");
+ //Use in 1.6.2 this
+ ResourceLocation textures = (new ResourceLocation("tinkersdefense:textures/blocks/CrestMount.png"));
+ //the ':' is very important
+ //binding the textures
+ Minecraft.getMinecraft().renderEngine.bindTexture(textures);
+
+ //This rotation part is very important! Without it, your model will render upside-down! And for some reason you DO need PushMatrix again!
+ GL11.glPushMatrix();
+ adjustRotatePivotViaMeta(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord);//rotation 1
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(90F, 0.5F, 0.0F, 0.0F);
+ GL11.glTranslatef(0, -1, -1);
+
+
+ //A reference to your Model file. Again, very important.
+ this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
+ //Tell it to stop rendering for both the PushMatrix's
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+}
diff --git a/src/main/java/gmail/Lance5057/blocks/TileEntity_CrestMount.java b/src/main/java/gmail/Lance5057/blocks/TileEntity_CrestMount.java
new file mode 100644
index 0000000..486689c
--- /dev/null
+++ b/src/main/java/gmail/Lance5057/blocks/TileEntity_CrestMount.java
@@ -0,0 +1,7 @@
+package gmail.Lance5057.blocks;
+
+import net.minecraft.tileentity.TileEntity;
+
+public class TileEntity_CrestMount extends TileEntity {
+
+}