Fixed #10163
This commit is contained in:
@@ -380,13 +380,20 @@ public class Conveyor extends Block implements Autotiler{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte version(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(Writes write){
|
||||
super.write(write);
|
||||
write.i(len);
|
||||
|
||||
for(int i = 0; i < len; i++){
|
||||
write.i(Pack.intBytes((byte)ids[i].id, (byte)(xs[i] * 127), (byte)(ys[i] * 255 - 128), (byte)0));
|
||||
write.s(ids[i].id);
|
||||
write.b((byte)(xs[i] * 127));
|
||||
write.b((byte)(ys[i] * 255 - 128));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,10 +404,20 @@ public class Conveyor extends Block implements Autotiler{
|
||||
len = Math.min(amount, capacity);
|
||||
|
||||
for(int i = 0; i < amount; i++){
|
||||
int val = read.i();
|
||||
short id = (short)(((byte)(val >> 24)) & 0xff);
|
||||
float x = (float)((byte)(val >> 16)) / 127f;
|
||||
float y = ((float)((byte)(val >> 8)) + 128f) / 255f;
|
||||
short id;
|
||||
float x, y;
|
||||
|
||||
if(revision == 0){
|
||||
int val = read.i();
|
||||
id = (short)(((byte)(val >> 24)) & 0xff);
|
||||
x = (float)((byte)(val >> 16)) / 127f;
|
||||
y = ((float)((byte)(val >> 8)) + 128f) / 255f;
|
||||
}else{
|
||||
id = read.s();
|
||||
x = (float)read.b() / 127f;
|
||||
y = ((float)read.b() + 128f) / 255f;
|
||||
}
|
||||
|
||||
if(i < capacity){
|
||||
ids[i] = content.item(id);
|
||||
xs[i] = x;
|
||||
|
||||
Reference in New Issue
Block a user