feature/gltf-pipeline-v2 #18
@@ -7,6 +7,7 @@ import net.minecraft.client.model.HumanoidModel;
|
|||||||
import net.minecraft.client.model.geom.ModelPart;
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps glTF bone names to Minecraft HumanoidModel parts.
|
* Maps glTF bone names to Minecraft HumanoidModel parts.
|
||||||
@@ -110,4 +111,25 @@ public final class GltfBoneMapper {
|
|||||||
public static boolean isKnownBone(String boneName) {
|
public static boolean isKnownBone(String boneName) {
|
||||||
return BONE_TO_PART.containsKey(boneName);
|
return BONE_TO_PART.containsKey(boneName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all known bone names for validation/suggestion purposes.
|
||||||
|
*/
|
||||||
|
public static Set<String> knownBoneNames() {
|
||||||
|
return BONE_TO_PART.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Suggest a known bone name for a case-insensitive match.
|
||||||
|
* Returns null if no case-insensitive match is found.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
public static String suggestBoneName(String unknownBone) {
|
||||||
|
for (String known : BONE_TO_PART.keySet()) {
|
||||||
|
if (known.equalsIgnoreCase(unknownBone)) {
|
||||||
|
return known;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user