Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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,

  • Author

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.

  • Author

Ok, thanks to the people at #minecraftforge I managed to get a solution by catching FMLNetworkEvent.ServerConnectionFromClientEvent on the server and then from there sending a message to the client to register all dimensions. Problem solved!

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.