[Changes] Sort Tags by name before writing
This commit is contained in:
parent
f5e26e5e9c
commit
cd65bcf4e8
1 changed files with 6 additions and 1 deletions
|
@ -8,6 +8,7 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -51,6 +52,10 @@ public class TagDataProvider<T> extends FabricTagProvider<T> {
|
|||
if (locs.isEmpty() && tags.isEmpty()) return;
|
||||
|
||||
final FabricTagProvider<T>.FabricTagBuilder builder = getOrCreateTagBuilder(tag);
|
||||
|
||||
locs.sort(Comparator.comparing(ResourceLocation::toString));
|
||||
tags.sort(Comparator.comparing(a -> a.location().toString()));
|
||||
|
||||
locs.forEach(builder::add);
|
||||
tags.forEach(builder::addTag);
|
||||
}, (tag, loc) -> shouldAdd(tag.location()) || this.shouldAdd(loc));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue