From 28b7289922a2788ddea0cdcbb2b6f920fe86e095 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Thu, 6 Feb 2020 19:18:19 +0800 Subject: [PATCH] Fix map matches Former-commit-id: 3f6e1ac4d321c181bd8a8c64e959d89963e1de1f --- src/main/java/org/maxgamer/quickshop/Util/Util.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/maxgamer/quickshop/Util/Util.java b/src/main/java/org/maxgamer/quickshop/Util/Util.java index 7dbed41546..3303d1dd33 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Util.java @@ -1110,7 +1110,15 @@ public static boolean mapDuoMatches(@NotNull Map map1, @NotNull Map * @return Map1 match Map2 */ public static boolean mapMatches(@NotNull Map map1, @NotNull Map map2) { - return map2.entrySet().containsAll(map1.entrySet()); + if(!map1.keySet().containsAll(map2.keySet())){ + return false; + } + for (Object key : map1.keySet()){ + if(!map2.get(key).equals(map1.get(key))){ + return false; + } + } + return true; } /**