mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-27 08:00:04 +07:00
Give craters surfboards to stream
This commit is contained in:
parent
0b0007502f
commit
1f6d3dca0e
@ -15,6 +15,8 @@ import arc.scene.ui.layout.*;
|
||||
import mindustry.world.meta.*;
|
||||
import mindustry.entities.type.*;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class CraterConveyor extends BaseConveyor{
|
||||
@ -154,6 +156,21 @@ public class CraterConveyor extends BaseConveyor{
|
||||
float lastFrameSpawned = -1;
|
||||
float lastFrameChanged = -1;
|
||||
Crater crater;
|
||||
|
||||
@Override
|
||||
public void write(DataOutput stream) throws IOException{
|
||||
super.write(stream);
|
||||
|
||||
stream.writeBoolean(crater != null);
|
||||
if(crater != null) crater.write(stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
|
||||
if(stream.readBoolean()) crater = new Crater(stream);
|
||||
}
|
||||
}
|
||||
|
||||
protected class Crater implements Position{
|
||||
@ -170,6 +187,20 @@ public class CraterConveyor extends BaseConveyor{
|
||||
face = rotation;
|
||||
}
|
||||
|
||||
Crater(DataInput stream) throws IOException{
|
||||
rotation = stream.readFloat();
|
||||
face = stream.readFloat();
|
||||
x = stream.readFloat();
|
||||
y = stream.readFloat();
|
||||
}
|
||||
|
||||
public void write(DataOutput stream) throws IOException{
|
||||
stream.writeFloat(rotation);
|
||||
stream.writeFloat(face);
|
||||
stream.writeFloat(x);
|
||||
stream.writeFloat(y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getX(){
|
||||
return x;
|
||||
|
Loading…
Reference in New Issue
Block a user