Turret ammo sync

This commit is contained in:
Anuken
2024-07-16 14:17:10 -04:00
parent afc8d5e396
commit 2f1f334d65
4 changed files with 22 additions and 2 deletions

View File

@@ -140,6 +140,7 @@ public class Turret extends ReloadTurret{
quickRotate = false;
outlinedIcon = 1;
drawLiquidLight = false;
sync = true;
}
@Override
@@ -664,6 +665,17 @@ public class Turret extends ReloadTurret{
public byte version(){
return 1;
}
@Override
public void readSync(Reads read, byte revision){
//maintain rotation and reload when syncing so clients don't see turrets snapping around
float oldRot = rotation, oldReload = reloadCounter;
readAll(read, revision);
rotation = oldRot;
reloadCounter = oldReload;
}
}
public static class BulletEntry{