Skip to content

Commit

Permalink
修复自己提交的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Noogear authored Aug 20, 2024
1 parent c54555d commit 77fb5fd
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public CraftingRecipeCreator(@NotNull Player player, RecipeType recipeType, @Not
ConfigWrapper recipeConfig = createRecipeConfig(recipeName);
switch (recipeType()) {
case SHAPED:
Map<String, Character> itemRepeatMap = new HashMap<>();
Map<String, Character> itemRepeatMap = new LinkedHashMap<>();
List<String> shape = new ArrayList<>();
Map<Character, String> itemNameMap = new HashMap<>();
char[] tmp = " ".toCharArray(); //9个空格
Expand All @@ -88,19 +88,15 @@ public CraftingRecipeCreator(@NotNull Player player, RecipeType recipeType, @Not
continue;
}
if (!itemRepeatMap.containsKey(sourceItem)){
itemRepeatMap.put(sourceList.get(i),c);
itemRepeatMap.put(sourceItem,c);
c++;
}
tmp[i] = itemRepeatMap.get(sourceItem);
}
for (int i = 0; i < 9; i += 3) {
shape.add(new String(tmp,i,3));
}
c = 'a';
for (String key : itemRepeatMap.keySet()){
itemNameMap.put(c,key);
c++;
}
itemRepeatMap.forEach((k,v)->itemNameMap.put(v,k));
shape.removeIf(s -> s.trim().isEmpty());
removeEmptyColumn(shape);

Expand Down

0 comments on commit 77fb5fd

Please sign in to comment.