From 214929e5e5f057bc11b6ed8bb8f10cb9df2c6997 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 14 Sep 2017 19:10:18 +0100 Subject: [PATCH] Fix group expiry time not being exported (#474) --- .../me/lucko/luckperms/common/node/NodeFactory.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/node/NodeFactory.java b/common/src/main/java/me/lucko/luckperms/common/node/NodeFactory.java index a3def685..50681b4c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/node/NodeFactory.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/NodeFactory.java @@ -140,12 +140,11 @@ public class NodeFactory { sb.append("/luckperms ").append(group ? "group " : "user ").append(id).append(" "); if (node.isGroupNode()) { - if (node.isTemporary()) { - sb.append(set ? "parent addtemp " : "parent removetemp "); - sb.append(node.getGroupName()); - } else { - sb.append(set ? "parent add " : "parent remove "); - sb.append(node.getGroupName()); + sb.append(node.isTemporary() ? (set ? "parent addtemp " : "parent removetemp ") : (set ? "parent add " : "parent remove ")); + sb.append(node.getGroupName()); + + if (node.isTemporary() && set) { + sb.append(" ").append(node.getExpiryUnixTime()); } return appendContextToCommand(sb, node).toString(); @@ -155,7 +154,6 @@ public class NodeFactory { ChatMetaType type = node.isPrefix() ? ChatMetaType.PREFIX : ChatMetaType.SUFFIX; String typeName = type.name().toLowerCase(); - sb.append(node.isTemporary() ? (set ? "meta addtemp" + typeName + " " : "meta removetemp" + typeName + " ") : (set ? "meta add" + typeName + " " : "meta remove" + typeName + " ")); sb.append(type.getEntry(node).getKey()).append(" ");