From c9c9ea0389449631a02e37a301e56ac634965c14 Mon Sep 17 00:00:00 2001 From: Huynh Tien Date: Sun, 2 Jan 2022 08:34:51 +0700 Subject: [PATCH] Fix Biome compatibility on 1.17 (#1895) * Fix Biome compatibility on 1.17 * check if it's not 1.17.1 --- .../bentobox/database/json/BentoboxTypeAdapterFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/database/json/BentoboxTypeAdapterFactory.java b/src/main/java/world/bentobox/bentobox/database/json/BentoboxTypeAdapterFactory.java index b4dfb305d..405e9aa28 100644 --- a/src/main/java/world/bentobox/bentobox/database/json/BentoboxTypeAdapterFactory.java +++ b/src/main/java/world/bentobox/bentobox/database/json/BentoboxTypeAdapterFactory.java @@ -18,6 +18,7 @@ import com.google.gson.reflect.TypeToken; import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.api.flags.Flag; import world.bentobox.bentobox.database.json.adapters.*; +import world.bentobox.bentobox.versions.ServerCompatibility; /** @@ -47,7 +48,7 @@ public class BentoboxTypeAdapterFactory implements TypeAdapterFactory { if (Location.class.isAssignableFrom(rawType)) { // Use our current location adapter for backward compatibility return (TypeAdapter) new LocationTypeAdapter(); - } else if (Biome.class.isAssignableFrom(rawType)) { + } else if (Biome.class.isAssignableFrom(rawType) && !ServerCompatibility.getInstance().isVersion(ServerCompatibility.ServerVersion.V1_17_1)) { // TODO: Any better way ? return (TypeAdapter) new BiomeTypeAdapter(); } else if (Enum.class.isAssignableFrom(rawType)) { return new EnumTypeAdapter(rawType);