What Tut Do You Want? Plz Give Me Something To Code!
Plz If You Use This Tutorial A Small Shout Out To Me Would Be Great!
Thanx Gregzi_O_balls
Posting Error Is Important!
Custom Block Rendering (With Model, Metadata And 3D ITEM!!)
I'm Using The Till Block From My Mod As A Base!
So Lets Start With Basic Mod Files:
Assuming You Have A Basic Mod File Already:
public final static Block block**** = new Block***(500, 1, Material.iron).setHardness(0.1F).setStepSound(Block.soundMetalFootstep).setBlockName("****").setCreativeTab(CreativeTabs.tabDecorations);
And Then Within load function Add
@Init
public void load(FMLInitializationEvent event) {
GameRegistry.registerBlock(block****);
proxy.registerRenderers();
}
Now Within your Client Proxy Add This Inside Your registerRenderers():
ClientRegistry.bindTileEntitySpecialRenderer(TileEntity****.class, new TileEntity****Renderer());
MinecraftForgeClient.registerItemRenderer(*Main Mod File*.block****.blockID, new Item****Renderer());
Next We Have The Block Class:
package *Your Package*;
import cpw.mods.fml.common.Mod.Item;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import com.ducksarebest.McDonalds.*;
public class Block**** extends BlockContainer {
public BlockTill(int id, int texture, Material material) {
super(id, texture, material);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return *Main Mod File*.block****.blockID;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return -2;
}
/**
* Is this block (a) opaque and (B) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int rotation = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 2.5D) & 3;
world.setBlockMetadata(i, j, k, rotation - 1);
}
public TileEntity createNewTileEntity(World par1World)
{
return new TileEntity****();
}
}
Models Can Be Made In Techne!!! It's The Best Part!!
Next We Have The Model Class It Should Look Something Like This:
package *Your Package*;
import net.minecraft.tileentity.TileEntity;
public class TileEntity**** extends TileEntity{
public TileEntity****(){
}
}
Yep I Put Nothing in This Class But You Need It Becuase If You Didn't Know Blocks Are Saved Based On There TileEntity**** So When You Place A Chest It's Meta Data Is Saved In It's Personal TileEntity**** Class
Wow I Am Actually Trying That Right NOW! BUT IT'S ****ING HARD!! Omg It Is Like... I Don't Even Know How To Explain It but I AM Trying And Have A Very Smart Way Of Doing It!!
Wow I Am Actually Trying That Right NOW! BUT IT'S ****ING HARD!! Omg It Is Like... I Don't Even Know How To Explain It but I AM Trying And Have A Very Smart Way Of Doing It!!
Great, I loved this, +1
Is there a way to make this without modloader?
Well That Would Mean You Need To Change CLASS Files But If You Do:
Add It In The Block.java File And Then In RenderBlocks.java Add Yours There And Well Everything Else Is GL11 So It Should Work! But I Don't Know About Registering The TileEntity Files!
I made a model using Techne now I need Minecraft to render it as I have made it. Its a custom torch but its not shaped the same as the default torch. How do I tell Minecraft to use this model instead?
Create A File Model**** And Add All Of That Then Copy The render Method And Rename It renderAll And Get Rid Of First Two Line With And Then Replace All The Other Things(Mental Black) And Replace With 0.0625 Example:
public void renderAll(){
thing1.render(0.0625F);
thing2.render(0.0625F);
}
But If You Want To Replace The Normal Torch Then Inbox Me!
I can't seem to get this working for some reason. The block is just invisible. Got any ideas why that might be without posting my code? I will if you want me to, though.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Create A File Model**** And Add All Of That Then Copy The render Method And Rename It renderAll And Get Rid Of First Two Line With And Then Replace All The Other Things(Mental Black) And Replace With 0.0625 Example:
public void renderAll(){
thing1.render(0.0625F);
thing2.render(0.0625F);
}
But If You Want To Replace The Normal Torch Then Inbox Me!
Wait so make a new "RenderAll".java get rid of two error lines and replace everything AFTER the second error fix with
public void renderAll(){
thing1.render(0.0625F);
thing2.render(0.0625F);
}
Ok, im getting the invisible box thing as well, it all works, i just cant get the damn thing to show up *sad face* the second tut, the one on the no item thing, didnt work for me saving chunks error
Ok, im getting the invisible box thing as well, it all works, i just cant get the damn thing to show up *sad face* the second tut, the one on the no item thing, didnt work for me saving chunks error
Ok Well Are U Doing Cables If Not Then Send Me The Source Files If You Want To Keep It Secret Or Just Post The Files But It's Probs Best TO Just Post Source Files!! You Probably Have The Same Problem As Techguy!
I can't seem to get this working for some reason. The block is just invisible. Got any ideas why that might be without posting my code? I will if you want me to, though.
Probs Best To Post It! Or You Can Inbox It If You Want To Keep It Secret! And OMG It's You It's Techguy!! OMG!!!
What Tut Do You Want?
Plz Give Me Something To Code!
Plz If You Use This Tutorial A Small Shout Out To Me Would Be Great!
Thanx Gregzi_O_balls
Posting Error Is Important!
Custom Block Rendering (With Model, Metadata And 3D ITEM!!)
I'm Using The Till Block From My Mod As A Base!
So Lets Start With Basic Mod Files:
And Then Within load function Add
Now Within your Client Proxy Add This Inside Your registerRenderers():
Next We Have The Block Class:
Models Can Be Made In Techne!!! It's The Best Part!!
Next We Have The Model Class It Should Look Something Like This:
Now The TileEntity*** Class:
Yep I Put Nothing in This Class But You Need It Becuase If You Didn't Know Blocks Are Saved Based On There TileEntity**** So When You Place A Chest It's Meta Data Is Saved In It's Personal TileEntity**** Class
Next The TileEntity****Renderer Class:
Now To Render The Item, This Is Now Done With A Item****Renderer Which Should Look Like:
And That Should Do It!! PLZ If You Use This Give Me A Little Credit!!! And Also Don't Forget The Bottom Right Plus Button Goes A Long Way!!!
Please Keep Using All Capitals!
(/sarcasm)
Well That Would Mean You Need To Change CLASS Files But If You Do:
Add It In The Block.java File And Then In RenderBlocks.java Add Yours There And Well Everything Else Is GL11 So It Should Work! But I Don't Know About Registering The TileEntity Files!
public void renderAll(){
thing1.render(0.0625F);
thing2.render(0.0625F);
}
But If You Want To Replace The Normal Torch Then Inbox Me!
together they are powerful beyond imagination."
Wait so make a new "RenderAll".java get rid of two error lines and replace everything AFTER the second error fix with
?
Ok Well Are U Doing Cables If Not Then Send Me The Source Files If You Want To Keep It Secret Or Just Post The Files But It's Probs Best TO Just Post Source Files!! You Probably Have The Same Problem As Techguy!
Probs Best To Post It! Or You Can Inbox It If You Want To Keep It Secret! And OMG It's You It's Techguy!! OMG!!!
Wow Sorry!! But If you Are Coding Then Read It And Understand It!!
by the way, theres a NullPointerException when using the renderer on the item.