Jump to content

Science!

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by Science!

  1. Ah, ok. I saw that, but I thought it was "has the chunk ever been generated" rather than "does it currently exist and is loaded". Thanks.
  2. Basically what the subject is. Is there some function to check if a chunk is loaded from its chunk or (preferably) world coordinates? I looked at the World and IChunkProvider classes, but if such a function exists in either, I missed it.
  3. OK... A typical chain of events might go like this: 1. Plant a is parsed, avg yield is obtained and stored 2. Plant b is parsed, avg yield is obtained and stored 3. Avg yield trait of plant b is applied to plant a 4. HarvestDropsEvent handler makes plant a have a (yieldb/yieldb-yielda) chance of spawning twice the drops
  4. Ideally, I'd like to get at LEAST the following information out of a plant: -Light level (easy) -Average(ish) # of Drops(relatively easy through GetDrops()) -UpdateTick behavior And therein lies the issue. For anything based on BlockCrops, I can assume the metadata changes (for example, I dropped in RotaryCraft for testing purposes and its Canola plant worked perfectly). An easy way to test if it doesn't fit the BlockCrops format is see if GetDrops() never changes what it returns. The next step is to see if it spreads like a mushroom/grass (the two are equivalent for my purposes), or grows up like a cactus. Max height would be nice if it does, but isn't necessary. And presumably tree stuff at one point, but that's not terribly important atm. If the plant is actually placed in world, its fairly trivial to update it a bunch, then look at the blocks adjacent. Are some or all of the horizontally adjacent blocks the same as the block I started with? Then it spreads like a mushroom. Is the one on top the same? Then it spreads like cactus/sugarcane. The problem is how/where to do this testing without any lasting effects on the world and with minimal resource usage. Currently I'm looking at making a 1 chunk sized, inaccessible dimension so I don't have to worry about players ever interacting with it or creating/destroying new chunks (if you can even destroy chunks?), but honestly I have no idea if that would just be 1000x worse anyway.
  5. I've recently started on a mod dealing extensively with plants, and with a heavy focus on mod compatibility. To that end, I'm working on a function that, given an IPlantable, can get out information I need like what metadata means fully grown, what drops it has, etc. Unfortunately, this only works for plants that actually USE metadata- ie wheat type plants that grow within one block and drop different things depending on how grown they are. The difficulty comes with things like mushrooms and cacti. With plants like wheat, I could just call the getDrops method for all the metadatas and with various random seeds, and from there figure out when it stops growing. For something like cacti or mushrooms though, getDrops is worthless because the drops don't change. It seems to me like the only way to figure out if a plant grows is to basically call UpdateTick on it a bunch of times and see what happens. And herein lies my problem. Since, for example, mushroom growth actually depends on the world around it (eg must have a certain light level, must have an adjacent block that supports mushrooms), I can't just use an arbitrary point for the x,y,z parameters like I did for getDrops. From my understanding, I'd actually have to place it in world somewhere, with the right conditions, and see what happens. The parsing function is purely analytical though, and so it shouldn't actually change the world. So the options I see are as follows: make a new world object (seems like a terrible idea) and mess around in there instead of the real world, temporarily make arbitrary point in the world a testing area (possible, but something I have limited understanding of, and potentially either A. Is seen by the player B. Messes up some build or C. Generates new terrain), or somehow simulate an UpdateTick with ideal conditions, which would be nice but I don't really think is possible. So, with all that said, A. Is there a better method I'm missing, B. Is there some way to simulate UpdateTick without changing the world, and C. If not, what's the best way to get an area that is as yet untouched and is unable to be seen by any player?
×
×
  • Create New...

Important Information

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