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:
And Then Within load function Add
Now Within your Client Proxy Add This Inside Your registerRenderers():
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.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class Model**** extends ModelBase { // fields ModelRenderer Base; ModelRenderer Head2; ModelRenderer Keyboard; ModelRenderer Head1; ModelRenderer Head3; ModelRenderer Stand1; ModelRenderer Stand2; ModelRenderer Till; public Model****() { textureWidth = 64; textureHeight = 128; Base = new ModelRenderer(this, 0, 48).setTextureSize(textureWidth, textureHeight); Base.addBox(-8F, -3F, -8F, 16, 3, 16, 0.0F); Base.setRotationPoint(0F, 24F, 0F); setRotation(Base, 0F, 0F, 0F); Head2 = new ModelRenderer(this, 0, 0).setTextureSize(textureWidth, textureHeight); Head2.addBox(0F, -1F, -4F, 4, 3, 8, 0.0F); Head2.setRotationPoint(3F, 20F, 2F); setRotation(Head2, 0F, 0F, -0.7853982F); Keyboard = new ModelRenderer(this, 0, 22).setTextureSize(textureWidth, textureHeight); Keyboard.addBox(-4F, -1F, -6F, 8, 1, 12, 0.0F); Keyboard.setRotationPoint(-3F, 21F, 0F); setRotation(Keyboard, 0F, 0F, 0F); Head1 = new ModelRenderer(this, 88, 0).setTextureSize(textureWidth, textureHeight); Head1.addBox(-1F, -2F, -4F, 2, 2, 8, 0.0F); Head1.setRotationPoint(6F, 21F, 2F); setRotation(Head1, 0F, 0F, 0F); Head3 = new ModelRenderer(this, 72, 0).setTextureSize(textureWidth, textureHeight); Head3.addBox(-1F, -1F, -1F, 1, 2, 3, 0.0F); Head3.setRotationPoint(4F, 18F, 3F); setRotation(Head3, 0F, 0F, 0.7853982F); Stand1 = new ModelRenderer(this, 72, 0).setTextureSize(textureWidth, textureHeight); Stand1.addBox(0F, -8F, 0F, 1, 8, 1, 0.0F); Stand1.setRotationPoint(4F, 21F, -5F); setRotation(Stand1, 0F, 0F, 0F); Stand2 = new ModelRenderer(this, 48, 0).setTextureSize(textureWidth, textureHeight); Stand2.addBox(0F, -2F, -1F, 1, 2, 3, 0.0F); Stand2.setRotationPoint(4F, 13F, -5F); setRotation(Stand2, 0F, 0.5235988F, 0F); Till = new ModelRenderer(this, 0, 86).setTextureSize(textureWidth, textureHeight); Till.addBox(-8F, -1F, -6F, 8, 1, 12, 0.0F); Till.setRotationPoint(0F, 23F, 0F); setRotation(Till, 0F, 0F, 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); Base.render(f5); Head2.render(f5); Keyboard.render(f5); Head1.render(f5); Head3.render(f5); Stand1.render(f5); Stand2.render(f5); Till.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void renderAll() { Base.render(0.0625F); Head2.render(0.0625F); Keyboard.render(0.0625F); Head1.render(0.0625F); Head3.render(0.0625F); Stand1.render(0.0625F); Stand2.render(0.0625F); Till.render(0.0625F); } }
Now The TileEntity*** Class:
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
Next The TileEntity****Renderer Class:
package *Your Package*; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import org.lwjgl.opengl.GL11; import java.io.IOException; import java.io.InputStream; public class TileEntity****Renderer extends TileEntitySpecialRenderer{ public TileEntity****Renderer(){ model = new Model****(); } public void renderAModelAt(TileEntity**** tile, double d, double d1, double d2, float f) { int rotation = 0; if(tile.worldObj != null) { rotation = tile.getBlockMetadata(); } bindTextureByName("*Your Texture*.png"); //texture GL11.glPushMatrix(); GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); GL11.glScalef(1.0F, -1F, -1F); GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); model.renderAll(); GL11.glPopMatrix(); //end } private Model**** model; public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { this.renderAModelAt((TileEntity****)par1TileEntity, par2, par4, par6, par8); } }
Now To Render The Item, This Is Now Done With A Item****Renderer Which Should Look Like:
package com.ducksarebest.McDonalds; import org.lwjgl.opengl.GL11; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.item.ItemStack; import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.IItemRenderer; public class Item****Renderer implements IItemRenderer { private Model**** ****Model; public Item****Renderer() { ****Model = new Model****(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return true; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { TileEntityRenderer.instance.renderTileEntityAt(new TileEntity****(), 0.0D, 0.0D, 0.0D, 0.0F); } }
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!!!
1
Ancient Totems spawn enemies instead of darkness. Reclaim the world around you by destroying these totems, and expand your territory by doing so.
This was a quick 3-day project for me, but I hope you enjoy the simplicity of the mod.
Download here!
https://minecraft.curseforge.com/projects/totemic-enemies
4
Note: I make changes pretty constantly so some of these pictures could easily be out of date.
LOOKING FOR FEEDBACK!
DOWNLOAD LINK IS AT THE BOTTOM OF THIS POST
Image Albums:
http://imgur.com/a/Tksew
http://imgur.com/a/bMb9N
Economy
Citizens
Specializations
Big-F
ACS
PolyZones
Height
Factions
Outlands
Upcoming features are listed in order of priority, and the list will be updated (probably) infrequently. The list itself is subject to change pretty much whenever I want to change it. Sorry guys, such is the curse of being a casual developer.
Roads that boost player movespeed when moving on themDone!Skill tree overhaul- branching options, no rigidityInter-player trading GUIDone!Also, why "LoMaS"? It's an in-joke with my group of friends, and it just kinda stuck eventually.
Here's the download link!
http://minecraft.curseforge.com/projects/lomas
Note: This mod is currently compatible with Forge 2043- so when installing Forge, be sure to use that version.
If you find any issues, use the Bitbucket to report them. It's easier that way.
https://bitbucket.org/bitevo/lomas/issues?status=new&status=open
==========================================================================================
For anyone interested, I've started hosting an Alpha server for LoMaS that's running the latest version. It's very barebones at the moment, but hopefully we can start filtering in and exploring.
The full server address is 167.114.116.145:26137
1
That should be possible. Thank you for the feedback. It really helps my motivation knowing that people are actually interested in the development of the mod.
1
I'm very glad to hear that!
1
1) There are a few things in LoMaS that affect performance- the most notable is that Leaves and Animals both tick infrequently in order to function properly, so if you're in an area with a lot of animals or leaves, that could be affecting your performance, but I would potentially need more details in order to pinpoint down what sort of issues you're experiencing.
2) Are you playing on a server? LoMaS has a 'PolyZones' module that dynamically sends/updates zones of protection via small coordinates- for consistency purposes (since LoMaS is designed as a multiplayer experience) players must successfully have the files before being allowed to move. Since you were connected and unlocked, you successfully received the files.
1
+1.
Diversity is usually a very good thing, and it's very true in this case.