Package cn.nukkit.item.customitem.data
Class RenderOffsets
java.lang.Object
cn.nukkit.item.customitem.data.RenderOffsets
RenderOffsets是设置 render_offsets 项目组件。可以设置参数来偏移物品的在不同视角下的呈现方式。
RenderOffsets is the component that sets the render_offsets item. Parameters can be set to offset the rendering of items in different views.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRenderOffsets
(Offset mainHandFirstPerson, Offset mainHandThirdPerson, Offset offHandFirstPerson, Offset offHandThirdPerson) 设置自定义物品在不同视角下的渲染偏移量 -
Method Summary
Modifier and TypeMethodDescriptionstatic RenderOffsets
scaleOffset
(double multiplier) 以指定参数调整第一人称主手的scale偏移量static RenderOffsets
scaleOffset
(int textureSize) 按照指定的物品材质大小缩放为标准16x16像素物品显示
-
Field Details
-
nbt
-
-
Constructor Details
-
RenderOffsets
public RenderOffsets(@Nullable Offset mainHandFirstPerson, @Nullable Offset mainHandThirdPerson, @Nullable Offset offHandFirstPerson, @Nullable Offset offHandThirdPerson) 设置自定义物品在不同视角下的渲染偏移量Set rendering offsets for custom items at different viewpoints
- Parameters:
mainHandFirstPerson
- 设置第一人称主手物品的偏移量
Set the offset of the first person main hand itemmainHandThirdPerson
- 设置第三人称主手物品的偏移量
Set the offset of the third person main hand itemoffHandFirstPerson
- 设置第一人称副手物品的偏移量
Set the offset of the first person offhand itemoffHandThirdPerson
- 设置第三人称副手物品的偏移量
Set the offset of the third person offhand item
-
-
Method Details
-
scaleOffset
以指定参数调整第一人称主手的scale偏移量Adjusts the scale offset of the first-person main hand with the specified multiplier
- Parameters:
multiplier
- 按照指定规模缩放物品,这只会影响scale,所以物品位置可能不正确
Scaling the item to the specified scale multiplier number, which only affects the scale, so the item position may not be correct.- Returns:
- the render offsets
-
scaleOffset
按照指定的物品材质大小缩放为标准16x16像素物品显示Scale to a standard 16x16 pixel item display at the specified item texture size
- Parameters:
textureSize
- 指定物品材质的像素大小,只能为16的倍数
Specify the pixel size of the item texture, which can only be a multiple of 16.- Returns:
- the render offsets
-