Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi It looks to me like there might be a mismatch in the texture scaling; Your renderer thinks that it should only use 8 texels wide instead of the 16. Pure guesswork, since I'm not familiar with ModelRendering: Perhaps something to do with this textureWidth = 32; textureHeight = 32; Left = new ModelRenderer(this, 0, 0); Left.addBox(0F, 0F, 0F, 1, 14, 14); Left.setRotationPoint(7F, 9F, -7F); Left.setTextureSize(64, 64); // why 64 here, but 32 above? Alternatively, perhaps these numbers don't match the actual number of pixels in the image you're using for the texture? -TGG
  2. Hi It sounds to me like either (1) you're not restoring the state from the NBT properly (looking at your code, it seems ok to me), or (2) there is a client server mismatch which gets resolved when you open the GUI, i.e. the server loads the NBT properly but the client doesn't get a copy of the information. To be honest I can't recall if this is supposed to happen automatically or not. It should be pretty easy to tell the difference if you add a few System.out.println to the appropriate parts of your code eg System.out.println( (FMLCommonHandler. getEffectiveSide() == CLIENT) ? "[Client]" : "[server]" + "inv[] = " + inv.toString()); -TGG
  3. Hi Do you mean - you can't destroy the crop by clicking on it? Or do you mean- if you destroy the block by clicking on it, it gives you nothing? You have to use the appropriate tool to harvest a crop... The code from 1.6.4 has a couple of relevant functions in it, you could perhaps find the corresponding ones in 1.7.2, place a breakpoint in them, and see why you're not getting strawberries. Alternatively a breakpoint in Block.harvestBlock and/or ItemInWorldManager.tryHarvestBlock will also narrow things down a lot. -TGG @Override public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) { ArrayList<ItemStack> ret = super.getBlockDropped(world, x, y, z, metadata, fortune); if (metadata >= 7) { for (int n = 0; n < 3 + fortune; n++) { if (world.rand.nextInt(15) <= metadata) { ret.add(new ItemStack(this.getSeedItem(), 1, 0)); } } } return ret; } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { return par1 == 7 ? this.getCropItem() : this.getSeedItem(); }
  4. ClientProxy.java CommonProxy.java Hi I think coolbody4531 is right - you have defined initRenderes(), but you never seem to call it? Something like @EventHandler public void preInit(FMLPreInitializationEvent event) { GameRegistry.registerBlock(woodMachineFrame, "WoodMachineFrame"); Items.init(); Entities.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.initRenderes(); } Some further background info here if you're interested http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG
  5. I think it is correct because (a) the entities are happily moving around despite being "submerged" in the ground, (b) if I press F3+B I can see the hitboxes which look correct and are actually the hit box if I try to hit the entity. That should be sufficient to prove that it is correct, right? Also, why do you think that scaling would affect the BB anyway -- isn't the GL scaling purely rendering? Keen, sounds like it is right. Yeah you're right, the scaling is purely rendering. What I meant was - the scaling wouldn't affect the BB, but if you draw the BB while scaling is on, it will make the BB look twice as big as it actually is. i.e. if the drawing is affected by scaling and it looks right, that means the BB actually too small. But to be honest I don't remember if the hitbox is drawn at the same time as the entity. Anyway it sounds like it's not a problem. -TGG
  6. Hi So I'm guessing that your white box is the right shape for the chimney, it just doesn't have any bricks, i.e. the texture is not showing. I'm not really familiar with techne models, but I imagine that either texturing is turned off, you haven't bound the texture properly, or the path to the texture is wrong. Hopefully someone else on this forum can be more specific... -TGG
  7. Hi This link might help for background information http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html and especially http://greyminecraftcoder.blogspot.com/2013/10/the-most-important-minecraft-classes.html and http://greyminecraftcoder.blogspot.com/2013/10/client-server-communication-using.html http://greyminecraftcoder.blogspot.com/2013/09/the-minecraft-main-game-loop.html The packet stuff is old now (1.6.4) but the concepts are the same. -TGG
  8. Hi If you put a breakpoint in this method: public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float scale) { does it ever get called? If not; you could try (1) creating a flat world (2) putting your TileEntity into it, then (3) putting breakpoints into the vanilla code TileEntityRendererDispatcher: /** * Render this TileEntity at a given set of coordinates */ public void renderTileEntityAt(TileEntity p_147549_1_, double p_147549_2_, double p_147549_4_, double p_147549_6_, float p_147549_8_) { TileEntitySpecialRenderer tileentityspecialrenderer = this.getSpecialRenderer(p_147549_1_); and /** * Render this TileEntity at its current position from the player */ public void renderTileEntity(TileEntity p_147544_1_, float p_147544_2_) { if (p_147544_1_.getDistanceFrom(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_147544_1_.getMaxRenderDistanceSquared()) and RenderGlobal::renderEntities this.theWorld.theProfiler.endStartSection("blockentities"); RenderHelper.enableStandardItemLighting(); for (i = 0; i < this.tileEntities.size(); ++i) { TileEntity tile = (TileEntity)this.tileEntities.get(i); if (tile.shouldRenderInPass(pass) && p_147589_2_.isBoundingBoxInFrustum(tile.getRenderBoundingBox())) { TileEntityRendererDispatcher.instance.renderTileEntity(tile, p_147589_3_); } } This should help you narrow down whether (1) your TileEntity is never being created, or (2) your TileEntity exists, but the renderer is incorrectly registered, or (3) your model rendering is being called but is invisible. -TGG
  9. Hi I've found this link for OpenGL very useful as a reference http://www.glprogramming.com/red/ The reason the glScalef is different is almost certainly because of a translate after the preRenderCallback. If you translate the elephant and then scale it, it scales up around a different "centre" point (eg around its head instead of its feet), so its feet will move by a different amount due to the scaling To fix it, GL11.glTranslatef up, scale, then translate back down by the same amount. One other thing - I suspect your bounding box might not be right (it might just look right because of your scalef). You need to make sure Entity.boundingBox is the right size.. -TGG
  10. Hi These might help http://www.minecraftforge.net/forum/index.php/topic,15011.msg76293.html#msg76293 http://www.minecraftforge.net/forum/index.php/topic,583.msg4892.html#msg4892 -TGG
  11. Hi That's strange It shouldn't be possible for fluidIDs to be null since it's statically initialised to a BiMap public static int getFluidID(String fluidName) static BiMap<String, Integer> fluidIDs = HashBiMap.create(); // .... { return fluidIDs.get(fluidName); // NPE here? } Perhaps (I'm not sure) fluidname is null; you could test to see if the symptoms are the same by calling getFluidID with a null. If the crash occurs reproducibly for the mod users, you could send them a version with extra debugging/logging information to narrow it down. Apart from that, I'm stumped. Hopefully someone else on the forum has a better idea... -TGG
  12. Hi RenderPlayer.renderFirstPersonArm() is the place I think you need See also ItemRenderer.renderItemInFirstPerson EntityLivingBase.getSwingProgress -TGG
  13. Hi Easy fix: GL11.glPushMatrix() GL11.glScalef(etc) render your elephant GL11.glPopMatrix() the push and the pop make sure that your scalef doesn't affect anything afterwards -TGG
  14. Hi Try looking at the BlockHopper code from 1.6.4, it is much clearer than 1.7.2. It works how dieSieben says - getEntityAbove() in TileEntityHopper. and TileEntityHopper and Hopper -TGG
  15. Then you should debug them :-) Seriously, if you've got specific errors you don't understand how to fix, describe the error message and/or the symptoms and we can try to help. Much faster for everyone that way. -TGG
  16. Hi What are the symptoms of the problem (Error messages, screenshots?) Assuming it's "missing texture, unable to load" - if you search this forum for "using missing texture" you'll find a heap of people with this problem. Generally boils down to * texture name not set properly, or * textures stored in the wrong folder, or * the upper/lower case don't match exactly. This link might also help: http://www.minecraftforge.net/forum/index.php/topic,11963.0.html -TGG
  17. Hi I use IntelliJ not Eclipse, but I'm sure it's the same: - if I hover the mouse near the red underline, it tells me the error message. Also, if I perform a compile, it brings up an error message in the compilation log. Give it a go and see? -TGG
  18. Hi -1 means "don't render anything" RenderBlocks:: /** * Renders the block at the given coordinates using the block's rendering type */ public boolean renderBlockByRenderType(Block par1Block, int par2, int par3, int par4) { int l = par1Block.getRenderType(); if (l == -1) { return false; } That's fine because you want your TileEntitySpecialRenderer to do the rendering, not the block. You're probably not registering the TileEntity or the Special Renderer properly. I would suggest you put a few breakpoints in your code (or System.out.println) to see which bits are being called properly, and which bits aren't - eg the constructor, the calls to ClientRegistry, the renderer, etc. That will help you narrow it down. -TGG
  19. Hi Dude, if you're getting an error it would probably help a lot if you tell us what the error message actually is :-) I guess the cause is probably this import javax.swing.Icon; Wrong import... -TGG
  20. Hi OK, so if I understand your question: With renderType 1, the blocks on the ground are fine (deadbush, tallgrass, fern) but the ones in the inventory (on the creative tab) are all deadbush? I don't see an obvious reason for that. I'd suggest you put a breakpoint into getRenderType (returning 1) while viewing the inventory, then trace out into the vanilla code to see why it's not using the damage (meta) value. -TGG
  21. Hi I'm not sure I understand what's wrong - renderType 1 looks right to me? Anyway this link has a lot of background info on block and item rendering http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html See the BlockRendering and ItemRendering sections. -TGG
  22. Hi updateEntity is called on both client and server side, assuming your TileEntity is properly registered and created on the server side as well as the client side. Are you sure your updateEntity() is being called on the client side? i.e. maybe it's not being called at all. I would suggest you create a flat land, place your tile entity, then put a breakpoint into World.updateEntities and see why it gets called on the client but not on the server. That should give you a more direct clue to the problem -TGG
  23. OK I understand your question better now. What class is your updateEntity() method in? What are you expecting to call it? -TGG
  24. Hi It sounds like you are using the wrong texture sheet - you are rendering items using the character set texture sheet instead of the items texture sheet. The location on the sheet is correct (corresponds to the item icon) but the texture image is the wrong one so you see characters instead of item icons. Try texturemanager.bindTexture(texturemanager.getResourceLocation(itemStackToBeRendered.getItemSpriteNumber())); (from 1.6.4 ItemRenderer.renderItem) -TGG
  25. Hi Some code is only ever run on the server side, not the client side. isRemote() will always return false in that case. You need to put your updateBools in a method that is called on the client side. Some more background information here http://greyminecraftcoder.blogspot.com.au/2013/10/the-most-important-minecraft-classes.html and http://greyminecraftcoder.blogspot.com.au/2013/10/client-server-communication-using.html -TGG
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.