dev.polymodloader.api.content.entity.model
이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.
| 형식 | 종류 | 설명 |
|---|---|---|
EntityModelDefinition | 레코드 | A box model for a mod mob, in the game's model space: units are pixels (1/16 block), y grows downwards, and a root part with pivot y 24 stands on the ground. |
EntityModelDefinition.Builder | 클래스 | Builds an EntityModelDefinition. |
KeyframeAnimation | 레코드 | A keyframe animation of a mob's box model, like Blockbench's animations: per part and channel, values at points in time, blended in between. |
KeyframeAnimation.Builder | 클래스 | Builds a KeyframeAnimation. |
KeyframeAnimation.Channel | 레코드 | The keyframes of one part and target, in time order. |
KeyframeAnimation.Interpolation | 열거형 | How values are blended between two keyframes. |
KeyframeAnimation.Keyframe | 레코드 | A value at a point in time. |
KeyframeAnimation.Target | 열거형 | What a channel changes. |
KeyframeAnimation.Trigger | 열거형 | When an animation plays. |
ModelBox | 레코드 | A textured cuboid of a model part, in model pixels (1/16 block) relative to the part's pivot. |
ModelPartDefinition | 레코드 | A named part of an entity model: boxes around a pivot, an optional parent part, a rest rotation in degrees, and an animation. |
ModelPartDefinition.Builder | 클래스 | Builds a ModelPartDefinition. |
PartAnimation | 열거형 | How a model part moves on its own while the mob is drawn. |
EntityModelDefinition
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record EntityModelDefinition(int textureWidth, int textureHeight, List<ModelPartDefinition> parts, Map<String,KeyframeAnimation> animations)
A box model for a mod mob, in the game's model space: units are pixels (1/16 block), y grows downwards, and a root part with pivot y 24 stands on the ground. This is the layout that Blockbench's "Modded Entity" projects use. The texture is the mob's texture with textureWidth × textureHeight pixels.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
textureWidth | int | texture width in pixels |
textureHeight | int | texture height in pixels |
parts | List<ModelPartDefinition> | the parts; parents come before their children |
animations | Map<String,KeyframeAnimation> | keyframe animations by name ([a-z0-9_]+), in declaration order |
| 상수·필드 | 타입 | 설명 |
|---|---|---|
MAX_ON_DEMAND_ANIMATIONS | int | At most this many KeyframeAnimation.Trigger.ON_DEMAND animations per model. |
onDemandAnimations()
public List<String> onDemandAnimations()
추가된 버전 0.1.0-alpha.4 또는 그 이전
Names of the KeyframeAnimation.Trigger.ON_DEMAND animations, in declaration order.
반환 List<String>
builder(int, int)
public static EntityModelDefinition.Builder builder(int textureWidth, int textureHeight)
추가된 버전 0.1.0-alpha.4 또는 그 이전
A builder for a model using a textureWidth × textureHeight texture.
| 인자 | 타입 | 설명 |
|---|---|---|
textureWidth | int | — |
textureHeight | int | — |
반환 EntityModelDefinition.Builder
EntityModelDefinition.Builder
클래스 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static final class Builder
Builds an EntityModelDefinition.
part(String, Consumer<ModelPartDefinition.Builder>)
public EntityModelDefinition.Builder part(String name, Consumer<ModelPartDefinition.Builder> part)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Adds a part configured by part.
| 인자 | 타입 | 설명 |
|---|---|---|
name | String | — |
part | Consumer<ModelPartDefinition.Builder> | — |
반환 EntityModelDefinition.Builder
animation(String, KeyframeAnimation)
public EntityModelDefinition.Builder animation(String name, KeyframeAnimation animation)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Adds a keyframe animation called name; KeyframeAnimation.Trigger.ON_DEMAND ones are started by name with MobView.playAnimation.
| 인자 | 타입 | 설명 |
|---|---|---|
name | String | — |
animation | KeyframeAnimation | — |
반환 EntityModelDefinition.Builder
build()
public EntityModelDefinition build()
추가된 버전 0.1.0-alpha.4 또는 그 이전
Creates the model; invalid parts throw IllegalArgumentException.
반환 EntityModelDefinition
KeyframeAnimation
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record KeyframeAnimation(float lengthSeconds, boolean looping, KeyframeAnimation.Trigger trigger, List<KeyframeAnimation.Channel> channels)
A keyframe animation of a mob's box model, like Blockbench's animations: per part and channel, values at points in time, blended in between. The values are added to the part's rest pose.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
lengthSeconds | float | length in seconds |
looping | boolean | whether it starts over at the end; otherwise an Trigger.ON_DEMAND animation ends there and the others hold their last keyframe |
trigger | KeyframeAnimation.Trigger | when it plays |
channels | List<KeyframeAnimation.Channel> | the animated values; at most one channel per part and target |
builder(float)
public static KeyframeAnimation.Builder builder(float lengthSeconds)
추가된 버전 0.1.0-alpha.4 또는 그 이전
A builder for an animation lengthSeconds long that plays when the server starts it.
| 인자 | 타입 | 설명 |
|---|---|---|
lengthSeconds | float | — |
반환 KeyframeAnimation.Builder
KeyframeAnimation.Builder
클래스 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static final class Builder
Builds a KeyframeAnimation.
looping()
public KeyframeAnimation.Builder looping()
추가된 버전 0.1.0-alpha.4 또는 그 이전
Starts over at the end.
반환 KeyframeAnimation.Builder
trigger(KeyframeAnimation.Trigger)
public KeyframeAnimation.Builder trigger(KeyframeAnimation.Trigger trigger)
추가된 버전 0.1.0-alpha.4 또는 그 이전
When the animation plays; Trigger.ON_DEMAND by default.
| 인자 | 타입 | 설명 |
|---|---|---|
trigger | KeyframeAnimation.Trigger | — |
반환 KeyframeAnimation.Builder
smooth()
public KeyframeAnimation.Builder smooth()
추가된 버전 0.1.0-alpha.4 또는 그 이전
Blends the keyframes added after this call along smooth curves instead of straight lines.
반환 KeyframeAnimation.Builder
rotation(String, float, float, float, float)
public KeyframeAnimation.Builder rotation(String part, float time, float x, float y, float z)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Rotates part by x, y, z degrees at time seconds.
| 인자 | 타입 | 설명 |
|---|---|---|
part | String | — |
time | float | — |
x | float | — |
y | float | — |
z | float | — |
반환 KeyframeAnimation.Builder
position(String, float, float, float, float)
public KeyframeAnimation.Builder position(String part, float time, float x, float y, float z)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Moves part by x, y, z model pixels (y up) at time seconds.
| 인자 | 타입 | 설명 |
|---|---|---|
part | String | — |
time | float | — |
x | float | — |
y | float | — |
z | float | — |
반환 KeyframeAnimation.Builder
scale(String, float, float, float, float)
public KeyframeAnimation.Builder scale(String part, float time, float x, float y, float z)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Scales part by x, y, z (1 keeps the size) at time seconds.
| 인자 | 타입 | 설명 |
|---|---|---|
part | String | — |
time | float | — |
x | float | — |
y | float | — |
z | float | — |
반환 KeyframeAnimation.Builder
keyframe(String, KeyframeAnimation.Target, float, float, float, float, KeyframeAnimation.Interpolation)
public KeyframeAnimation.Builder keyframe(String part, KeyframeAnimation.Target target, float time, float x, float y, float z, KeyframeAnimation.Interpolation interpolation)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Adds a keyframe with every detail given.
| 인자 | 타입 | 설명 |
|---|---|---|
part | String | — |
target | KeyframeAnimation.Target | — |
time | float | — |
x | float | — |
y | float | — |
z | float | — |
interpolation | KeyframeAnimation.Interpolation | — |
반환 KeyframeAnimation.Builder
build()
public KeyframeAnimation build()
추가된 버전 0.1.0-alpha.4 또는 그 이전
Creates the animation; invalid values throw IllegalArgumentException.
반환 KeyframeAnimation
KeyframeAnimation.Channel
레코드 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static record Channel(String part, KeyframeAnimation.Target target, List<KeyframeAnimation.Keyframe> keyframes)
The keyframes of one part and target, in time order.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
part | String | model part name |
target | KeyframeAnimation.Target | what the keyframes change |
keyframes | List<KeyframeAnimation.Keyframe> | the keyframes, sorted by time |
KeyframeAnimation.Interpolation
열거형 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static enum Interpolation
How values are blended between two keyframes.
| 상수 | 설명 |
|---|---|
LINEAR | In a straight line. |
SMOOTH | Along a smooth curve through the neighbouring keyframes (Catmull-Rom). |
KeyframeAnimation.Keyframe
레코드 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static record Keyframe(float time, float x, float y, float z, KeyframeAnimation.Interpolation interpolation)
A value at a point in time.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
time | float | seconds from the start, 0..lengthSeconds |
x | float | value for x |
y | float | value for y |
z | float | value for z |
interpolation | KeyframeAnimation.Interpolation | how the value is reached from the previous keyframe |
KeyframeAnimation.Target
열거형 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static enum Target
What a channel changes.
| 상수 | 설명 |
|---|---|
ROTATION | Rotation in degrees around x, y and z. |
POSITION | Offset in model pixels; y grows upwards, as in Blockbench. |
SCALE | Size factor per axis; 1 keeps the size. |
KeyframeAnimation.Trigger
열거형 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static enum Trigger
When an animation plays.
| 상수 | 설명 |
|---|---|
ALWAYS | All the time, from when the mob appears; usually looping (idle breathing, a spinning part). |
WHILE_MOVING | While the mob moves, faster the faster it moves; usually looping (walk cycle, wing beats). |
ON_DEMAND | When the server starts it with MobView.playAnimation; every client that sees the mob plays it from the start (attack, wave). |
ModelBox
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record ModelBox(int u, int v, float x, float y, float z, float width, float height, float depth, boolean mirror)
A textured cuboid of a model part, in model pixels (1/16 block) relative to the part's pivot.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
u | int | texture x of the box's net (the game's cube unwrap layout) |
v | int | texture y of the box's net |
x | float | lowest corner x |
y | float | lowest corner y (y grows downwards in models) |
z | float | lowest corner z |
width | float | size along x |
height | float | size along y |
depth | float | size along z |
mirror | boolean | mirrors the texture horizontally |
ModelPartDefinition
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record ModelPartDefinition(String name, Optional<String> parent, float pivotX, float pivotY, float pivotZ, float rotationX, float rotationY, float rotationZ, List<ModelBox> boxes, PartAnimation animation)
A named part of an entity model: boxes around a pivot, an optional parent part, a rest rotation in degrees, and an animation.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
name | String | part name, unique in the model |
parent | Optional<String> | parent part, or empty for the root |
pivotX | float | pivot x relative to the parent's pivot (model pixels) |
pivotY | float | pivot y (24 is the ground for root parts, y grows downwards) |
pivotZ | float | pivot z |
rotationX | float | rest rotation around x, degrees |
rotationY | float | rest rotation around y, degrees |
rotationZ | float | rest rotation around z, degrees |
boxes | List<ModelBox> | the part's cuboids |
animation | PartAnimation | how it moves |
ModelPartDefinition.Builder
클래스 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static final class Builder
Builds a ModelPartDefinition.
parent(String)
public ModelPartDefinition.Builder parent(String parent)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Attaches the part to parent; its pivot becomes relative to the parent's.
| 인자 | 타입 | 설명 |
|---|---|---|
parent | String | — |
반환 ModelPartDefinition.Builder
pivot(float, float, float)
public ModelPartDefinition.Builder pivot(float x, float y, float z)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The point the part turns around, relative to the parent's pivot (model pixels, y down).
| 인자 | 타입 | 설명 |
|---|---|---|
x | float | — |
y | float | — |
z | float | — |
반환 ModelPartDefinition.Builder
rotation(float, float, float)
public ModelPartDefinition.Builder rotation(float x, float y, float z)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Rest rotation in degrees.
| 인자 | 타입 | 설명 |
|---|---|---|
x | float | — |
y | float | — |
z | float | — |
반환 ModelPartDefinition.Builder
box(int, int, float, float, float, float, float, float)
public ModelPartDefinition.Builder box(int u, int v, float x, float y, float z, float width, float height, float depth)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Adds a box whose texture net starts at u, v.
| 인자 | 타입 | 설명 |
|---|---|---|
u | int | — |
v | int | — |
x | float | — |
y | float | — |
z | float | — |
width | float | — |
height | float | — |
depth | float | — |
반환 ModelPartDefinition.Builder
mirroredBox(int, int, float, float, float, float, float, float)
public ModelPartDefinition.Builder mirroredBox(int u, int v, float x, float y, float z, float width, float height, float depth)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Adds a box with a mirrored texture.
| 인자 | 타입 | 설명 |
|---|---|---|
u | int | — |
v | int | — |
x | float | — |
y | float | — |
z | float | — |
width | float | — |
height | float | — |
depth | float | — |
반환 ModelPartDefinition.Builder
animation(PartAnimation)
public ModelPartDefinition.Builder animation(PartAnimation animation)
추가된 버전 0.1.0-alpha.4 또는 그 이전
How the part moves on its own; PartAnimation.NONE by default.
| 인자 | 타입 | 설명 |
|---|---|---|
animation | PartAnimation | — |
반환 ModelPartDefinition.Builder
PartAnimation
열거형 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public enum PartAnimation
How a model part moves on its own while the mob is drawn.
| 상수 | 설명 |
|---|---|
NONE | Keeps its pose. |
HEAD | Turns with the mob's head (look direction). |
WALK_SWING | Swings forward and back while walking (a leg or arm). |
WALK_SWING_OPPOSITE | Swings opposite to WALK_SWING. |
BOB | Moves gently up and down all the time. |
SPIN | Spins around its vertical axis all the time. |