Вот нашёл - вагоны сами по себе не движуться - они записаны типа как прицеп., без трейна ездять не моги.
Код:
class Mirror extends ActorNet
{
public boolean netInput(NetMsgInput netmsginput)
throws IOException
{
if(netmsginput.isGuaranted())
{
byte byte2 = netmsginput.readByte();
switch(byte2)
{
case 83: // 'S'
case 115: // 's'
if(isMirrored())
{
NetMsgGuaranted netmsgguaranted = new NetMsgGuaranted(netmsginput, 0);
post(netmsgguaranted);
}
float f = netmsginput.readFloat();
if(f <= 0.0F)
f = -1F;
Train.TrainState trainstate = new Train.TrainState();
trainstate._headSeg = netmsginput.readInt();
trainstate._headAlong = netmsginput.readDouble();
trainstate._curSpeed = netmsginput.readFloat();
trainstate._milestoneDist = netmsginput.readDouble();
trainstate._requiredSpeed = netmsginput.readFloat();
trainstate._maxAcceler = netmsginput.readFloat();
LifeChanged(false, f, null, true);
if(getOwner() != null)
{
boolean flag = byte2 == 115;
((Train)getOwner()).setStateDataMirror(trainstate, flag);
}
forgetAllAiming();
return true;
case 73: // 'I'
if(isMirrored())
{
NetMsgGuaranted netmsgguaranted1 = new NetMsgGuaranted(netmsginput, 0);
post(netmsgguaranted1);
}
float f1 = netmsginput.readFloat();
if(f1 <= 0.0F)
f1 = -1F;
LifeChanged(false, f1, null, true);
forgetAllAiming();
return true;
case 68: // 'D'
if(isMirrored())
{
NetMsgGuaranted netmsgguaranted2 = new NetMsgGuaranted(netmsginput, 1);
post(netmsgguaranted2);
}
if(life > 0.0F)
{
com.maddox.rts.NetObj netobj2 = netmsginput.readNetObj();
Actor actor2 = netobj2 != null ? ((ActorNet)netobj2).actor() : null;
LifeChanged(false, 0.0F, actor2, false);
}
return true;
}
return false;
}
switch(netmsginput.readByte())
{
default:
break;
case 84: // 'T'
if(isMirrored())
{
out.unLockAndSet(netmsginput, 1);
out.setIncludeTime(false);
postReal(Message.currentRealTime(), out);
}
byte byte0 = netmsginput.readByte();
com.maddox.rts.NetObj netobj = netmsginput.readNetObj();
Actor actor = netobj != null ? ((ActorNet)netobj).actor() : null;
int i = netmsginput.readUnsignedByte();
Track_Mirror(byte0, actor, i);
break;
case 70: // 'F'
if(isMirrored())
{
out.unLockAndSet(netmsginput, 1);
out.setIncludeTime(true);
postReal(Message.currentRealTime(), out);
}
byte byte1 = netmsginput.readByte();
com.maddox.rts.NetObj netobj1 = netmsginput.readNetObj();
Actor actor1 = netobj1 != null ? ((ActorNet)netobj1).actor() : null;
float f2 = netmsginput.readFloat();
float f3 = 0.001F * (float)(Message.currentGameTime() - Time.current()) + f2;
int j = netmsginput.readUnsignedByte();
Fire_Mirror(byte1, actor1, j, f3);
break;
case 68: // 'D'
out.unLockAndSet(netmsginput, 1);
out.setIncludeTime(false);
postRealTo(Message.currentRealTime(), masterChannel(), out);
break;
}
return true;
}
NetMsgFiltered out;
public Mirror(Actor actor, NetChannel netchannel, int i)
{
super(actor, netchannel, i);
out = new NetMsgFiltered();
}
}