Everything posted by zerozhou
-
Entity render a few tick and then disappear
That's it.. It seems I don't know about the difference between server and client well :'( :'( Thx
-
Entity render a few tick and then disappear
I try to collide with it and succeed in the expect position.
-
Entity render a few tick and then disappear
I use a item and spawn it in the position where the player stand. And as there is almost nothing in the entity, I don't know if I can hit it, I'll try later. In my success case I try to make it move and succeed, and now I delete the code about its movement, so I think it could not move extremmelly far.
-
Entity render a few tick and then disappear
I'm new to render. So it's just for test so I simply set the livetime. I know the difference between the client and the server. And yes, it stop rendering BEFORE it die as I could see messages in the onUpdate() method of the entity. And I try to delete "--livetime;". But nothing change. The "rendered entity" appear 2-3 ticks and then disappear while the entity is still alive.
-
Entity render a few tick and then disappear
I'm doing the render things. Don't know why after the entity spawn, the render rendered for a few ticks and didn't work.... The render is not called after the first few ticks. code is like The entity private int livetime; public EntityMagicRenderTest(World par1World, double x, double y, double z) { super(par1World); this.setPosition(x,y,z); livetime = 200; } public EntityMagicRenderTest(World par1World, double x, double y, double z, int deadline) { super(par1World); this.setPosition(x,y,z); livetime = deadline; } public EntityMagicRenderTest(World par1World) { super(par1World); } @Override protected void entityInit() { } @Override public void onUpdate() { super.onUpdate(); --livetime; if (livetime <= 0) { this.setDead(); } //this.setPosition(this.posX, this.posY, this.posZ); if (!this.worldObj.isRemote && livetime % 20 == 0) { System.out.println("livetime = " + livetime); System.out.println(this.posX + " " + this.posY + " " + this.posZ); } } the renderer: public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { System.out.println("try render"); GL11.glPushMatrix(); bindEntityTexture(entity); GL11.glTranslatef((float)d0, (float)d1, (float)d2); GL11.glRotatef(180F -renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); Tessellator t = Tessellator.instance; t.startDrawingQuads(); t.setNormal(0, 0, 0); t.addVertexWithUV(-0.5, -0.5, 0.0, 0, 0); t.addVertexWithUV(-0.5, 0.5, 0.0, 0, 1); t.addVertexWithUV(0.5, 0.5, 0.0, 0.5, 1); t.addVertexWithUV(0.5, -0.5, 0.0, 0.5, 0); t.addVertexWithUV(-0.5, -0.5, 0.0, 0, 0); t.addVertexWithUV(0.5, -0.5, 0.0, 0.5, 0); t.addVertexWithUV(0.5, 0.5, 0.0, 0.5, 1); t.addVertexWithUV(-0.5, 0.5, 0.0, 0, 1); t.draw(); GL11.glPopMatrix(); } I've successed for a time.. But suddenly it didnt work again..
-
Get corresponding entity in the render
OK I did stupit things. doRender pass the entity in....
-
Get corresponding entity in the render
I'm trying to render an entity which use for effects. It's not a block or an item. And I want to record some information in the entity and get it in the render when renderring. But it seems that scan the entityRenderMap is not reasonable. And I don't know if tileentity could do this or there is a simply solution. Could anyone help?
-
Get corresponding entity in server side
So what's the frequency of the entity update packet. I tried to find the class you mentioned but failed. Maybe I can consider that I can use the entity ID to identify the entity(Just with a few seconds latency, which I think it's acceptable)?
-
Get corresponding entity in server side
I'm making a mod that the player can choose the entity(living entity) near him with a GUI and bind to the player. But it seems that it's hard to get the corresponding entity in the server side. The entity id seems to work at first but after a thought and some code reading that it should be different between client and server(am i right?). So the problem is that I want to choose an entity with GUI and tell the server which one I've chosen. It's there any idea about it?
-
Get the block(or blocks nearby is ok) which player is looking at
Hmm. I've thought about the idea you said. Actually I'm seeking for a more beautiful way to do this as dealing with math is not a quite happy thing right? :-) Thanks any way.
-
Get the block(or blocks nearby is ok) which player is looking at
I've known how to get the entity which the player is looking at through the implementation of the enderman... But how can I get the "block" far far away(maybe within a range) which the player is looking at? Do something do this in minecraft(like get entity being looked at in enderman's code)? Or someone could give some ideas about doing this?
-
Get the block(or blocks nearby is ok) which player is looking at
Hmm.. I've known how to get the entity which player is looking at by the enderman's implementation. And wondering how to get the block which player is looking at. Is there some function do this in minecraft or anyone could give some ideas?
IPS spam blocked by CleanTalk.