Jump to content

[1.7.10] Crash while trying to teleport to a dimension (only on server)


McJty

Recommended Posts

When I play SSP all is fine. I make a dimension and I can then teleport to it. However, when I do this on a server I get a crash at clientside:

 

java.lang.IllegalArgumentException: Could not get provider type for dimension 39, does not exist

at net.minecraftforge.common.DimensionManager.getProviderType(DimensionManager.java:148)

at net.minecraftforge.common.DimensionManager.createProviderFor(DimensionManager.java:302)

at net.minecraft.world.WorldProvider.func_76570_a(WorldProvider.java:160)

at net.minecraft.client.multiplayer.WorldClient.<init>(WorldClient.java:54)

at net.minecraft.client.network.NetHandlerPlayClient.func_147280_a(NetHandlerPlayClient.java:865)

at net.minecraft.network.play.server.S07PacketRespawn.func_148833_a(SourceFile:32)

at net.minecraft.network.play.server.S07PacketRespawn.func_148833_a(SourceFile:13)

at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)

at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273)

at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1591)

at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:962)

at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887)

at net.minecraft.client.main.Main.main(SourceFile:148)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

The code to create the dimension is (on the server side):

 

        DimensionManager.registerProviderType(id, GenericWorldProvider.class, false);
        DimensionManager.registerDimension(id, id);

 

And to teleport to the dimension I do (on the server side):

 

            WorldServer worldServerForDimension = MinecraftServer.getServer().worldServerForDimension(message.dim);
            MinecraftServer.getServer().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) player, message.dim,
                    new RfToolsTeleporter(worldServerForDimension, message.x, message.y+1, message.z));

 

Apparently this is not sufficient for the client. What do I have to do so that the client also gets to know the new dimension? Do I have to manually send a packet to the client and register the dimension there or is there some automatic way to do that?

 

Edit: and related to this. I'm also using this code to register the dimensions when the server is started:

 

    @EventHandler
    public void serverStarted(FMLServerStartedEvent event) {
        ModDimensions.initDimensions();
    }

 

Where can I do the equivalent for client-side?

 

Thanks,

Link to comment
Share on other sites

I'm making a mod similar to mystcraft (but then in a more technological fashion). This means the dimensions are dynamically created and associated with your world. So I don't know what dimensions there are at preInit time. The dimension information is stored in the mapStorage. (edited, I mean mapStorage of course)

 

 

I just tried to do it with a PlayerEvent.PlayerLoggedInEvent. As soon as the player logs in it sends over a packet to the client with all the dimensions to register. However it comes too late. The client has already gone on and tried to load the player in my dimension which obviously not exists yet. So I think this is something that I have to do on the client somehow. Anyone? I know it is possible as Mystcraft achieves it. Just need to find out how.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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