Fixed #10436
This commit is contained in:
@@ -54,11 +54,21 @@ public class DirectionalItemBuffer{
|
||||
}
|
||||
|
||||
public void read(Reads read){
|
||||
read(read, false);
|
||||
}
|
||||
|
||||
public void read(Reads read, boolean legacy){
|
||||
for(int i = 0; i < 4; i++){
|
||||
indexes[i] = read.b();
|
||||
byte length = read.b();
|
||||
for(int j = 0; j < length; j++){
|
||||
long value = read.l();
|
||||
|
||||
if(legacy){
|
||||
//read value as the old format with 1-byte items, and create a new one with the new 2-byte format
|
||||
value = BufferItem.get(BufferItemLegacy.item(value), BufferItemLegacy.time(value));
|
||||
}
|
||||
|
||||
if(j < buffers[i].length){
|
||||
buffers[i][j] = value;
|
||||
}
|
||||
@@ -71,4 +81,10 @@ public class DirectionalItemBuffer{
|
||||
short item;
|
||||
float time;
|
||||
}
|
||||
|
||||
@Struct
|
||||
class BufferItemLegacyStruct{
|
||||
byte item;
|
||||
float time;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,11 @@ public class Junction extends Block{
|
||||
return to != null && to.team == team;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte version(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(Writes write){
|
||||
super.write(write);
|
||||
@@ -88,7 +93,7 @@ public class Junction extends Block{
|
||||
@Override
|
||||
public void read(Reads read, byte revision){
|
||||
super.read(read, revision);
|
||||
buffer.read(read);
|
||||
buffer.read(read, revision == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user