could you make an AI.... like to be able to double check my code.. against one that is written... the video's out there are nice.. i just want to be able to look and not have to pause or click through to get the info i need.. or double check to see if i got it write... not lazy.. it just get irritating having to do that just to see if missed something. then realizing oosp wrong vid.. need different one.. it just hair pulling irritation.
i get how it works just i rather not miss something and have to go and look see if someone had same issue.. I'm not big on posting.. repeating what other have already asked.. it feels like spamming even if i hadn't asked it...
just one other thing about extending blocks couldn't the method use for glass work for that?
could you make an AI.... like to be able to double check my code.. against one that is written... the video's out there are nice.. i just want to be able to look and not have to pause or click through to get the info i need.. or double check to see if i got it write... not lazy.. it just get irritating having to do that just to see if missed something. then realizing oosp wrong vid.. need different one.. it just hair pulling irritation.
i get how it works just i rather not miss something and have to go and look see if someone had same issue.. I'm not big on posting.. repeating what other have already asked.. it feels like spamming even if i hadn't asked it...
just one other thing about extending blocks couldn't the method use for glass work for that?
there a way to put models on blocks without tileEntities, since it seems redundant putting a tile entity on a simple block.
And throwable items are real simple, just make an item that when right-clicked it consumes the item and creates an entity, the entity(just extend entitySnowball) can be used to move and break on impact, then in baseMod add the render(like any entity) and make it renderSnowball(then the image), just look at the snowball item/entity(or egg) then the renderManager class
Hey Ducky, here's my code. My problem was that the block is invisible.
mod_
public static final Block gravestone = new ModUndeadBlockGravestone(178, 0, net.minecraft.src.ModUndeadTileEntityGravestone.class).setBlockName("gravestone");
public static final Item gravestonePlace = new ItemReed(4508, gravestone).setItemName("gravestonePlace");
public void load()
{
ModLoader.registerBlock(gravestone);
ModLoader.addName(gravestone, "Gravestone");
ModLoader.addRecipe(new ItemStack(gravestone, 2), new Object [] {"#", Character.valueOf('#'), Block.dirt});
ModLoader.registerTileEntity(ModUndeadTileEntityGravestone.class, "Gravestone");
ModUndeadTileEntityGravestoneRenderer gravestoneRender = new ModUndeadTileEntityGravestoneRenderer();
ModLoader.registerTileEntity(ModUndeadTileEntityGravestoneRenderer.class, "GravestoneRenderer", gravestoneRender);
}
tile entity:
package net.minecraft.src;
public class ModUndeadTileEntityGravestone extends TileEntity
{
public ModUndeadTileEntityGravestone()
{
}
}
tile entity renderer:
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class ModUndeadTileEntityGravestoneRenderer extends TileEntitySpecialRenderer
{
public ModUndeadTileEntityGravestoneRenderer()
{
model = new ModUndeadModelGravestone();
}
public void renderAModelAt(ModUndeadTileEntityGravestone tile, double d, double d1, double d2, float f)
{
int i = tile.getBlockMetadata(); //this is for rotation
int j = 0;
if (i == 0)
{
j = 0;
}
if (i == 1)
{
j = 90;
}
if (i == 2)
{
j = 180;
}
if (i == 3)
{
j = 270;
}
bindTextureByName("/Undead+/gravestone.png"); //texture
GL11.glPushMatrix(); //start
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); //size
GL11.glRotatef(j, 0.0F, 1.0F, 0.0F); //rotate based on metadata
GL11.glScalef(1.0F, -1F, -1F); //if you read this comment out this line and you can see what happens
model.renderModel(0.0625F); //renders and yes 0.0625 is a random number
GL11.glPopMatrix(); //end
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
{
renderAModelAt((ModUndeadTileEntityGravestone) tileentity, d, d1, d2, f); //where to render
}
private ModUndeadModelGravestone model;
}
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hey Ducky, here's my code. My problem was that the block is invisible.
mod_
public static final Block gravestone = new ModUndeadBlockGravestone(178, 0, net.minecraft.src.ModUndeadTileEntityGravestone.class).setBlockName("gravestone");
public static final Item gravestonePlace = new ItemReed(4508, gravestone).setItemName("gravestonePlace");
public void load()
{
ModLoader.registerBlock(gravestone);
ModLoader.addName(gravestone, "Gravestone");
ModLoader.addRecipe(new ItemStack(gravestone, 2), new Object [] {"#", Character.valueOf('#'), Block.dirt});
ModLoader.registerTileEntity(ModUndeadTileEntityGravestone.class, "Gravestone");
ModUndeadTileEntityGravestoneRenderer gravestoneRender = new ModUndeadTileEntityGravestoneRenderer();
ModLoader.registerTileEntity(ModUndeadTileEntityGravestoneRenderer.class, "GravestoneRenderer", gravestoneRender);
}
tile entity:
package net.minecraft.src;
public class ModUndeadTileEntityGravestone extends TileEntity
{
public ModUndeadTileEntityGravestone()
{
}
}
tile entity renderer:
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class ModUndeadTileEntityGravestoneRenderer extends TileEntitySpecialRenderer
{
public ModUndeadTileEntityGravestoneRenderer()
{
model = new ModUndeadModelGravestone();
}
public void renderAModelAt(ModUndeadTileEntityGravestone tile, double d, double d1, double d2, float f)
{
int i = tile.getBlockMetadata(); //this is for rotation
int j = 0;
if (i == 0)
{
j = 0;
}
if (i == 1)
{
j = 90;
}
if (i == 2)
{
j = 180;
}
if (i == 3)
{
j = 270;
}
bindTextureByName("/Undead+/gravestone.png"); //texture
GL11.glPushMatrix(); //start
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); //size
GL11.glRotatef(j, 0.0F, 1.0F, 0.0F); //rotate based on metadata
GL11.glScalef(1.0F, -1F, -1F); //if you read this comment out this line and you can see what happens
model.renderModel(0.0625F); //renders and yes 0.0625 is a random number
GL11.glPopMatrix(); //end
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
{
renderAModelAt((ModUndeadTileEntityGravestone) tileentity, d, d1, d2, f); //where to render
}
private ModUndeadModelGravestone model;
}
ModUndeadTileEntityGravestone tileent1 = new ModUndeadTileEntityGravestone();
ModLoader.registerTileEntity(ModUndeadTileEntityGravestone.class, "CopperCable", tileent1);
Thought it would be something simple. Thanks!
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I'm back again When I have my block set up to place from different directions, the hitbox changes but the model's position doesn't. Have any idea of what might be going on?
Renderer code
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class ModUndeadTileEntityGravestoneRenderer extends TileEntitySpecialRenderer
{
public ModUndeadTileEntityGravestoneRenderer()
{
model = new ModUndeadModelGravestone();
}
public void renderAModelAt(ModUndeadTileEntityGravestone tile, double d, double d1, double d2, float f)
{
int i = 0;
int j = 0;
if (i == 0)
{
j = 0;
}
if (i == 1)
{
j = 90;
}
if (i == 2)
{
j = 180;
}
if (i == 3)
{
j = 270;
}
if (tile.worldObj != null)
{
i = tile.getBlockMetadata();
}
bindTextureByName("/Undead+/gravestone.png");
GL11.glPushMatrix();
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
GL11.glRotatef(j, 0.0F, 1.0F, 0.0F);
GL11.glScalef(1.0F, -1F, -1F);
model.renderModel(0.0625F);
GL11.glPopMatrix();
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
{
renderAModelAt((ModUndeadTileEntityGravestone) tileentity, d, d1, d2, f);
}
private ModUndeadModelGravestone model;
}
Block code. There is probably a lot of unneeded or irrelevant code in here but I am just trying to get it working before I do anything else.
package net.minecraft.src;
import java.util.Random;
public class ModUndeadBlockGravestone extends BlockContainer
{
public ModUndeadBlockGravestone(int i, int j, Class class1)
{
super(i, j, Material.cloth);
gravestoneClass = class1;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
}
public int quantityDropped(Random random)
{
return random.nextInt(2);
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public int getRenderType()
{
return mod_Undead.gravestoneRenderID;
}
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
setGravestoneDefaultDirection(par1World, par2, par3, par4);
}
private void setGravestoneDefaultDirection(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
int i = par1World.getBlockId(par2, par3, par4 - 1);
int j = par1World.getBlockId(par2, par3, par4 + 1);
int k = par1World.getBlockId(par2 - 1, par3, par4);
int l = par1World.getBlockId(par2 + 1, par3, par4);
byte byte0 = 3;
if (Block.opaqueCubeLookup[i] && !Block.opaqueCubeLookup[j])
{
byte0 = 3;
}
if (Block.opaqueCubeLookup[j] && !Block.opaqueCubeLookup[i])
{
byte0 = 2;
}
if (Block.opaqueCubeLookup[k] && !Block.opaqueCubeLookup[l])
{
byte0 = 5;
}
if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[k])
{
byte0 = 4;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, byte0);
}
}
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
int i = MathHelper.floor_double((double)((par5EntityLiving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if (i == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2);
}
if (i == 1)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 5);
}
if (i == 2)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3);
}
if (i == 3)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
}
}
public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer){
int p = MathHelper.floor_double((double)((par5EntityPlayer.rotationYaw * 4F) / 360F) + 0.5D) & 3; //this is a smart equation
byte byte0 = 3;
if (p == 0)
{
byte0 = 4;
}
if (p == 1)
{
byte0 = 3;
}
if (p == 2)
{
byte0 = 2;
}
if (p == 3)
{
byte0 = 1;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, byte0);
return true;
}
public boolean canPlaceBlockAt(World par1World, int i, int j, int k)
{
int l = par1World.getBlockId(i, j - 1, k);
if(l != 0)
{
return true;
}
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
float f = 0.125F;
if (i == 2)
{
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
if (i == 3)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
}
if (i == 4)
{
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
if (i == 5)
{
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
}
/**
* Returns the bounding box of the wired rectangular prism to render.
*/
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
float f = 0.125F;
if (i == 2)
{
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
if (i == 3)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
}
if (i == 4)
{
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
if (i == 5)
{
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
}
public TileEntity getBlockEntity()
{
return new ModUndeadTileEntityGravestone();
}
private Class gravestoneClass;
}
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I'm back again When I have my block set up to place from different directions, the hitbox changes but the model's position doesn't. Have any idea of what might be going on?
Renderer code
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class ModUndeadTileEntityGravestoneRenderer extends TileEntitySpecialRenderer
{
public ModUndeadTileEntityGravestoneRenderer()
{
model = new ModUndeadModelGravestone();
}
public void renderAModelAt(ModUndeadTileEntityGravestone tile, double d, double d1, double d2, float f)
{
int i = 0;
int j = 0;
if (i == 0)
{
j = 0;
}
if (i == 1)
{
j = 90;
}
if (i == 2)
{
j = 180;
}
if (i == 3)
{
j = 270;
}
if (tile.worldObj != null)
{
i = tile.getBlockMetadata();
}
bindTextureByName("/Undead+/gravestone.png");
GL11.glPushMatrix();
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
GL11.glRotatef(j, 0.0F, 1.0F, 0.0F);
GL11.glScalef(1.0F, -1F, -1F);
model.renderModel(0.0625F);
GL11.glPopMatrix();
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
{
renderAModelAt((ModUndeadTileEntityGravestone) tileentity, d, d1, d2, f);
}
private ModUndeadModelGravestone model;
}
Block code. There is probably a lot of unneeded or irrelevant code in here but I am just trying to get it working before I do anything else.
package net.minecraft.src;
import java.util.Random;
public class ModUndeadBlockGravestone extends BlockContainer
{
public ModUndeadBlockGravestone(int i, int j, Class class1)
{
super(i, j, Material.cloth);
gravestoneClass = class1;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
}
public int quantityDropped(Random random)
{
return random.nextInt(2);
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public int getRenderType()
{
return mod_Undead.gravestoneRenderID;
}
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
setGravestoneDefaultDirection(par1World, par2, par3, par4);
}
private void setGravestoneDefaultDirection(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
int i = par1World.getBlockId(par2, par3, par4 - 1);
int j = par1World.getBlockId(par2, par3, par4 + 1);
int k = par1World.getBlockId(par2 - 1, par3, par4);
int l = par1World.getBlockId(par2 + 1, par3, par4);
byte byte0 = 3;
if (Block.opaqueCubeLookup[i] && !Block.opaqueCubeLookup[j])
{
byte0 = 3;
}
if (Block.opaqueCubeLookup[j] && !Block.opaqueCubeLookup[i])
{
byte0 = 2;
}
if (Block.opaqueCubeLookup[k] && !Block.opaqueCubeLookup[l])
{
byte0 = 5;
}
if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[k])
{
byte0 = 4;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, byte0);
}
}
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
int i = MathHelper.floor_double((double)((par5EntityLiving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if (i == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2);
}
if (i == 1)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 5);
}
if (i == 2)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3);
}
if (i == 3)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
}
}
public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer){
int p = MathHelper.floor_double((double)((par5EntityPlayer.rotationYaw * 4F) / 360F) + 0.5D) & 3; //this is a smart equation
byte byte0 = 3;
if (p == 0)
{
byte0 = 4;
}
if (p == 1)
{
byte0 = 3;
}
if (p == 2)
{
byte0 = 2;
}
if (p == 3)
{
byte0 = 1;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, byte0);
return true;
}
public boolean canPlaceBlockAt(World par1World, int i, int j, int k)
{
int l = par1World.getBlockId(i, j - 1, k);
if(l != 0)
{
return true;
}
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
float f = 0.125F;
if (i == 2)
{
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
if (i == 3)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
}
if (i == 4)
{
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
if (i == 5)
{
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
}
/**
* Returns the bounding box of the wired rectangular prism to render.
*/
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
float f = 0.125F;
if (i == 2)
{
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
if (i == 3)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
}
if (i == 4)
{
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
if (i == 5)
{
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
}
public TileEntity getBlockEntity()
{
return new ModUndeadTileEntityGravestone();
}
private Class gravestoneClass;
}
I Think It's Got To Do With How You Set The Direction, Check The Tut On How I Do It! (I Do It With The Way The Persons Facing!)
I did have my code exactly like yours, but directions didn't work at all.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Sorry to repeat the same question as everyone else but my block is not rendering. i have read the other times people asked but they didn't seem to work. so could you take a look
Mod_
package net.minecraft.src;
import net.minecraft.client.Minecraft;
public class mod_Anvil extends BaseMod
{
public static final Block Anvil = new ModAnvilBlock(200, 0, net.minecraft.src.ModAnvilTileEntity.class).setHardness(3F).setResistance(5F).setBlockName("Anvil");
public static final Item ItemAnvil = (new ItemReed(202, Anvil)).setIconCoord(0, 0).setItemName("itemAnvil");
public static final Item Hammer = (new ModAnvilRod(199)).setIconIndex(Item.axeDiamond.iconIndex).setItemName("Hammer");
public static final Item IronRod = (new ModAnvilRod(200)).setIconIndex(Item.stick.iconIndex).setItemName("IronRod");
public static final Item HotIronRod = (new ModAnvilRod(201)).setIconIndex(Item.blazeRod.iconIndex).setItemName("IronRod");
public mod_Anvil()
{
}
public void load()
{
ModLoader.addName(Hammer, "Hammer");
ModLoader.registerBlock(Anvil);
ModLoader.addName(Anvil, "Anvil");
ModLoader.addName(IronRod, "Iron Rod");
ModLoader.addRecipe(new ItemStack(mod_Anvil.Anvil, 1), new Object[] {"X X", " ", "X X", Character.valueOf('X'), Block.dirt});
ModLoader.addRecipe(new ItemStack(mod_Anvil.IronRod, 1), new Object[] {"X", "X", "X", Character.valueOf('X'), Block.dirt});
ModLoader.addRecipe(new ItemStack(mod_Anvil.Hammer, 1), new Object[] {"XXX", "XXX", " X ", Character.valueOf('X'), Block.dirt});
ModLoader.addSmelting(IronRod.shiftedIndex,new ItemStack(HotIronRod));
ModAnvilTileEntityRenderer tileent1 = new ModAnvilTileEntityRenderer();
ModLoader.registerTileEntity(ModAnvilTileEntity.class, "Anvil", tileent1);
}
public String getVersion()
{
return "1.2.5";
}
}
TileEntity Render
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class ModAnvilTileEntityRenderer extends TileEntitySpecialRenderer {
public ModAnvilTileEntityRenderer() {
model = new ModelAnvil();
}
public void renderAModelAt(ModAnvilTileEntity tile, double d, double d1, double d2, float f) {
int i = tile.getBlockMetadata(); //this is for rotation
int j = 0;
if (i == 0)
{
j = 0;
}
if (i == 1)
{
j = 90;
}
if (i == 2)
{
j = 180;
}
if (i == 3)
{
j = 270;
}
bindTextureByName("/Anvil.png"); //texture
GL11.glPushMatrix(); //start
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); //size
GL11.glRotatef(j, 0.0F, 1.0F, 0.0F); //rotate based on metadata
GL11.glScalef(1.0F, -1F, -1F); //if you read this comment out this line and you can see what happens
model.renderModel(0.0625F); //renders and yes 0.0625 is a random number
System.out.println("It should work");
GL11.glPopMatrix(); //end
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) {
renderAModelAt((ModAnvilTileEntity) tileentity, d, d1, d2, f); //where to render
}
private ModelAnvil model;
}
Sorry to repeat the same question as everyone else but my block is not rendering. i have read the other times people asked but they didn't seem to work. so could you take a look
Mod_
package net.minecraft.src;
import net.minecraft.client.Minecraft;
public class mod_Anvil extends BaseMod
{
public static final Block Anvil = new ModAnvilBlock(200, 0, net.minecraft.src.ModAnvilTileEntity.class).setHardness(3F).setResistance(5F).setBlockName("Anvil");
public static final Item ItemAnvil = (new ItemReed(202, Anvil)).setIconCoord(0, 0).setItemName("itemAnvil");
public static final Item Hammer = (new ModAnvilRod(199)).setIconIndex(Item.axeDiamond.iconIndex).setItemName("Hammer");
public static final Item IronRod = (new ModAnvilRod(200)).setIconIndex(Item.stick.iconIndex).setItemName("IronRod");
public static final Item HotIronRod = (new ModAnvilRod(201)).setIconIndex(Item.blazeRod.iconIndex).setItemName("IronRod");
public mod_Anvil()
{
}
public void load()
{
ModLoader.addName(Hammer, "Hammer");
ModLoader.registerBlock(Anvil);
ModLoader.addName(Anvil, "Anvil");
ModLoader.addName(IronRod, "Iron Rod");
ModLoader.addRecipe(new ItemStack(mod_Anvil.Anvil, 1), new Object[] {"X X", " ", "X X", Character.valueOf('X'), Block.dirt});
ModLoader.addRecipe(new ItemStack(mod_Anvil.IronRod, 1), new Object[] {"X", "X", "X", Character.valueOf('X'), Block.dirt});
ModLoader.addRecipe(new ItemStack(mod_Anvil.Hammer, 1), new Object[] {"XXX", "XXX", " X ", Character.valueOf('X'), Block.dirt});
ModLoader.addSmelting(IronRod.shiftedIndex,new ItemStack(HotIronRod));
ModAnvilTileEntityRenderer tileent1 = new ModAnvilTileEntityRenderer();
ModLoader.registerTileEntity(ModAnvilTileEntity.class, "Anvil", tileent1);
}
public String getVersion()
{
return "1.2.5";
}
}
TileEntity Render
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class ModAnvilTileEntityRenderer extends TileEntitySpecialRenderer {
public ModAnvilTileEntityRenderer() {
model = new ModelAnvil();
}
public void renderAModelAt(ModAnvilTileEntity tile, double d, double d1, double d2, float f) {
int i = tile.getBlockMetadata(); //this is for rotation
int j = 0;
if (i == 0)
{
j = 0;
}
if (i == 1)
{
j = 90;
}
if (i == 2)
{
j = 180;
}
if (i == 3)
{
j = 270;
}
bindTextureByName("/Anvil.png"); //texture
GL11.glPushMatrix(); //start
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); //size
GL11.glRotatef(j, 0.0F, 1.0F, 0.0F); //rotate based on metadata
GL11.glScalef(1.0F, -1F, -1F); //if you read this comment out this line and you can see what happens
model.renderModel(0.0625F); //renders and yes 0.0625 is a random number
System.out.println("It should work");
GL11.glPopMatrix(); //end
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) {
renderAModelAt((ModAnvilTileEntity) tileentity, d, d1, d2, f); //where to render
}
private ModelAnvil model;
}
could you make an AI.... like to be able to double check my code.. against one that is written... the video's out there are nice.. i just want to be able to look and not have to pause or click through to get the info i need.. or double check to see if i got it write... not lazy.. it just get irritating having to do that just to see if missed something. then realizing oosp wrong vid.. need different one.. it just hair pulling irritation.
i get how it works just i rather not miss something and have to go and look see if someone had same issue.. I'm not big on posting.. repeating what other have already asked.. it feels like spamming even if i hadn't asked it...
just one other thing about extending blocks couldn't the method use for glass work for that?
thanks
I'm Confused! Wat Are You Saying?
I'll Do Your's First!!
Then I Will Do Yours!!
And Thanx Both Of You For Giving Me Something To Do!
And throwable items are real simple, just make an item that when right-clicked it consumes the item and creates an entity, the entity(just extend entitySnowball) can be used to move and break on impact, then in baseMod add the render(like any entity) and make it renderSnowball(then the image), just look at the snowball item/entity(or egg) then the renderManager class
I have used your tutorial on cables, nice one
You should add something on how to handle collision boxes with the cables
Also could you make a tutorial on how to make bigger signs? that would be great
Photography website: www.srphoto.ch Twitter: @Spitfire4466
mod_
tile entity:
tile entity renderer:
model:
together they are powerful beyond imagination."
Sorry But I Found It In A Sec!
You Register Tile Entity Wrong!
Its:
ModUndeadTileEntityGravestone tileent1 = new ModUndeadTileEntityGravestone();
ModLoader.registerTileEntity(ModUndeadTileEntityGravestone.class, "CopperCable", tileent1);
Thought it would be something simple. Thanks!
together they are powerful beyond imagination."
What is it supposed to do etc.?
block****.applyModel();
But It Is Hard!!
Renderer code
Block code. There is probably a lot of unneeded or irrelevant code in here but I am just trying to get it working before I do anything else.
together they are powerful beyond imagination."
Custom tree tut
Custom ore tut
Custom mob tut
Custom torch tut!
I Think It's Got To Do With How You Set The Direction, Check The Tut On How I Do It! (I Do It With The Way The Persons Facing!)
Um I Can Try!
together they are powerful beyond imagination."
Look Over And Make Sure Your Metadata's Are From 1-4
TileEntity Render
Is there any thing else you need?
Model Class?
I Need More!
I found the problem. I had set it to block not block container. thank you for this tut it has helped a bunch.
A custom bow tutorial with animation, that doesn't animate the icon on the bar(leading to multiple equipped bows showing animations at once)