Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi To be honest I don't understand your question at all. Perhaps you could add a bit more explanation, or even better a mocked-up picture of what you have in mind? -TGG
  2. Hi. I would suggest writing some custom rendering code for your block that looks to see what the adjacent block is and either copies its texture, or calls the rendering code for that block directly. A couple of keywords to search for: ISimpleBlockRenderingHandler and RenderBlocks.renderBlockByRenderType and Block.getIcon This link might help to understand how block rendering works: http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html with more detail: http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html Cheers TGG
  3. Hi It's kind of tough to give you any suggestions unless you give us some hints about what the symptoms are :-) At the risk of stating the obvious, I'd suggest you use a debugger to set break points in the code and see if you can figure out which parts of your code aren't being called. Have you remembered to register your RenderFinn class with RenderingRegistry.registerEntityRenderingHandler? Just something I noticed... if you are overriding functions from a base class that you are extending, it's considered good practice to put @Override before the function, it can help pick up subtle mistakes. http://www.javapractices.com/topic/TopicAction.do?Id=223 eg @Override protected void entityInit() { - TGG
  4. Hi. I suspect you need to change your handleRenderType to return true for EQUIPPED_FIRST_PERSON as well as EQUIPPED. EQUIPPED is 3rd person only. Likewise your renderItem code. This sample code might help: http://greyminecraftcoder.blogspot.com.au/2013/09/sample-code-for-rendering-items.html https://github.com/TheGreyGhost/ItemRendering/blob/master/src/TestItemRendering/items/ItemLampshadeRenderer.java
  5. It may be helpful to have a look at the piston. It is a block not a tile entity, and it uses metadata to record which direction the piston is pointing in (based on the player direction when the piston was placed). BlockPistonBase: public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { int l = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2); //etc During the block render it looks at the metadata to figure out how to rotate the faces as necessary for proper rendering. RenderBlocks: public boolean renderPistonBase(Block par1Block, int par2, int par3, int par4, boolean par5) { int l = this.blockAccess.getBlockMetadata(par2, par3, par4); boolean flag1 = par5 || (l & != 0; int i1 = BlockPistonBase.getOrientation(l); float f = 0.25F; if (flag1) { switch (i1) { case 0: this.uvRotateEast = 3; this.uvRotateWest = 3; this.uvRotateSouth = 3; this.uvRotateNorth = 3; this.setRenderBounds(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); break; case 1: this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); break; -->Richard
  6. Hi The answers you're looking for are probably in here: RenderBlocks.renderBlockRedstoneWire() There is a section near the top that figures out how many neighbouring redstone blocks there are: boolean flag = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3, par4, 1) || !this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 - 1, par4, -1); boolean flag1 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3, par4, 3) || !this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 - 1, par4, -1); boolean flag2 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 - 1, 2) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 - 1, -1); boolean flag3 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 + 1, 0) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 + 1, -1); {etc} par2, par3, par4 correspond to [x,y,z]. Based on these flags, the rendering code chooses the right icons to render (using tessellator.addVertexWithUV()...) See also http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html
  7. After three hours wrestling with this damn error: I finally figured out where to place my icons and textures so that Minecraft will find them. In order to find the icon corresponding to itemIcon = iconRegister.registerIcon("TestItemRendering:Error"); it is constructed as : In my case, this comes out as where my base path was The hardest bit was figuring out what the base path should be, it will be different for you of course. I finally found it by inserting a breakpoint in here. public AbstractResourcePack(File par1File) { this.basePath = par1File; } If that doesn't work for you, you might also try FolderResourcePack protected boolean makeFullPath(String par1Str) { return (new File(this.basePath, par1Str)).isFile(); } FileResourcePack protected boolean makeFullPath(String par1Str) { return (new File(this.basePath, par1Str)).isFile(); }
  8. If you only do the positives, you will only get three of the six faces (Ypos Up, Zpos South, Xpos East). Try it and see....
  9. Hi I'm slowly wrestling my way through the various rendering code and I think I've come across a couple of mistakes. RenderBlocks has six renderFace methods (eg renderFaceYNeg), and these renderFace methods use some flags (set by the caller) to alter how the faces are rendered, for example uvRotateEast. The problem I'm found is that some of these aren't properly named. For example- renderFaceZPos uses the uvRotateWest flag, but the positive Z face is south, not west. Is there a robust way I can change these? i.e. so I can write renderBlock.uvRotateSouth = 1; renderBlock.renderFaceZpos(); I don't understand how Forge decompiles the Minecraft jar and gives meaningful names to everything - is this something I can customise (for example - giving better names to the parameters of various interface functions (eg par1, par2)), without having to do it all from scratch every time I update to a new version of Forge? Cheers Richard
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.