A liitle bit refactor
This commit is contained in:
parent
bc07b34f1c
commit
265cc1a666
2 changed files with 3 additions and 4 deletions
|
@ -30,8 +30,6 @@ public class TagLoaderMixin {
|
||||||
@ModifyArg(method = "prepare", at = @At(value = "INVOKE",
|
@ModifyArg(method = "prepare", at = @At(value = "INVOKE",
|
||||||
target = "Ljava/util/concurrent/CompletableFuture;supplyAsync(Ljava/util/function/Supplier;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"))
|
target = "Ljava/util/concurrent/CompletableFuture;supplyAsync(Ljava/util/function/Supplier;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"))
|
||||||
public Supplier<Map<ResourceLocation, Tag.Builder>> be_modifyTags(Supplier<Map<ResourceLocation, Tag.Builder>> supplier, Executor executor) {
|
public Supplier<Map<ResourceLocation, Tag.Builder>> be_modifyTags(Supplier<Map<ResourceLocation, Tag.Builder>> supplier, Executor executor) {
|
||||||
Map<ResourceLocation, Tag.Builder> map = supplier.get();
|
return () -> TagHelper.apply(name, supplier.get());
|
||||||
TagHelper.apply(name, map);
|
|
||||||
return () -> map;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class TagHelper {
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void apply(String entry, Map<ResourceLocation, Tag.Builder> tagsMap) {
|
public static Map<ResourceLocation, Tag.Builder> apply(String entry, Map<ResourceLocation, Tag.Builder> tagsMap) {
|
||||||
Map<ResourceLocation, Set<ResourceLocation>> endTags = null;
|
Map<ResourceLocation, Set<ResourceLocation>> endTags = null;
|
||||||
if (entry.equals("block")) {
|
if (entry.equals("block")) {
|
||||||
endTags = TAGS_BLOCK;
|
endTags = TAGS_BLOCK;
|
||||||
|
@ -68,5 +68,6 @@ public class TagHelper {
|
||||||
if (endTags != null) {
|
if (endTags != null) {
|
||||||
endTags.forEach((id, ids) -> apply(tagsMap.computeIfAbsent(id, key -> Tag.Builder.tag()), ids));
|
endTags.forEach((id, ids) -> apply(tagsMap.computeIfAbsent(id, key -> Tag.Builder.tag()), ids));
|
||||||
}
|
}
|
||||||
|
return tagsMap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue