From 65cd6a92d316dad4ce8346c69d69dd1438b1ed41 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 11 Apr 2019 16:42:04 -0700 Subject: [PATCH] allow saving enumfacing value --- src/api/java/baritone/api/utils/SettingsUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/utils/SettingsUtil.java b/src/api/java/baritone/api/utils/SettingsUtil.java index 051e8793..ae97ad7b 100644 --- a/src/api/java/baritone/api/utils/SettingsUtil.java +++ b/src/api/java/baritone/api/utils/SettingsUtil.java @@ -19,6 +19,7 @@ package baritone.api.utils; import baritone.api.Settings; import net.minecraft.item.Item; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import java.awt.*; @@ -147,7 +148,9 @@ public class SettingsUtil { LONG(Long.class, Long::parseLong), ITEM_LIST(ArrayList.class, str -> Stream.of(str.split(",")).map(Item::getByNameOrId).collect(Collectors.toCollection(ArrayList::new)), list -> ((ArrayList) list).stream().map(Item.REGISTRY::getNameForObject).map(ResourceLocation::toString).collect(Collectors.joining(","))), - COLOR(Color.class, str -> new Color(Integer.parseInt(str.split(",")[0]), Integer.parseInt(str.split(",")[1]), Integer.parseInt(str.split(",")[2])), color -> color.getRed() + "," + color.getGreen() + "," + color.getBlue()); + COLOR(Color.class, str -> new Color(Integer.parseInt(str.split(",")[0]), Integer.parseInt(str.split(",")[1]), Integer.parseInt(str.split(",")[2])), color -> color.getRed() + "," + color.getGreen() + "," + color.getBlue()), + ENUMFACING(EnumFacing.class, EnumFacing::byName); + Class klass;