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

Hello, I have a tile that 'sucks' in nearby items, however, the motion of the items are super choppy, and seemed off-sycned. Is this a networking issue? If so how would I fix this?

 

and here is the code applying the motion:

Spoiler

        List<EntityItem> nearbyItems = this.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(
                this.getPos().getX()-10, this.getPos().getY()-10, this.getPos().getZ()-10,
                this.getPos().getX()+10, this.getPos().getY()+10, this.getPos().getZ()+10
        ));
        if(nearbyItems.size() <= 0) return;

        for(EntityItem item : nearbyItems){
            double moveFactor = 0.035d;
            item.motionX += (this.getPos().getX() - item.getPosition().getX()) * moveFactor;
            item.motionY += (this.getPos().getY() - item.getPosition().getY()) * moveFactor;
            item.motionZ += (this.getPos().getZ() - item.getPosition().getZ()) * moveFactor;
            item.move(MoverType.SELF, item.motionX, item.motionY, item.motionZ);

        }

 

 

 

2 hours ago, unassigned said:

item.move(MoverType.SELF, item.motionX, item.motionY, item.motionZ);

Don't call Entity#move, since the item is going to move on it's own each tick based on the motion values it has.Your movement is choppy because the item is moved twice per tick.

Apart from that I don't know if there are solutions to the position desync that occurs, especially when collisions happen. 

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.