TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
[1.7.10] Build of my mod crashes the game but not in eclipse
TheGreyGhost replied to iLegendx98's topic in Modder Support
Hi Have you called the package directory Items instead of items by any chance? -TGG -
[1.7.10] Block Model Render in Inventory [SOLVED]
TheGreyGhost replied to iLegendx98's topic in Modder Support
Hi I think the Block is being registered ok, but your IItemRenderer is not, perhaps. you are registering it here in ClientProxy MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RunicScrolls.blockEnditeReactor), new RenderItemEnditeReactor(render, new TileEntityEnditeReactor())); Off the top of my head that looks right so I suspect that either 1) this proxy method is never called, or 2) this proxy method is called before your blockEnditeReactor = new BlockEnditeReactor is being called. -TGG -
[1.7.10] Block Model Render in Inventory [SOLVED]
TheGreyGhost replied to iLegendx98's topic in Modder Support
Hi If you put a breakpoint in your shouldUseRenderHelper INVENTORY case, (or alternatively System.out.println("renderItem()"), does it get called or not? If not, you probably haven't registered the IItemRenderer correctly. Is RunicScrolls.blockEnditeReactor null perhaps? -TGG -
1.7.10 Adding a delay to setting a block within a Tile Entity
TheGreyGhost replied to Eractnod's topic in Modder Support
Hi Your tile Entity can render anywhere, so you can render it in 1/8 block steps if you want. I imagine your lift shaft is rendered using blocks, and your elevator using the TileEntitySpecialRenderer, which gives you lots of flexibility? The server doesn't need to do much - just to communicate to the client what the elevator state is (moving, to which floor, etc); the smooth movement needs to happen on the client. On the client, every tick, update the elevator position based on the speed. For example float currentYpos = lastTickYPos + currentSpeedBlocksPerTick; Then render the elevator at the fractional y position (and update the player position if they are inside the elevator - you will need to figure out how to temporarily ignore server updates of the player position to avoid rubber banding - I have done that before, don't remember off hand since I don't have my code to hand - let us know if you need help with that). -TGG -
[1.7.10] How to differentiate Wood types
TheGreyGhost replied to DeMoMan159's topic in Modder Support
Hi I think all you need to do is use an ItemStack with the appropriate "damage" value, i.e. corresponding to the type of wood For example - from vanilla CraftingManager() this.addRecipe(new ItemStack(Block.stairsWoodOak, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 0)}); this.addRecipe(new ItemStack(Block.stairsWoodBirch, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 2)}); this.addRecipe(new ItemStack(Block.stairsWoodSpruce, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 1)}); this.addRecipe(new ItemStack(Block.stairsWoodJungle, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 3)}); -TGG -
[1.7.10] Metadata Blocks all use same texture?
TheGreyGhost replied to MrProg's topic in Modder Support
Hi I reckon the problem is here, you are missing the case for inventory. switch (type) { case EQUIPPED: return true; case EQUIPPED_FIRST_PERSON: return true; case ENTITY: return true; default: return false; } Look at this link for more information, the Item Rendering Sections and especially the "Using IItemRenderer" http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html I'm guessing you don't know how to use breakpoints? I'd recommend you spend a bit of time learning how, they are extremely powerful debugging methods and you'll wonder how you ever managed without it. -TGG -
[1.7.10] Rotate an Item's texture in inventory?
TheGreyGhost replied to Eternaldoom's topic in Modder Support
Hi yes there is, you can use an IItemRenderer, see the item rendering sections here http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html In your renderer, use GL11.glRotatef(180, 0, 1, 0); to rotate by 180 degrees around the vertical axis. http://www.glprogramming.com/red/chapter03.html -TGG -
[1.7.10] Metadata Blocks all use same texture?
TheGreyGhost replied to MrProg's topic in Modder Support
Hi I assume you want the item in your hand to just show an ordinary texture, like most of the vanilla items do? Holding the block in your hand is actually rendered using the item, not the block. You can troubleshoot it further by placing a breakpoint in the Item Rendering code and seeing why it returns the wrong texture See here for some background info (1.6.4 but still similar) http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-first-person-view-items.html see ItemRenderer.renderItemInFirstPerson() -TGG -
[Solved] [1.7.10] Tick an item every step
TheGreyGhost replied to xwerswoodx's topic in Modder Support
hi If that doesn't work for you, you could always hook the general tick event and check all the inventory slots to see if your item is in any of them. -TGG -
[1.6.4] Trouble With Opacity/Backface Culling
TheGreyGhost replied to XLzanfran's topic in Modder Support
Hi You might find this link interesting http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html shouldSideBeRendered() is the reason. -TGG -
Hi I think you need to do markBlockForUpdate() on the client side as well as the server side in order to re-render the blocks. Blocks only update their render appearance when you trigger it (eg the block is changed) (unlike TileEntity Special Renderer). i.e. markBlockForUpdate() on the server sends the new information to the client markBlockForUpdate() on the client then updates the render information. I would suggest that your TileEntity tick on the client side should check for a change (eg caused by onDataPacket) and call the markBlockForUpdate when it changes -TGG
-
FYI last time I checked: Server side you can access the worlds from MinecraftServer.getServer().worldServerForDimension or DimensionManager.getWorld() Client side you can access the world from Minecraft.theworld See here for an overview of what it looked like in 1.6.4; probably it is still almost the same... http://greyminecraftcoder.blogspot.com.au/2013/10/client-side-class-linkage-map.html http://greyminecraftcoder.blogspot.com.au/2013/10/server-side-class-linkage-map.html -TGG
-
Either of those methods should be suitable; post your code? I think you must have implemented them incorrectly somehow. -TGG
-
[1.7.10] Tesselator/TESR rendering .png black
TheGreyGhost replied to Xcox123's topic in Modder Support
No worries, glad we solved it. Although it seems to have earned me a smite along the way for some reason -TGG -
[1.7.10] Tesselator/TESR rendering .png black
TheGreyGhost replied to Xcox123's topic in Modder Support
Well I tried your code and the problem was that you spelled BlockWindmill.isOpaqueCube() with a Q instead of an O, i.e. isQpaqueCube(). So the getMixedBrightness always always returned 0. If you put @Override before methods like this it will help pick up these problems. @Override public boolean isOpaqueCube(){ return false; } I also added RenderHelper.disableStandardItemLighting(); just in case it has been left in that mode (which might cause random-looking brightness variations) If you want your block to be full brightness all the time, you can just use final int FULL_SKY_BRIGHTNESS = 255; tess.setBrightness(FULL_SKY_BRIGHTNESS); @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)x, (float)y, (float)z); Tessellator tess = Tessellator.instance; this.bindTexture(textureWindmill); IBlockAccess world = tileentity.getWorldObj(); RenderHelper.disableStandardItemLighting(); // turn off item lighting tess.startDrawingQuads(); //Starts drawing int brightness = tehfoodmod.blockWindmill.getMixedBrightnessForBlock(world, tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); tess.setBrightness(brightness); tess.setColorOpaque_F(1.0F, 1.0F, 1.0F); { tess.addVertexWithUV(0, 0, 1, 1, 1); tess.addVertexWithUV(1, 1, 1, 1, 0); tess.addVertexWithUV(0, 1, 0, 0, 0); tess.addVertexWithUV(0, 0, 0, 0, 1); } tess.draw(); //Draws GL11.glPopMatrix(); } -TGG -
Hi Are you concerned about this section in vanilla? public void onLivingUpdate() { super.onLivingUpdate(); if (this.worldObj.isRemote) { this.setScaleForAge(this.isChild()); } else { int i = this.getGrowingAge(); if (i < 0) { ++i; this.setGrowingAge(i); } else if (i > 0) { --i; this.setGrowingAge(i); } } } The reason for the isRemote is because the server has to update the datawatcher variable for age, to tell the client that the entity has aged. the client doesn't have to do that. But both client and server use setSize to change the size. Have you run into a specific problem? -TGG
-
What are you trying to do exactly? Entities call setSize in their constructor all over the place, both client and server. Are you specifically talking about Ageable animals? -TGG
-
[1.7.10] Tesselator/TESR rendering .png black
TheGreyGhost replied to Xcox123's topic in Modder Support
Hi Have you tried this order? @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)x, (float)y, (float)z); Tessellator tess = Tessellator.instance; this.bindTexture(textureWindmill); IBlockAccess world = tileentity.getWorldObj(); tess.startDrawingQuads(); //Starts drawing int brightness = tehfoodmod.blockWindmill.getMixedBrightnessForBlock(world, tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); tess.setBrightness(brightness); tess.setColorOpaque_F(1.0F, 1.0F, 1.0F); { tess.addVertexWithUV(0, 0, 1, 1, 1); tess.addVertexWithUV(1, 1, 1, 1, 0); tess.addVertexWithUV(0, 1, 0, 0, 0); tess.addVertexWithUV(0, 0, 0, 0, 1); } tess.draw(); //Draws GL11.glPopMatrix(); } Also, do you mean for it to have that twisted appearance? Normally the four points of the Quad are supposed to lie in the same plane, but yours is bent. See here for more information http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html -TGG -
[1.7.10] Tesselator/TESR rendering .png black
TheGreyGhost replied to Xcox123's topic in Modder Support
Hi That code should work (I have done something identical not long ago) - pls show your latest renderer code, also a screenshot of what the black block looks like and what your texture bitmap image looks like? -TGG -
[1.7.10] Tesselator/TESR rendering .png black
TheGreyGhost replied to Xcox123's topic in Modder Support
You need to do the startDrawingQuads before the setBrightness and setColorOpaque, not after. -TGG -
[1.7.10]Getting the block the player is looking at problem
TheGreyGhost replied to FLUFFY2's topic in Modder Support
Funny that appears to be a recent fix. I first noticed that discrepancy in 1.6.2 about a year ago and wondered why on earth it was like that. -TGG -
[1.7.10] Tesselator/TESR rendering .png black
TheGreyGhost replied to Xcox123's topic in Modder Support
World implements IBlockAccess so just use world. -TGG -
[1.7.10] Tesselator/TESR rendering .png black
TheGreyGhost replied to Xcox123's topic in Modder Support
Hi You still need to set the colour and the lighting before rendering. For example tessellator.setColorOpaque_F(1, 1, 1); //This will make your block brightness dependent from surroundings lighting. int brightness = block.getMixedBrightnessForBlock(world, x, y, z); tessellator.setBrightness(brightness); -TGG