|
WIP |
|
## Single modification
|
|
\ No newline at end of file |
|
|
|
|
|
```<placeholder>
|
|
|
|
// Get a hold of the ActiveModel you want to modify
|
|
|
|
ActiveModel model = ...
|
|
|
|
// Search for a bone called "head"
|
|
|
|
model.getBone("head").ifPresent(modelBone -> {
|
|
|
|
// Get the HEAD behavior of this bone
|
|
|
|
modelBone.getBoneBehavior(BoneBehaviorTypes.HEAD).ifPresent(head -> {
|
|
|
|
// Configure the bone behavior
|
|
|
|
head.setLocal(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
```
|
|
|
|
|
|
|
|
## Batch modification
|
|
|
|
|
|
|
|
```<placeholder>
|
|
|
|
// Get a hold of the ActiveModel you want to modify
|
|
|
|
ActiveModel model = ...
|
|
|
|
// Iterate through all bones on the model
|
|
|
|
model.getBones().forEach((s, modelBone) -> {
|
|
|
|
var provider = new HeldItem.StaticItemStackSupplier(new ItemStack(Material.CARVED_PUMPKIN));
|
|
|
|
// Get the ITEM behavior
|
|
|
|
modelBone.getBoneBehavior(BoneBehaviorTypes.ITEM).ifPresent(heldItem -> {
|
|
|
|
// Configure the bone behavior
|
|
|
|
heldItem.setItemProvider(provider);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
``` |
|
|
|
\ No newline at end of file |