Fixed #1601
This commit is contained in:
@@ -9,6 +9,8 @@ import mindustry.world.meta.BlockGroup;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
import static mindustry.Vars.world;
|
||||
|
||||
public class OverflowGate extends Block{
|
||||
public float speed = 1f;
|
||||
public boolean invert = false;
|
||||
@@ -125,19 +127,24 @@ public class OverflowGate extends Block{
|
||||
|
||||
@Override
|
||||
public byte version(){
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutput stream) throws IOException{
|
||||
super.write(stream);
|
||||
stream.writeInt(lastInput == null ? Pos.invalid : lastInput.pos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
|
||||
if(revision == 1){
|
||||
new DirectionalItemBuffer(25, 50f).read(stream);
|
||||
}else if(revision == 3){
|
||||
lastInput = world.tile(stream.readInt());
|
||||
lastItem = items.first();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user