From ab2410d8892758e7ae810a4d1a76356a008ffb9f Mon Sep 17 00:00:00 2001 From: sekwah41 Date: Fri, 2 Feb 2018 10:38:31 +0000 Subject: [PATCH 1/2] Added serializable names --- .../advancedportals/core/api/portal/AdvancedPortal.java | 6 ++++++ .../sekwah/advancedportals/core/data/PortalLocation.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java b/src/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java index 9b6b3d4..93ef132 100644 --- a/src/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java +++ b/src/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java @@ -1,5 +1,6 @@ package com.sekwah.advancedportals.core.api.portal; +import com.google.gson.annotations.SerializedName; import com.sekwah.advancedportals.core.AdvancedPortalsCore; import com.sekwah.advancedportals.core.api.registry.TagRegistry; import com.sekwah.advancedportals.core.api.warphandler.ActivationData; @@ -16,13 +17,18 @@ import java.util.Set; * @author sekwah41 */ public class AdvancedPortal { + @SerializedName("max") private PortalLocation maxLoc; + @SerializedName("min") private PortalLocation minLoc; + @SerializedName("t") private String triggerBlock; + @SerializedName("a") private HashMap args = new HashMap<>(); + private transient Set argsCol; public AdvancedPortal(PortalLocation maxLoc, PortalLocation minLoc) { diff --git a/src/com/sekwah/advancedportals/core/data/PortalLocation.java b/src/com/sekwah/advancedportals/core/data/PortalLocation.java index 70b0cf2..2cca869 100644 --- a/src/com/sekwah/advancedportals/core/data/PortalLocation.java +++ b/src/com/sekwah/advancedportals/core/data/PortalLocation.java @@ -1,10 +1,16 @@ package com.sekwah.advancedportals.core.data; +import com.google.gson.annotations.SerializedName; + public class PortalLocation { + @SerializedName("x") public final int posX; + @SerializedName("y") public final int posY; + @SerializedName("z") public final int posZ; + @SerializedName("w") public final String worldName; public PortalLocation(String worldName, int posX, int posY, int posZ) { From 99e64e74c3452cb3c294acdf3daa400d7513cad6 Mon Sep 17 00:00:00 2001 From: sekwah41 Date: Fri, 2 Feb 2018 10:40:52 +0000 Subject: [PATCH 2/2] Portals were storing in the wrong file --- .../sekwah/advancedportals/core/api/managers/PortalManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java b/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java index 2c00561..f503f80 100644 --- a/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java +++ b/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java @@ -70,7 +70,7 @@ public class PortalManager { if (this.portalHashMap == null) { this.portalHashMap = new HashMap<>(); } - this.portalsCore.getDataStorage().storeJson(this.portalHashMap, "config.json"); + this.portalsCore.getDataStorage().storeJson(this.portalHashMap, "portals.json"); this.updatePortalArray(); }