Jump to content

the4naves

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by the4naves

  1. Never mind, I found it. For anyone wondering, it should be world.getWorldInfo().isHardcoreModeEnabled().
  2. Hey, this is probably a dumb question, but how would I check if the current world is in hardcore mode? I haven't been able to find any resources for this.
  3. Ok, at least for now, I've found a solution that seems to work pretty well; I'm using EntityJoinWorldEvent, then checking if the entity is an instance of EntityPlayer, and if the event's world is remote, it's a bit messy, but it works.
  4. Oh, I don't need something specific for that, I just need any event that occurs just after the world has been loaded, it's okay if there isn't one though, I can probably just use onChunkLoad and just check if I've already run my code, it's just a bit messy.
  5. It was actually for the other post I made a little while ago, basically I needed to replace the instance of WorldClient with my own, to change which chunks Minecraft tries to load, and where it displays them (While keeping most compatibility with any mods that used WorldClient or the classes it itself uses). You hadn't replied in a while, which I thought might have been since I worded my last post in a way that from a glance, made it sound as if I had found a solution, so I thought I'd open a thread with the new specific problem I was having, simplified, so that people might more easily understand it.
  6. Long story short, for a project I'm currently working on, I need a forge event (or something similar) that I can hook into, that fires when a world is loaded, specifically after the "world" variable in net.minecraft.client.Minecraft has been set to something other than null. Note that because of that last requirement, WorldEvent.Load doesn't work, as "world" hasn't been set yet. The same problem exists with WorldEvent.CreateSpawnPosition. Does anyone know of some sort of event I can utilize?
  7. Ok, so I've looked into the source code a bit more, and it looks like everything I'm trying to do could be accomplished by overriding the WorldClient and by the looks of it WorldServer classes. (Subclasses of World) The Minecraft class keeps a public instance of WorldClient (Yay no reflection), and it seems to only be set in loadWorld(). Forge seems to have the job of loading worlds, and when doing so calls launchIntegratedServer(), which starts the server. I'm not sure overriding WorldServer is required though. Is there a forge event or something similar that fires on world load I could hook into to replace the world with my own subclass? (The subclass would copy over the info from the existing one if needed) Thanks for your help.
  8. But wouldn't you get that anyway in vanilla with two players, or a player and a chunk loader in the same area?
  9. To your first point, I do mostly agree, I think having the same Chunk loaded in multiple places at the same time could cause all kinds of problems, but what I'm planning on doing shouldn't ever create a situation like that. To give some context, I'm trying to create a "world wrap" effect, where the world loops infinitely in a specific direction (Generation can be handled by tile-able noise). To do this, there will be an invisible "border" that will teleport you to the other side when you touch it. To prevent the game from having to suddenly load a bunch of chunks and to prevent structures you've build from suddenly popping in, as you approach the border, the game should load chunks on the other side, and provide them to the chunk provider in lieu of what is actually near you. So I suppose a custom chunk could simply mirror the chunks it needs to, but a custom chunk loader/maybe a provider seems cleaner and might be better for performance.
  10. In essence, yes, though the approach I'm going for is more simply overriding, for example, the loadChunk() method in IChunkLoader. (Or similer) So in other words, I'd like to "trick" the game into thinking the Chunks I give it when it requests them are the actual world. For placing blocks, maybe sounds and mob AI, those will probably need more overrides, most likely overriding the methods to get a block in the world, along others, but I can address those later. In the best case scenario I would just like to be able to provide my own subclasses to be used instead of the vanilla ones.
  11. So long story short, I need to be able to return any chunk I want when the game requests to load a chunk (Ex: Game requests chunk at (5, -3), I return the chunk at say, (2, 7), then display that chunk at (5, -3)). Looking through the source code, it seems the way to do this would be to utilize a custom IChunkLoader, and/or IChunkProvider (NOTE: I do NOT mean IChunkGenerator. From what I understand, the chunk generator used to be called the chunk provider, but that serves a completely different purpose now), however there doesn't seem to be any way to access instances of these classes (Or at least the classes that implement them) other than reflection and a custom WorldProvider in a custom dimension, as all fields I could find were private or protected. So before I go along with my reflection route, is there an easier/intended way of doing this, and are the classes I've found even the correct ones? I've done a fair amount of research, but no one seems to have an answer.
×
×
  • Create New...

Important Information

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