Jump to content

Narrakan

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Narrakan

  1. Well, the wiki wasn't really helpful this time Anyway, after an extensive google search I got it to work by using the PacketDispatcher.sendPacketToAllPlayers in tickEnd, now it is updating as it should. Thanks for pointing me in the right direction.
  2. Thanks for answering! I've had a look at the IScheduledTickHandler, and from what I've seen, I should set the TickType to SERVER, netTickSpacing to return 20 or so, and I should do something in the method tickEnd, am I right? The problem is, I really don't know WHAT to do in this method. I mean, should I simply call getDescriptionPacket? Doesn't that function only return a well-formed packet and nothing else? My main problem is to allow the server entity to communicate somehow with the client entity.
  3. I haven't tested it, but looking at the EntityPigZombie class, you can see that this method is used: protected void func_82164_bB() { this.setCurrentItemOrArmor(0, new ItemStack(Item.swordGold)); } I guess you should be able to apply the same function to another class derived from EntityLiving.
  4. So here's the scenario: I have a TileEntity which stores, among other things, four float variables. These variables should be processed (incremented, decremented) server-side, and should be kept in sync with the client every few ticks. I need to do that because the variables should be showed in a GUI to the player (similar to a furnace, but with additional stats). This is what I've tried in the last couple of hours: Keeping the container class and the GUI class in sync using updateCraftingResults + sendProgressBarUpdate (following the furnace example), but the problem is, I need to keep track of float types, and in non-local SMP these functions only use shorts, so I don't think that's really helpful Adding getDescriptionPacket and onDataPacket as in the TileEntitySign and in other discussions I've checked, but from what I've seen, these functions only get called when the entity is first initialized, and unloaded, so they don't serve the purpose Routing my packets through a PacketHandler, to deliver them to the client side, simply by decrementing a tickCounter and firing a PacketHandler.sendPacketToClient function when it reached 0. I don't know if there were any errors in the function, but the result is, it only was called on the server, so no effect on the client I find myself stuck in this thing. Does any of you have some suggestions about this issue? Is there a way to keep the server and client side of a TileEntity in sync every second or so?
  5. Thanks, after a bit of tweaking, it's now working fine using TileEntitySpecialRenderer. However I'm still curious why it didn't work with my previous code. Oh well, I guess I'll stick to this anyway.
  6. Hi everyone, I've recently started getting into Minecraft modding. I've followed a couple of tutorials on the wiki and Youtube, and I think I have a basic understanding of how Forge works (hooks and whatnot). What I'm trying to do now is to render a custom block (really simple, just a table made of five boxes), and I've read on the wiki that the correct way to do this is by implementing ISimpleBlockRenderingHandler in a custom renderer. The problem is, I haven't found any documentation on how to do it, and even trying by myself didn't give positive results. This is briefly what I have right now: mod_Minesona.java MinesonaClientProxy.java BlockVelvetTable.java RendererVelvetTable.java ModelVelvetTable.java (There's more, obviously, like gui handler, tile entity and so on, but I don't think they are quite useful in this case.) The model class has been automatically generated by Techne, I've only removed some parts to make it simpler, but it didn't work even before doing that. Using this code, I get this error when trying to place the block: 2012-11-14 13:06:53 [iNFO] [sTDERR] java.lang.IllegalStateException: Already tesselating! 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.Tessellator.startDrawing(Tessellator.java:343) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.Tessellator.startDrawingQuads(Tessellator.java:333) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.TexturedQuad.draw(TexturedQuad.java:48) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.ModelBox.render(ModelBox.java:102) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.ModelRenderer.compileDisplayList(ModelRenderer.java:298) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.ModelRenderer.render(ModelRenderer.java:131) 2012-11-14 13:06:53 [iNFO] [sTDERR] at narrakan.minesona.client.ModelVelvetTable.render(ModelVelvetTable.java:48) 2012-11-14 13:06:53 [iNFO] [sTDERR] at narrakan.minesona.client.RendererVelvetTable.renderWorldBlock(RendererVelvetTable.java:33) 2012-11-14 13:06:53 [iNFO] [sTDERR] at cpw.mods.fml.client.registry.RenderingRegistry.renderWorldBlock(RenderingRegistry.java:145) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.FMLRenderAccessLibrary.renderWorldBlock(FMLRenderAccessLibrary.java:78) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:510) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.WorldRenderer.updateRenderer(WorldRenderer.java:218) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.RenderGlobal.updateRenderers(RenderGlobal.java:1457) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1075) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:947) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:888) 2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:783) 2012-11-14 13:06:53 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source) But if I remove the line modelVelvetTable.render(0.025F); from renderWorldBlock in my renderer, everything works fine (the block is obviously transparent), and if I change it to renderer.renderStandardBlock(mod_Minesona.velvetTable, x, y, z); it works just fine, rendering a simple block. Am I missing something? PS: I am more than willing to update the wiki with any information provided in this thread, if it helps solving the problem.
×
×
  • Create New...

Important Information

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