Jump to content

AFlyingGrayson

Members
  • Posts

    26
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AFlyingGrayson's Achievements

Tree Puncher

Tree Puncher (2/8)

6

Reputation

  1. That depends, what do you want to change it to? Your own custom model? A different one that already exists? What are you trying to accomplish?
  2. Yeah, that fixed the problem that I had been having, I still don't have it right, but I'll get it eventually, thanks for your help.
  3. This is a really good tutorial sirgingalot, just one thing that I'm having trouble with(this is a bit over my head, I had just figured out the old packet system) I attempted to send the packet, but I'm 95% sure that I'm doing it incorrectly, and I am probably way off, as well as probably incorrect about how to read/write variables in the packet itself. So if I could get some help, that would be awesome. Packet: When I send it:
  4. Attempting to update my mod, wondering if anyone has figured out the mappings for getTagList in NBTTagCompound or tagAt in NBTTagList, or if there is a new way of accomplishing the same thing.
  5. To be honest I was going off techne, I figured decimals weren't allowed in the argument, oh well
  6. No problem.
  7. Yeah but this way has a minimum value now, for instance: public class ChemRack extends Block { public ChemRack (int id, Material material) { super(id, material); } @Override public void onBlockAdded(World world, int x, int y, int z) { world.scheduleBlockUpdate(x, y, z, this.blockID, this.tickRate(world)); } @Override public int tickRate(World par1World) { Random random = new Random(); return 4000+random.nextInt(2000); } public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { par1World.setBlock(par2, par3, par4, Block.dirt.blockID); } } has a minimum tick value of 4000, and a maximum of 6000, you can adjust to what you'd like. I was under the assumption that the tick value of 6000 worked fine, and adding the random integer made it go haywire, which is why I had you try the other way. this is much more reliable.
  8. is your block class extending Block? This code is working perfect for me: public class ExampleBlock extends Block { public ExampleBlock (int id, Material material) { super(id, material); } @Override public void onBlockAdded(World world, int x, int y, int z) { world.scheduleBlockUpdate(x, y, z, this.blockID, this.tickRate(world)); } @Override public int tickRate(World par1World) { return 6000; } public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { par1World.setBlock(par2, par3, par4, Block.dirt.blockID); } }
  9. Although it's extremely unlikely, it is possible, if you want an absolute minimum value you should try the scheduled ticks again. add an @Override annotation above the tick rate, and see if that does anything.
  10. Just change the value of 50 to way lower, every number will give you on average 47 seconds, so setting 5 instead of 50 will change the block in roughly 4 minutes, but it could be way less or way more than that, depending on when the random ticks get assigned to the blocks. I'm pretty tired, don't know why I put 50 there, that would take something like an hour to change.
  11. //declare this: public int tickcount //in the constructor: this.setTickRandomly(true); //and then add: public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if(tickcount < 50) //Or a different value, you'll have to play around with it. { tickcount++ } else{ par1World.setBlock(par2, par3, par4, Mod.Block.blockID); } } That should be a lot more random than you have, still not sure if it's what you're looking for. It's essentially the same as the code that farmland uses to decide if it is going to go back to being dirt, but with a counter in order to make it last longer.
  12. I believe that every time you are placing a block, it is updating the tick rate for every block of that id in the world, which is why they are all the same, I could be wrong, but that's what it looks like to me, i'm thinking about how it could be fixed.
  13. where is this code at? is it individual for each block?
  14. Yeah I didn't look very closely at your full code, sorry about that. You are changing the block into a different block that doesn't update back or anything, just stays, correct?
  15. public int tickRate(World par1World, Random random) { return 6000 + random.nextInt(100); } You want something like that?
×
×
  • Create New...

Important Information

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