Reduced multithreaded conveyor corruption, improved interpolation

This commit is contained in:
Anuken
2018-02-07 21:06:26 -05:00
parent f4227b99ff
commit 757f4f5a53
12 changed files with 118 additions and 119 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ import java.io.IOException;
import static io.anuke.mindustry.Vars.*;
public class Net{
public static final int version = 19;
public static final int version = 20;
private static boolean server;
private static boolean active;
+4 -4
View File
@@ -508,15 +508,15 @@ public class Packets {
@Override
public void write(ByteBuffer buffer) {
buffer.putInt(position);
buffer.put(rotation);
buffer.putInt((rotation) | (position << 2));
buffer.put(itemid);
}
@Override
public void read(ByteBuffer buffer) {
position = buffer.getInt();
rotation = buffer.get();
int i = buffer.getInt();
rotation = (byte)(i & 0x3);
position = i >> 2;
itemid = buffer.get();
}
}