This commit is contained in:
Anuken
2025-01-19 15:07:11 -05:00
parent 224e74cc5f
commit 34cc625e33
2 changed files with 22 additions and 1 deletions

View File

@@ -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;
}
}