This commit is contained in:
unurled 2024-02-29 15:07:39 +01:00
parent e28304522c
commit 3ecdfd75b0
Signed by: unurled
GPG key ID: FDBC9CBE1F82423F
2 changed files with 11 additions and 9 deletions

View file

@ -12,13 +12,15 @@ public class PotionEffectSerializer implements JsonSerializer<PotionEffect> {
@Override @Override
public JsonElement serialize( public JsonElement serialize(
PotionEffect potionEffect, Type type, JsonSerializationContext jsonSerializationContext) { PotionEffect potionEffect, Type type, JsonSerializationContext jsonSerializationContext) {
String sb = "{" String sb =
"{"
+ potionEffect.getType().key() + potionEffect.getType().key()
+ "," + ","
+ potionEffect.getDuration() + potionEffect.getDuration()
+ "," + ","
+ potionEffect.getAmplifier() + potionEffect.getAmplifier()
+ "," + potionEffect.hasParticles() + ","
+ potionEffect.hasParticles()
+ "}"; + "}";
return new JsonPrimitive(sb); return new JsonPrimitive(sb);
} }