Hello,
I have run into a problem. I am trying to generate an ore that has a tile entity attached to it. The problem is, since the ore has this tile entity, the world is filled with massive lag. I was wondering if you guys could help me out.
Thanks,
Repxile
P.S. I know that I'm not giving you much by not giving you my code, but there really isn't much to see in the classes involved. And everything works perfectly besides the lag.
What does the tile entity do? There might be another way to do your code.
It basically updates the block to an active state when the player wears a certain armor piece.
EDIT: Oh, and to clarify that it acts very similarly to a furnace in that the block is two separate blocks attached to one block class, and that the tile entity updates the block through calling a method telling it to do as such.
It basically updates the block to an active state when the player wears a certain armor piece.
EDIT: Oh, and to clarify that it acts very similarly to a furnace in that the block is two separate blocks attached to one block class, and that the tile entity updates the block through calling a method telling it to do as such.
Couldn't you just make it a metadata block and if the player has the armor the metadata of the block is changed? That should remove the need for a tile entity
Rollback Post to RevisionRollBack
Matthew 11:28-30 Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you, and learn from me; for I am gentle and humble in heart: and you will find rest for your souls. For my yoke is light, and my burden is easy.
Couldn't you just make it a metadata block and if the player has the armor the metadata of the block is changed? That should remove the need for a tile entity
I'm not sure I need to make it a metadata block just yet. I think I might be able to get it working without the tile entity in other means. I'll be back in a bit if this doesn't work.
Couldn't you just make it a metadata block and if the player has the armor the metadata of the block is changed? That should remove the need for a tile entity
Ok. I messed around a bit with the block's update method. The problem with it is that when I use my tile entity, the change is instantaneous, while in the block's case, it takes a while.
Ok. I messed around a bit with the block's update method. The problem with it is that when I use my tile entity, the change is instantaneous, while in the block's case, it takes a while.
Could you maybe go into more detail about what you are trying to do. It's a bit hard without knowing.
Rollback Post to RevisionRollBack
Matthew 11:28-30 Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you, and learn from me; for I am gentle and humble in heart: and you will find rest for your souls. For my yoke is light, and my burden is easy.
If you take a look at the furnace class and furnace registry, that is basically how I have my ore setup.
And I'll try that.
No, I get that much but I mean what are you trying to do with the block. From what I gather you want an ore that is invisible unless the player is wearing a helmet or some kind. Am I right?
Rollback Post to RevisionRollBack
Matthew 11:28-30 Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you, and learn from me; for I am gentle and humble in heart: and you will find rest for your souls. For my yoke is light, and my burden is easy.
No, I get that much but I mean what are you trying to do with the block. From what I gather you want an ore that is invisible unless the player is wearing a helmet or some kind. Am I right?
How are you checking the player armor ?
Do you have any range set ?
The scheduled update should be fast enough with the default block delay, but you can lower it further down by overriding the delay method.
I am checking the player armor by checking if armor slot 3 is != null and then checking if it is equal to my headpiece. And I'm not sure what you mean by setting a range. So far, I've tried scheduling the block's update when placed. I'm not sure where else I can put it.
Thanks.
Ahh, If you are trying to do that, I'd hook into the client rendering at some point. There might be a way to not render the block with some ForgeEvent but I'd use a TileEntitySpecialRenderer instead.
The TileEntity itself is not that slow if you override canUpdate().
Or the more elegant way: Use ISimpleBlockRenderingHandler. You won't even need a TileEntity that way.
But no matter what, DON'T do it on the Block/ TE itself because that will affect other players as well. (Unless you are getting the Block/ TE out of sync, which you don't want to.)
And also, it's very slow if you do change every block, as you already experienced.
When it's not active, I want it to look and act like regular stone, not wipe it completely. If there is some way I could render it simply that would be great. Thanks.
Can all be achieved with ISimpleBlockRenderingHandler and renderWorldBlock. You get an instance of RenderBlocks where you can call renderer.renderStandardBlock(block, x, y, z); to render any block really, just pass Blocks.stone to make it appear as stone or use some different block type instead.
I have run into a problem. I am trying to generate an ore that has a tile entity attached to it. The problem is, since the ore has this tile entity, the world is filled with massive lag. I was wondering if you guys could help me out.
Thanks,
Repxile
P.S. I know that I'm not giving you much by not giving you my code, but there really isn't much to see in the classes involved. And everything works perfectly besides the lag.
Be sure to quote my post if you want a reply.
lol @ Cameronazzi copy-pasting my sig into his
EDIT: Oh, and to clarify that it acts very similarly to a furnace in that the block is two separate blocks attached to one block class, and that the tile entity updates the block through calling a method telling it to do as such.
Couldn't you just make it a metadata block and if the player has the armor the metadata of the block is changed? That should remove the need for a tile entity
Matthew 11:28-30 Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you, and learn from me; for I am gentle and humble in heart: and you will find rest for your souls. For my yoke is light, and my burden is easy.
I made a thing:
Forum Thread: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2091787-1-7-2-tynkyn-v1-3-out-now-elementurtles
Website: https://sites.google.com/site/tynkynwiki/
Could you maybe go into more detail about what you are trying to do. It's a bit hard without knowing.
Matthew 11:28-30 Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you, and learn from me; for I am gentle and humble in heart: and you will find rest for your souls. For my yoke is light, and my burden is easy.
I made a thing:
Forum Thread: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2091787-1-7-2-tynkyn-v1-3-out-now-elementurtles
Website: https://sites.google.com/site/tynkynwiki/
And I'll try that.
No, I get that much but I mean what are you trying to do with the block. From what I gather you want an ore that is invisible unless the player is wearing a helmet or some kind. Am I right?
Matthew 11:28-30 Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you, and learn from me; for I am gentle and humble in heart: and you will find rest for your souls. For my yoke is light, and my burden is easy.
I made a thing:
Forum Thread: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2091787-1-7-2-tynkyn-v1-3-out-now-elementurtles
Website: https://sites.google.com/site/tynkynwiki/
Do you have any range set ?
The scheduled update should be fast enough with the default block delay, but you can lower it further down by overriding the delay method.
I am checking the player armor by checking if armor slot 3 is != null and then checking if it is equal to my headpiece. And I'm not sure what you mean by setting a range. So far, I've tried scheduling the block's update when placed. I'm not sure where else I can put it.
Thanks.
But thanks.
EDIT: That means I don't need help anymore.