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.

Featured Replies

Posted

I'm able to teleport the player when they collide with a block, but when I use the same method (or similar) with custom commands and/or a tick handler, it doesn't work. and by doesn't work, I mean it does absolutely nothing. any help would be appreciated. here's the relevant code.

https://github.com/code-lyoko-modding/CodeLyokoMod/blob/master/matt/lyoko/handlers/ServerTickHandler.java

https://github.com/code-lyoko-modding/CodeLyokoMod/blob/master/matt/lyoko/handlers/CommandHandler.java

the variables in PlayerInformation are being stored and retrieved correctly btw.

Here's the code I use with an item, if this helps:

    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        if (par3EntityPlayer instanceof EntityPlayerMP)
        {
            WorldServer worldserver = (WorldServer)par2World;
            EntityPlayerMP var4 = (EntityPlayerMP)par3EntityPlayer;

            if (par3EntityPlayer.ridingEntity == null && par3EntityPlayer.riddenByEntity == null && par3EntityPlayer instanceof EntityPlayer && var4.dimension != Registration.dimID)
            {
                var4.mcServer.getConfigurationManager().transferPlayerToDimension(var4, Registration.dimID, new TutorialTeleporter(worldserver));
            }
            if (par3EntityPlayer.ridingEntity == null && par3EntityPlayer.riddenByEntity == null && par3EntityPlayer instanceof EntityPlayer && var4.dimension == Registration.dimID)
            {
                var4.mcServer.getConfigurationManager().transferPlayerToDimension(var4, 0, new TutorialTeleporter(worldserver));
            }
        }
        return par1ItemStack;
    }

set a breakpoint at the player.dimension = pi.scannerDim;

Line and see that it executes correctly, then after the player.setPositionAndRotation() is done, check what cordinates the player really is at, did it the player object's coords change?

 

 

also I haven't used Player information before, but "pi.getScannerPosX()" is this the X pos you want him to end up at or the location he currently is at? Just wondering since I have no idea what it is ;)

 

 

If you guys dont get it.. then well ya.. try harder...

  • Author

set a breakpoint at the player.dimension = pi.scannerDim;

Line and see that it executes correctly, then after the player.setPositionAndRotation() is done, check what cordinates the player really is at, did it the player object's coords change?

 

also I haven't used Player information before, but "pi.getScannerPosX()" is this the X pos you want him to end up at or the location he currently is at? Just wondering since I have no idea what it is ;)

 

for the most part this works. all I had to do was send a packet. but my new problem, is that I don't change dimensions when I teleport. I have to log-out and then log back in to be in the correct dimension. and pi.getScannerPosX() gives the target x coordinate.

 

EDIT: I've also tried "player.travelToDimension(pi.ScannerDim);" and it teleports me to the correct dimension, but it then teleports me to the nether. I can't figure out why.

There may be a packet or something and does this mean you mod is one step closer to having Lyoko and sectors? Or call it in both sides. Look into how the nether portal goes to the nether.

  • Author

yes, this means the mod is one step closer to having dimensions. and I thought it might be a packet thing, but how what kind of packet would I use?

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.