Package kr.toxicity.model.api.nms
Interface NMS
public interface NMS
A vanilla code handler of Minecraft (NMS)
-
Method Summary
Modifier and TypeMethodDescription@NotNull EntityAdapteradapt(@NotNull org.bukkit.entity.Entity entity) Gets adapted entity value getter of target entity for Foliadefault @NotNull ModelDisplaycreate(@NotNull org.bukkit.Location location) Creates model display@NotNull ModelDisplaycreate(@NotNull org.bukkit.Location location, double yOffset, @NotNull Consumer<ModelDisplay> initialConsumer) Creates model display@NotNull PacketBundlercreateBundler(int initialCapacity) Creates packet bundler@Nullable HitBoxcreateHitBox(@NotNull EntityAdapter entity, @NotNull RenderedBone bone, @NotNull NamedBoundingBox namedBoundingBox, @NotNull MountController controller, @NotNull HitBoxListener listener) Creates delegator hit-box of target entity@NotNull PacketBundlerCreates lazy packet bundler@NotNull ModelNametagcreateNametag(@NotNull RenderedBone bone) Creates model nametagdefault @NotNull ModelNametagcreateNametag(@NotNull RenderedBone bone, @NotNull Consumer<ModelNametag> consumer) Creates model nametag@NotNull PacketBundlercreateParallelBundler(int threshold) Creates parallel packet bundler@NotNull org.bukkit.inventory.ItemStackcreatePlayerHead(@NotNull com.mojang.authlib.GameProfile profile) Creates player head from game profiledefault @NotNull TransformedItemStackCreates skin itemvoidhide(@NotNull PlayerChannelHandler channel, @NotNull EntityTrackerRegistry registry) Sends a hide packet for some entity to some playerdefault voidhide(@NotNull PlayerChannelHandler channel, @NotNull EntityTrackerRegistry registry, @NotNull BooleanSupplier condition) Sends a hide packet for some entity to some player@NotNull PlayerChannelHandlerinject(@NotNull org.bukkit.entity.Player player) Injects netty channel handler to playerbooleanGets this server is serviced as online-mode by proxy or nativevoidmount(@NotNull EntityTrackerRegistry registry, @NotNull PacketBundler bundler) Adds a mount packet for this tracker to bundler@NotNull com.mojang.authlib.GameProfileprofile(@NotNull org.bukkit.entity.Player player) Gets game profile from player@NotNull org.bukkit.inventory.ItemStacktint(@NotNull org.bukkit.inventory.ItemStack itemStack, int rgb) Applies tint to some item@NotNull NMSVersionversion()Gets Spigot-mapped version of Minecraft vanilla code.
-
Method Details
-
create
Creates model display- Parameters:
location- start location- Returns:
- model display
-
create
@NotNull @NotNull ModelDisplay create(@NotNull @NotNull org.bukkit.Location location, double yOffset, @NotNull @NotNull Consumer<ModelDisplay> initialConsumer) Creates model display- Parameters:
location- start locationyOffset- y offsetinitialConsumer- initial consumer- Returns:
- model display
-
createNametag
Creates model nametag- Returns:
- nametag
-
createNametag
@NotNull default @NotNull ModelNametag createNametag(@NotNull @NotNull RenderedBone bone, @NotNull @NotNull Consumer<ModelNametag> consumer) Creates model nametag- Parameters:
consumer- consumer- Returns:
- nametag
-
inject
Injects netty channel handler to player- Parameters:
player- player- Returns:
- channel handler
-
createBundler
Creates packet bundler- Parameters:
initialCapacity- initial capacity- Returns:
- packet bundler
-
createLazyBundler
Creates lazy packet bundler- Returns:
- packet bundler
-
createParallelBundler
Creates parallel packet bundler- Parameters:
threshold- size threshold- Returns:
- parallel packet bundler
-
tint
@NotNull @NotNull org.bukkit.inventory.ItemStack tint(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, int rgb) Applies tint to some item- Parameters:
itemStack- itemrgb- hex rgb value- Returns:
- new item
-
mount
void mount(@NotNull @NotNull EntityTrackerRegistry registry, @NotNull @NotNull PacketBundler bundler) Adds a mount packet for this tracker to bundler- Parameters:
registry- registrybundler- bundler
-
hide
void hide(@NotNull @NotNull PlayerChannelHandler channel, @NotNull @NotNull EntityTrackerRegistry registry) Sends a hide packet for some entity to some player- Parameters:
channel- channel handlerregistry- registry
-
hide
default void hide(@NotNull @NotNull PlayerChannelHandler channel, @NotNull @NotNull EntityTrackerRegistry registry, @NotNull @NotNull BooleanSupplier condition) Sends a hide packet for some entity to some player- Parameters:
channel- channel handlerregistry- registrycondition- condition
-
createHitBox
@Nullable @Nullable HitBox createHitBox(@NotNull @NotNull EntityAdapter entity, @NotNull @NotNull RenderedBone bone, @NotNull @NotNull NamedBoundingBox namedBoundingBox, @NotNull @NotNull MountController controller, @NotNull @NotNull HitBoxListener listener) Creates delegator hit-box of target entity- Parameters:
entity- target entitybone- following bonenamedBoundingBox- bounding boxcontroller- mount controllerlistener- hitbox listener- Returns:
- hit-box
-
version
Gets Spigot-mapped version of Minecraft vanilla code.- Returns:
- version
-
adapt
Gets adapted entity value getter of target entity for Folia- Parameters:
entity- entity- Returns:
- adapter
-
profile
@NotNull @NotNull com.mojang.authlib.GameProfile profile(@NotNull @NotNull org.bukkit.entity.Player player) Gets game profile from player- Parameters:
player- player- Returns:
- game profile
-
createPlayerHead
@NotNull @NotNull org.bukkit.inventory.ItemStack createPlayerHead(@NotNull @NotNull com.mojang.authlib.GameProfile profile) Creates player head from game profile- Parameters:
profile- profile- Returns:
- player head item
-
createSkinItem
@NotNull default @NotNull TransformedItemStack createSkinItem(@NotNull @NotNull String model, @NotNull @NotNull List<Boolean> flags, @NotNull @NotNull List<Integer> colors) Creates skin item- Returns:
- item
-
isProxyOnlineMode
boolean isProxyOnlineMode()Gets this server is serviced as online-mode by proxy or native- Returns:
- is online-mode
-