Jump to content

Zarkov

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Zarkov

  1. Yes, it creates a ServerLevel instance to create a new dimension. However, it does so using e.g. executor and storageSource in the MinecraftServer class, which are private. I'm not sure where or how that visibility is changed. I can create a new executor same as is used internally in MinecraftServer, but I'm uncertain of the consequences of having a separate one running at the same time. I then got stuck at trying to duplicate storageSource and basically thought I should check here if there were any new guidelines / recommendations on how this should be done.
  2. Thanks for your response. However, it does seem to be possible, since this is what RFTools Dimensions is doing, also in 1.18. I haven't been able to use that method though (instantiating ServerLevel + some other setup / bookkeeping), due to class access restrictions. I was trying to find workarounds for that, but suspect I'm going about it the wrong (not recommended) way.
  3. Hi, I have been trying to find out how to dynamically create more dimensions at runtime in 1.18 (1.16+ actually), i.e. not using json files. In my case the types of custom dimension that gets created is completely static, but the number of dimensions needs to be able to change at runtime. I was looking at the code by McJty for his RFTools Dimensions mod, but it seems to use MinecraftServer properties that now (?) are private. Any guidance on what should / could be used to accomplish this would be greatly appreciated. Are there any plans to reintroduce the Forge DimensionManager that used to exist? Thanks.
  4. Hi, I'm writing a simple mod which dynamically adds new dimensions that are convenient for automated mining. Everything is basically working as I want, with (surprise) one exception. The problem only occurs when running the mod in a dedicated server setting. If a player logs out while in a mining world, and then tries to reconnect, the client doesn't know about the dimension id and provider type id which causes an exception. I'm handling this in other scenarios by sending custom packets to the client, but I haven't figured out how to provide the information before the client tries to load the dimension when connecting. I would just like to send a list of dimension ids so that the client can call DimensionManager.registerDimension etc. on it's side. I've tried quite a few things, but they either don't work at all or seem unreliable. Any suggestions or help greatly appreciated! Update: I found a solution to this problem, though it's probably not the "best". I'll put it here in case it can help anyone else: I implemented ConnectionHandler and in connectionReceived I use the SaveHandler for dimension 0 to load the player data of the connecting client (by username). This so that I could get the correct dimension id. If the dimension id belongs to a dimension generated by my mod, I send a basic Packet250CustomPayload packet with the dimension id to the client. The client can then call DimensionManager.registerDimension and registerProviderType before the world is loaded, and the exception is avoided.
×
×
  • Create New...

Important Information

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