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

not compared to most problem, this time the right thing is happening on server side but not on client side

 

so heres how it goes, im spawning an entity server side (some sort of AOE that will damage living inside it)

it gets spawn client side too, but this entity will move itself client side because it doesnt like to be in collision with blocks (the aoe doesnt care about living)

 

so i spawn the entity 1 block deep in the ground, server side will keep it there but client side will move it one block up to the surface.

 

here my onupdate method, on the constructor i have noClip = true; but that doesnt seem to change anything

 

@Override
public void onUpdate(){
	this.lastTickPosX = this.posX;
        this.lastTickPosY = this.posY;
        this.lastTickPosZ = this.posZ;
        updateEntity();
        ticksExisted++;
        if(ticksExisted > tickAlive()){
        	this.setDead();
        	return;
        }
        
        if (!this.worldObj.isRemote)
        {
        	if(caster == null){
        		this.setDead();
        		return;
        	}
            List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox);
            EntityLiving entityliving = caster;
            EntityLiving touched;
            for (int j = 0; j < list.size(); ++j)
            {
                Entity entity1 = (Entity)list.get(j);

                if (entity1.canBeCollidedWith()&& entity1 instanceof EntityLiving)
                {
                	onImpact((EntityLiving)entity1);
                }
            }

        }

 

im thinking maybe the game clinet side moves the bounding box around when he gets collision with block but i cant seem to find where, and more importantly, how to prevent it

 

any help is appreciated, thanks ^^

 

edit: by saving the posX/Y/Z at the begining of the update method and restoring at the end i have determined that thsi change does NOT happen during the update phase :\, which actually leaves me even more clueless as to why this is happening

 

 

 

SOLUTION:

 

so further investigation demonstrate that a packet sent from the server (Packet30Entity) was causing this change. now why this packet had different data then the actual server values that i cannot tell exactly but it seems that it has something to do with the function expand(double, double, double) that the physics engine calls on server side

 

my solution was to simply Override the setPositionAndRotation2 method from Entity and leave it blank, anyway in my case the movement are very precise and should require sync between the server and the client

 

 

 

 

... 3 view only and 2 of them are mine for my 2 edits ... jeez was this question that retarded ?

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • 10 months later...

Just a quick reply to this old post because I had the exact same problem and it fixed it. Saved me probably a few hours. Thanks!

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.