mirror of
https://github.com/GeyserMC/Rainbow.git
synced 2025-12-19 14:59:16 +00:00
Allow using custom paths in datagen
This commit is contained in:
@@ -81,6 +81,7 @@ public class BedrockItemMapper {
|
||||
}
|
||||
|
||||
public static void tryMapStack(ItemStack stack, int customModelData, ProblemReporter reporter, PackContext context) {
|
||||
// TODO Improve this, use resouce log in problemreporter
|
||||
ItemModel.Unbaked vanillaModel = context.assetResolver().getClientItem(stack.get(DataComponents.ITEM_MODEL)).map(ClientItem::model).orElseThrow();
|
||||
ProblemReporter childReporter = reporter.forChild(() -> "item model " + vanillaModel + " with custom model data " + customModelData + " ");
|
||||
if (vanillaModel instanceof RangeSelectItemModel.Unbaked(RangeSelectItemModelProperty property, float scale, List<RangeSelectItemModel.Entry> entries, Optional<ItemModel.Unbaked> fallback)) {
|
||||
|
||||
@@ -174,8 +174,8 @@ public class BedrockPack {
|
||||
private static final Path GEOMETRY_DIRECTORY = Path.of("models/entity");
|
||||
private static final Path ANIMATION_DIRECTORY = Path.of("animations");
|
||||
|
||||
private static final Path MANIFEST_FILE = Path.of("manifest");
|
||||
private static final Path ITEM_ATLAS_FILE = Path.of("textures/item_texture");
|
||||
private static final Path MANIFEST_FILE = Path.of("manifest.json");
|
||||
private static final Path ITEM_ATLAS_FILE = Path.of("textures/item_texture.json");
|
||||
|
||||
private final String name;
|
||||
private final Path mappingsPath;
|
||||
|
||||
@@ -26,7 +26,7 @@ public record BedrockAnimation(BedrockVersion formatVersion, Map<String, Animati
|
||||
);
|
||||
|
||||
public CompletableFuture<?> save(PackSerializer serializer, Path animationDirectory, String identifier) {
|
||||
return serializer.saveJson(CODEC, this, animationDirectory.resolve(identifier + ".animation"));
|
||||
return serializer.saveJson(CODEC, this, animationDirectory.resolve(identifier + ".animation.json"));
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
|
||||
@@ -37,7 +37,7 @@ public record BedrockAttachable(BedrockVersion formatVersion, AttachableInfo inf
|
||||
|
||||
public CompletableFuture<?> save(PackSerializer serializer, Path attachablesDirectory) {
|
||||
// Get a safe attachable path by using Geyser's way of getting icons
|
||||
return serializer.saveJson(CODEC, this, attachablesDirectory.resolve(Rainbow.fileSafeResourceLocation(info.identifier)));
|
||||
return serializer.saveJson(CODEC, this, attachablesDirectory.resolve(Rainbow.fileSafeResourceLocation(info.identifier) + ".json"));
|
||||
}
|
||||
|
||||
public static Builder builder(ResourceLocation identifier) {
|
||||
|
||||
@@ -33,7 +33,7 @@ public record BedrockGeometry(BedrockVersion formatVersion, List<GeometryDefinit
|
||||
);
|
||||
|
||||
public CompletableFuture<?> save(PackSerializer serializer, Path geometryDirectory) {
|
||||
return serializer.saveJson(CODEC, this, geometryDirectory.resolve(definitions.getFirst().info.identifier + ".geo"));
|
||||
return serializer.saveJson(CODEC, this, geometryDirectory.resolve(definitions.getFirst().info.identifier + ".geo.json"));
|
||||
}
|
||||
|
||||
public static BedrockGeometry of(GeometryDefinition... definitions) {
|
||||
|
||||
Reference in New Issue
Block a user