Added Expose for GSON saving
This commit is contained in:
parent
f079140c6f
commit
ad80d32a58
|
@ -7,8 +7,12 @@ import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import world.bentobox.bentobox.database.objects.DataObject;
|
import world.bentobox.bentobox.database.objects.DataObject;
|
||||||
import world.bentobox.bentobox.database.objects.adapters.Adapter;
|
import world.bentobox.bentobox.database.objects.adapters.Adapter;
|
||||||
|
import world.bentobox.greenhouses.data.adapters.BiomeRecipeAdapter;
|
||||||
|
import world.bentobox.greenhouses.data.adapters.RectangleAdapter;
|
||||||
import world.bentobox.greenhouses.greenhouse.BiomeRecipe;
|
import world.bentobox.greenhouses.greenhouse.BiomeRecipe;
|
||||||
import world.bentobox.greenhouses.greenhouse.Walls;
|
import world.bentobox.greenhouses.greenhouse.Walls;
|
||||||
|
|
||||||
|
@ -30,15 +34,23 @@ public class Greenhouse implements DataObject {
|
||||||
+ ", broken=" + broken + "]";
|
+ ", broken=" + broken + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Expose
|
||||||
private String uniqueId = UUID.randomUUID().toString();
|
private String uniqueId = UUID.randomUUID().toString();
|
||||||
|
@Expose
|
||||||
private Location location;
|
private Location location;
|
||||||
@Adapter(RectangleSerializer.class)
|
@Expose
|
||||||
|
@Adapter(RectangleAdapter.class)
|
||||||
private Rectangle footprint;
|
private Rectangle footprint;
|
||||||
|
@Expose
|
||||||
private int ceilingHeight;
|
private int ceilingHeight;
|
||||||
|
@Expose
|
||||||
private Biome originalBiome;
|
private Biome originalBiome;
|
||||||
|
@Expose
|
||||||
private Location roofHopperLocation;
|
private Location roofHopperLocation;
|
||||||
@Adapter(BiomeRecipeSerializer.class)
|
@Expose
|
||||||
|
@Adapter(BiomeRecipeAdapter.class)
|
||||||
private BiomeRecipe biomeRecipe;
|
private BiomeRecipe biomeRecipe;
|
||||||
|
|
||||||
private boolean broken;
|
private boolean broken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package world.bentobox.greenhouses.data;
|
package world.bentobox.greenhouses.data.adapters;
|
||||||
|
|
||||||
import world.bentobox.bentobox.database.objects.adapters.AdapterInterface;
|
import world.bentobox.bentobox.database.objects.adapters.AdapterInterface;
|
||||||
import world.bentobox.greenhouses.greenhouse.BiomeRecipe;
|
import world.bentobox.greenhouses.greenhouse.BiomeRecipe;
|
||||||
|
@ -8,7 +8,7 @@ import world.bentobox.greenhouses.managers.RecipeManager;
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class BiomeRecipeSerializer implements AdapterInterface<BiomeRecipe, String> {
|
public class BiomeRecipeAdapter implements AdapterInterface<BiomeRecipe, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BiomeRecipe deserialize(Object object) {
|
public BiomeRecipe deserialize(Object object) {
|
|
@ -1,4 +1,4 @@
|
||||||
package world.bentobox.greenhouses.data;
|
package world.bentobox.greenhouses.data.adapters;
|
||||||
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import world.bentobox.bentobox.database.objects.adapters.AdapterInterface;
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RectangleSerializer implements AdapterInterface<Rectangle, String> {
|
public class RectangleAdapter implements AdapterInterface<Rectangle, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Rectangle deserialize(Object object) {
|
public Rectangle deserialize(Object object) {
|
Loading…
Reference in New Issue