Fixed Parallax not moving players serverside

This commit is contained in:
Anuken
2020-12-10 18:21:39 -05:00
parent 2d6db1583b
commit c54f398063
3 changed files with 12 additions and 3 deletions

View File

@@ -29,4 +29,15 @@ abstract class PhysicsComp implements Velc, Hitboxc, Flyingc{
void impulse(Vec2 v){
impulse(v.x, v.y);
}
void impulseNet(Vec2 v){
impulse(v.x, v.y);
//manually move units to simulate velocity for remote players
if(isRemote()){
float mass = mass();
move(v.x / mass, v.y / mass);
}
}
}

View File

@@ -23,7 +23,6 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
float scl = 5f;
float waterOffset = 0.07f;
//TODO fix sand near snow (sector 173)
Block[][] arr =
{
{Blocks.water, Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.darksandTaintedWater, Blocks.stone, Blocks.stone},
@@ -55,7 +54,6 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
float water = 2f / arr[0].length;
float rawHeight(Vec3 position){
position = Tmp.v33.set(position).scl(scl);
return (Mathf.pow((float)noise.octaveNoise3D(7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);

View File

@@ -118,7 +118,7 @@ public class TractorBeamTurret extends BaseTurret{
}
any = true;
target.impulse(Tmp.v1.set(this).sub(target).limit((force + (1f - target.dst(this) / range) * scaledForce) * efficiency() * timeScale));
target.impulseNet(Tmp.v1.set(this).sub(target).limit((force + (1f - target.dst(this) / range) * scaledForce) * efficiency() * timeScale));
}
}else{
strength = Mathf.lerpDelta(strength, 0, 0.1f);