Merge remote-tracking branch 'upstream/master' into hi-phil-swift-here-for-flex-tape-the-super-strong-waterproof-tape
This commit is contained in:
@@ -43,10 +43,7 @@ public class ColorTypeAdapter extends TypeAdapter<Color>
|
||||
}
|
||||
|
||||
int rgba = value.getRGB();
|
||||
out.beginObject()
|
||||
.name("value")
|
||||
.value(rgba)
|
||||
.endObject();
|
||||
out.value(String.format("#%08X", rgba));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +54,18 @@ public class ColorTypeAdapter extends TypeAdapter<Color>
|
||||
case NULL:
|
||||
in.nextNull();
|
||||
return null;
|
||||
case STRING:
|
||||
{
|
||||
String value = in.nextString();
|
||||
if (value.charAt(0) == '#')
|
||||
{
|
||||
value = value.substring(1);
|
||||
}
|
||||
int intValue = Integer.parseUnsignedInt(value, 16);
|
||||
return new Color(intValue, true);
|
||||
}
|
||||
case BEGIN_OBJECT:
|
||||
{
|
||||
in.beginObject();
|
||||
double value = 0;
|
||||
while (in.peek() != JsonToken.END_OBJECT)
|
||||
@@ -74,6 +82,7 @@ public class ColorTypeAdapter extends TypeAdapter<Color>
|
||||
}
|
||||
in.endObject();
|
||||
return new Color((int) value, true);
|
||||
}
|
||||
}
|
||||
return null; // throws
|
||||
}
|
||||
|
||||
@@ -43,12 +43,7 @@ public class InstantTypeAdapter extends TypeAdapter<Instant>
|
||||
return;
|
||||
}
|
||||
|
||||
out.beginObject()
|
||||
.name("seconds")
|
||||
.value(value.getEpochSecond())
|
||||
.name("nanos")
|
||||
.value(value.getNano())
|
||||
.endObject();
|
||||
out.value(value.toEpochMilli());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,6 +55,12 @@ public class InstantTypeAdapter extends TypeAdapter<Instant>
|
||||
return null;
|
||||
}
|
||||
|
||||
if (in.peek() == JsonToken.NUMBER)
|
||||
{
|
||||
long jsTime = in.nextLong();
|
||||
return Instant.ofEpochMilli(jsTime);
|
||||
}
|
||||
|
||||
long seconds = 0;
|
||||
int nanos = 0;
|
||||
in.beginObject();
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
*/
|
||||
package net.runelite.http.api.item;
|
||||
|
||||
import java.time.Instant;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@@ -33,5 +32,5 @@ public class ItemPrice
|
||||
private int id;
|
||||
private String name;
|
||||
private int price;
|
||||
private Instant time;
|
||||
private int wikiPrice;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user