A little bit refactor

This commit is contained in:
Aleksey 2021-04-21 15:58:04 +03:00
parent bf171754c7
commit 056a23beb9

View file

@ -54,9 +54,7 @@ public class TagHelper {
}
public static Tag.Builder apply(Tag.Builder builder, Set<ResourceLocation> ids) {
ids.forEach((value) -> {
builder.addElement(value, "Better End Code");
});
ids.forEach(value -> builder.addElement(value, "Better End Code"));
return builder;
}
@ -69,11 +67,7 @@ public class TagHelper {
}
if (endTags != null) {
endTags.forEach((id, ids) -> {
if (tagsMap.containsKey(id)) {
apply(tagsMap.get(id), ids);
} else {
tagsMap.put(id, apply(Tag.Builder.tag(), ids));
}
apply(tagsMap.computeIfAbsent(id, key -> Tag.Builder.tag()), ids);
});
}
}