Package kr.toxicity.model.api.bone
Class RenderedBone
java.lang.Object
kr.toxicity.model.api.bone.RenderedBone
A rendered item-display.
-
Constructor Summary
ConstructorsConstructorDescriptionRenderedBone(@NotNull RendererGroup group, @Nullable RenderedBone parent, @NotNull RenderSource<?> source, @NotNull BoneMovement movement, @NotNull TrackerModifier modifier, @NotNull Function<RenderedBone, Map<BoneName, RenderedBone>> childrenMapper) Creates entity. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAnimation(@NotNull AnimationPredicate filter, @NotNull BlueprintAnimation animator, @NotNull AnimationModifier modifier, @NotNull AnimationEventHandler eventHandler) booleanaddPositionModifier(@NotNull Predicate<RenderedBone> predicate, @NotNull Function<org.joml.Vector3f, org.joml.Vector3f> function) Adds position modifier.booleanaddRotationModifier(@NotNull Predicate<RenderedBone> predicate, @NotNull Function<org.joml.Quaternionf, org.joml.Quaternionf> function) Adds rotation modifier.booleanbillboard(@NotNull Predicate<RenderedBone> predicate, org.bukkit.entity.Display.Billboard billboard) Apply a billboard to this model.@Nullable RenderedBoneboneOf(@NotNull Predicate<RenderedBone> predicate) Gets bonebooleanbrightness(@NotNull Predicate<RenderedBone> predicate, int block, int sky) booleancreateHitBox(@NotNull EntityAdapter entity, @NotNull Predicate<RenderedBone> predicate, @Nullable HitBoxListener listener) Creates hit box.booleancreateNametag(@NotNull Predicate<RenderedBone> predicate, @NotNull Consumer<ModelNametag> consumer) Creates nametagvoiddefaultPosition(@NotNull Supplier<org.joml.Vector3f> movement) booleanenchant(@NotNull Predicate<RenderedBone> predicate, boolean enchant) Make item has enchantment or not<T> TfindNotNullByTree(@NotNull Function<RenderedBone, T> mapper) @NotNull Stream<RenderedBone> flatten()voidforceTransformation(@NotNull PacketBundler bundler) voidforceUpdate(boolean showItem, @NotNull PacketBundler bundler) voidforceUpdate(@NotNull PacketBundler bundler) @NotNull BoneNamegetName()booleanglow(@NotNull Predicate<RenderedBone> predicate, boolean glow) Apply a glow to this model.booleanglowColor(@NotNull Predicate<RenderedBone> predicate, int glowColor) Sets a glow color to this model.@NotNull org.joml.Vector3ffloat@NotNull org.joml.QuaternionfintbooleanitemStack(@NotNull Predicate<RenderedBone> predicate, @NotNull TransformedItemStack itemStack) Changes displayed itemvoiditerateTree(@NotNull Consumer<RenderedBone> boneConsumer) booleanmatchTree(@NotNull Predicate<RenderedBone> bonePredicate) booleanmatchTree(@NotNull AnimationPredicate predicate, @NotNull BiPredicate<RenderedBone, AnimationPredicate> mapper) booleanmatchTree(@NotNull BonePredicate predicate, @NotNull BiPredicate<RenderedBone, BonePredicate> mapper) voidmoveDuration(int duration) Sets bone's move duration.voidremove(@NotNull PacketBundler bundler) Removes model's displaybooleanreplaceAnimation(@NotNull AnimationPredicate filter, @NotNull String target, @NotNull BlueprintAnimation animator, @NotNull AnimationModifier modifier) booleanrotate(@NotNull ModelRotation rotation, @NotNull PacketBundler bundler) @NotNull ModelRotationrotation()@Nullable RunningAnimationvoidscale(@NotNull FloatSupplier scale) Sets the scale of this bonevoidspawn(boolean hide, @NotNull PacketBundler bundler) booleanstopAnimation(@NotNull Predicate<RenderedBone> filter, @NotNull String name, @Nullable org.bukkit.entity.Player player) Stops bone's animationvoidteleport(@NotNull org.bukkit.Location location, @NotNull PacketBundler bundler) booleantick(@NotNull UUID uuid, @NotNull PacketBundler perPlayerBundler) booleantick(@NotNull PacketBundler perPlayerBundler) booleantint(@NotNull Predicate<RenderedBone> predicate, int tint) booleantogglePart(@NotNull Predicate<RenderedBone> predicate, boolean toggle) Toggles some partbooleanupdateItem(@NotNull Predicate<RenderedBone> predicate, @NotNull RenderSource<?> source) @NotNull org.joml.Vector3f@NotNull org.joml.Vector3fworldPosition(@NotNull org.joml.Vector3f localOffset) @NotNull org.joml.Vector3fworldPosition(@NotNull org.joml.Vector3f localOffset, @NotNull org.joml.Vector3f globalOffset) @NotNull org.joml.Vector3fworldPosition(@NotNull org.joml.Vector3f localOffset, @NotNull org.joml.Vector3f globalOffset, @Nullable UUID uuid) @NotNull org.joml.Vector3f@NotNull org.joml.Vector3fworldRotation(@Nullable UUID uuid)
-
Constructor Details
-
RenderedBone
@Internal public RenderedBone(@NotNull @NotNull RendererGroup group, @Nullable @Nullable RenderedBone parent, @NotNull @NotNull RenderSource<?> source, @NotNull @NotNull BoneMovement movement, @NotNull @NotNull TrackerModifier modifier, @NotNull @NotNull Function<RenderedBone, Map<BoneName, RenderedBone>> childrenMapper) Creates entity.- Parameters:
group- groupparent- parent entitysource- sourcemovement- spawn movementchildrenMapper- mapper
-
-
Method Details
-
runningAnimation
-
updateItem
public boolean updateItem(@NotNull @NotNull Predicate<RenderedBone> predicate, @NotNull @NotNull RenderSource<?> source) -
createHitBox
public boolean createHitBox(@NotNull @NotNull EntityAdapter entity, @NotNull @NotNull Predicate<RenderedBone> predicate, @Nullable @Nullable HitBoxListener listener) Creates hit box.- Parameters:
entity- target entitypredicate- predicatelistener- hit box listener- Returns:
- success
-
createNametag
public boolean createNametag(@NotNull @NotNull Predicate<RenderedBone> predicate, @NotNull @NotNull Consumer<ModelNametag> consumer) Creates nametag- Parameters:
predicate- predicateconsumer- nametag consumer- Returns:
- success
-
enchant
Make item has enchantment or not- Parameters:
predicate- predicateenchant- should enchant- Returns:
- success or not
-
moveDuration
public void moveDuration(int duration) Sets bone's move duration.- Parameters:
duration- duration
-
scale
Sets the scale of this bone- Parameters:
scale- scale
-
glow
Apply a glow to this model.- Parameters:
glow- should glow- Returns:
- success or not
-
glowColor
Sets a glow color to this model.- Parameters:
glowColor- hex glow color- Returns:
- success or not
-
billboard
public boolean billboard(@NotNull @NotNull Predicate<RenderedBone> predicate, @NotNull org.bukkit.entity.Display.Billboard billboard) Apply a billboard to this model.- Parameters:
billboard- billboard- Returns:
- success or not
-
itemStack
public boolean itemStack(@NotNull @NotNull Predicate<RenderedBone> predicate, @NotNull @NotNull TransformedItemStack itemStack) Changes displayed item- Parameters:
predicate- predicateitemStack- target item- Returns:
- success
-
brightness
-
addRotationModifier
public boolean addRotationModifier(@NotNull @NotNull Predicate<RenderedBone> predicate, @NotNull @NotNull Function<org.joml.Quaternionf, org.joml.Quaternionf> function) Adds rotation modifier.- Parameters:
predicate- predicatefunction- animation consumer- Returns:
- whether to success
-
addPositionModifier
public boolean addPositionModifier(@NotNull @NotNull Predicate<RenderedBone> predicate, @NotNull @NotNull Function<org.joml.Vector3f, org.joml.Vector3f> function) Adds position modifier.- Parameters:
predicate- predicatefunction- animation consumer- Returns:
- whether to success
-
rotate
public boolean rotate(@NotNull @NotNull ModelRotation rotation, @NotNull @NotNull PacketBundler bundler) -
tick
-
tick
-
forceUpdate
-
forceUpdate
-
forceTransformation
-
interpolationDuration
public int interpolationDuration() -
worldPosition
@NotNull public @NotNull org.joml.Vector3f worldPosition() -
worldPosition
@NotNull public @NotNull org.joml.Vector3f worldPosition(@NotNull @NotNull org.joml.Vector3f localOffset) -
worldPosition
@NotNull public @NotNull org.joml.Vector3f worldPosition(@NotNull @NotNull org.joml.Vector3f localOffset, @NotNull @NotNull org.joml.Vector3f globalOffset) -
worldPosition
@NotNull public @NotNull org.joml.Vector3f worldPosition(@NotNull @NotNull org.joml.Vector3f localOffset, @NotNull @NotNull org.joml.Vector3f globalOffset, @Nullable @Nullable UUID uuid) -
worldRotation
@NotNull public @NotNull org.joml.Vector3f worldRotation() -
worldRotation
-
defaultPosition
-
tint
-
getName
-
teleport
public void teleport(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull PacketBundler bundler) -
spawn
-
addAnimation
public boolean addAnimation(@NotNull @NotNull AnimationPredicate filter, @NotNull @NotNull BlueprintAnimation animator, @NotNull @NotNull AnimationModifier modifier, @NotNull @NotNull AnimationEventHandler eventHandler) -
replaceAnimation
public boolean replaceAnimation(@NotNull @NotNull AnimationPredicate filter, @NotNull @NotNull String target, @NotNull @NotNull BlueprintAnimation animator, @NotNull @NotNull AnimationModifier modifier) -
stopAnimation
public boolean stopAnimation(@NotNull @NotNull Predicate<RenderedBone> filter, @NotNull @NotNull String name, @Nullable @Nullable org.bukkit.entity.Player player) Stops bone's animation- Parameters:
filter- filtername- animation's nameplayer- player
-
remove
Removes model's display- Parameters:
bundler- packet bundler
-
togglePart
Toggles some part- Parameters:
predicate- predicatetoggle- toggle- Returns:
- success
-
boneOf
Gets bone- Parameters:
predicate- predicate- Returns:
- matched bone
-
flatten
-
findNotNullByTree
-
iterateTree
-
matchTree
-
matchTree
public boolean matchTree(@NotNull @NotNull BonePredicate predicate, @NotNull @NotNull BiPredicate<RenderedBone, BonePredicate> mapper) -
matchTree
public boolean matchTree(@NotNull @NotNull AnimationPredicate predicate, @NotNull @NotNull BiPredicate<RenderedBone, AnimationPredicate> mapper) -
hitBoxPosition
@NotNull public @NotNull org.joml.Vector3f hitBoxPosition() -
hitBoxViewRotation
@NotNull public @NotNull org.joml.Quaternionf hitBoxViewRotation() -
hitBoxScale
public float hitBoxScale() -
rotation
-