mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 05:05:18 +01:00
Fix Biome compatibility on 1.17 (#1895)
* Fix Biome compatibility on 1.17 * check if it's not 1.17.1
This commit is contained in:
parent
b6a739db00
commit
c9c9ea0389
@ -18,6 +18,7 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.api.flags.Flag;
|
import world.bentobox.bentobox.api.flags.Flag;
|
||||||
import world.bentobox.bentobox.database.json.adapters.*;
|
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)) {
|
if (Location.class.isAssignableFrom(rawType)) {
|
||||||
// Use our current location adapter for backward compatibility
|
// Use our current location adapter for backward compatibility
|
||||||
return (TypeAdapter<T>) new LocationTypeAdapter();
|
return (TypeAdapter<T>) 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<T>) new BiomeTypeAdapter();
|
return (TypeAdapter<T>) new BiomeTypeAdapter();
|
||||||
} else if (Enum.class.isAssignableFrom(rawType)) {
|
} else if (Enum.class.isAssignableFrom(rawType)) {
|
||||||
return new EnumTypeAdapter(rawType);
|
return new EnumTypeAdapter(rawType);
|
||||||
|
Loading…
Reference in New Issue
Block a user