Package net.citizensnpcs.util
Class NMS
java.lang.Object
net.citizensnpcs.util.NMS
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static boolean
addEntityToWorld
(Entity entity, CreatureSpawnEvent.SpawnReason custom) static void
addOrRemoveFromPlayerList
(Entity entity, boolean remove) static void
attack
(LivingEntity attacker, LivingEntity bukkitTarget) static float[][]
calculateDragonPositions
(float yrot, double[][] latency) static void
callKnockbackEvent
(NPC npc, float strength, double dx, double dz, Consumer<NPCKnockbackEvent> cb) static void
cancelMoveDestination
(Entity entity) createBundlePacket
(List<Object> packets) static EntityPacketTracker
createPacketTracker
(Entity entity) static EntityPacketTracker
static com.mojang.authlib.GameProfile
fillProfileProperties
(com.mojang.authlib.GameProfile profile, boolean requireSecure) static void
findProfilesByNames
(String[] names, com.mojang.authlib.ProfileLookupCallback cb) static BlockBreaker
getBlockBreaker
(Entity entity, Block targetBlock, BlockBreaker.BlockBreakerConfiguration config) static Object
getBossBar
(Entity entity) static BoundingBox
getBoundingBox
(Entity handle) static BoundingBox
getCollisionBox
(Block block) static Location
getDestination
(Entity entity) static int
getFallDistance
(NPC npc, int def) static Field
static Field
static List<MethodHandle>
getFieldsOfType
(Class<?> clazz, Class<?> type) static MethodHandle
getFinalSetter
(Class<?> clazz, String field) static MethodHandle
getFinalSetter
(Class<?> clazz, String field, boolean log) static MethodHandle
getFinalSetter
(Field field, boolean log) static MethodHandle
getFirstFinalSetter
(Class<?> clazz, Class<?> type) static MethodHandle
getFirstGetter
(Class<?> clazz, Class<?> type) static MethodHandle
getFirstMethodHandle
(Class<?> clazz, boolean log, Class<?>... params) static MethodHandle
getFirstMethodHandleWithReturnType
(Class<?> clazz, boolean log, Class<?> returnType, Class<?>... params) static MethodHandle
getFirstSetter
(Class<?> clazz, Class<?> type) static MethodHandle
getFirstStaticGetter
(Class<?> clazz, Class<?> type) static MethodHandle
static MethodHandle
static float
getHeadYaw
(Entity entity) static double
static float
getHorizontalMovement
(Entity bukkitEntity) static Method
static MethodHandle
getMethodHandle
(Class<?> clazz, String method, boolean log, Class<?>... params) static CompoundTag
static NPC
static EntityPacketTracker
getPacketTracker
(Entity entity) getPassengers
(Entity entity) static com.mojang.authlib.GameProfile
getProfile
(Player player) static com.mojang.authlib.GameProfile
getProfile
(SkullMeta meta) static MethodHandle
static MethodHandle
static String
getSoundPath
(Sound flag) static Entity
getSource
(BlockCommandSender sender) static float
getSpeedFor
(NPC npc) static float
getStepHeight
(Entity entity) getTargetNavigator
(Entity entity, Iterable<Vector> dest, NavigatorParameters params) getTargetNavigator
(Entity entity, Entity target, NavigatorParameters parameters) getTargetNavigator
(Entity entity, Location dest, NavigatorParameters params) static Entity
getVehicle
(Entity entity) static float
getVerticalMovement
(Entity bukkitEntity) static double
static float
static void
giveReflectiveAccess
(Class<?> from, Class<?> to) static boolean
static boolean
isOnGround
(Entity entity) static boolean
static boolean
static void
load
(CommandManager commands) static void
loadBridge
(String rev) static void
static void
static void
static void
static void
onPlayerInfoAdd
(Player player, Object source, Function<UUID, MirrorTrait> mirrorTraits) static InventoryView
openAnvilInventory
(Player player, Inventory inventory, String title) static void
openHorseScreen
(Tameable horse, Player equipper) static void
playAnimation
(PlayerAnimation animation, Player player, int radius) static Runnable
playerTicker
(Player entity) static void
registerEntityClass
(Class<?> clazz) static void
static void
removeFromServerPlayerList
(Player player) static void
removeFromWorld
(Entity entity) static void
removeHookIfNecessary
(FishHook entity) static void
replaceTracker
(Entity entity) static void
sendPositionUpdate
(Entity from, boolean position, Float bodyYaw, Float pitch, Float headYaw) static boolean
sendTabListAdd
(Player recipient, Player listPlayer) static void
sendTabListRemove
(Player recipient, Collection<? extends SkinnableEntity> skinnableNPCs) static void
sendTabListRemove
(Player recipient, Player listPlayer) static void
sendTeamPacket
(Player recipient, Team team, int mode) static void
setAggressive
(Entity entity, boolean aggro) static void
setAllayDancing
(Entity entity, boolean dancing) static void
setBodyYaw
(Entity entity, float yaw) static void
setBoundingBox
(Entity entity, BoundingBox box) static void
setCamelPose
(Entity entity, CamelTrait.CamelPose pose) static void
setCustomName
(Entity entity, Object component, String string) static void
setDestination
(Entity entity, double x, double y, double z, float speed) static void
setDimensions
(Entity entity, EntityDim desired) static void
setEndermanAngry
(Enderman enderman, boolean angry) static void
setHeadYaw
(Entity entity, float yaw) static void
setKnockbackResistance
(LivingEntity entity, double d) static void
setLocationDirectly
(Entity entity, Location location) static void
setLyingDown
(Entity cat, boolean lying) static void
setNavigationTarget
(Entity handle, Entity target, float speed) static void
setNoGravity
(Entity entity, boolean nogravity) static void
setPandaSitting
(Entity entity, boolean sitting) static void
setPeekShulker
(Entity entity, int peek) static void
setPiglinDancing
(Entity entity, boolean dancing) static void
static void
setPolarBearRearing
(Entity entity, boolean rearing) static void
setProfile
(SkullMeta meta, com.mojang.authlib.GameProfile profile) static void
setShouldJump
(Entity entity) static void
setSitting
(Ocelot ocelot, boolean sitting) static void
setSitting
(Tameable tameable, boolean sitting) static void
setSneaking
(Entity entity, boolean sneaking) static void
setSnifferState
(Entity entity, SnifferTrait.SnifferState state) static void
setStepHeight
(Entity entity, float height) static void
setTeamNameTagVisible
(Team team, boolean visible) static void
setVerticalMovement
(Entity bukkitEntity, double d) static void
setWitherInvulnerable
(Wither wither, boolean charged) static boolean
shouldJump
(Entity entity) static void
shutdown()
static void
static void
static void
static void
updateInventoryTitle
(Player player, InventoryView view, String newTitle) static void
updateMountedInteractionHeight
(Entity entity, Entity mount, double height) static void
updateNavigationWorld
(Entity entity, World world) static void
updatePathfindingRange
(NPC npc, float pathfindingRange)
-
Method Details
-
activate
-
addEntityToWorld
-
addOrRemoveFromPlayerList
-
attack
-
calculateDragonPositions
public static float[][] calculateDragonPositions(float yrot, double[][] latency) -
callKnockbackEvent
public static void callKnockbackEvent(NPC npc, float strength, double dx, double dz, Consumer<NPCKnockbackEvent> cb) -
cancelMoveDestination
-
createBundlePacket
-
createPacketTracker
-
createPacketTracker
public static EntityPacketTracker createPacketTracker(Entity entity, EntityPacketTracker.PacketAggregator agg) -
fillProfileProperties
public static com.mojang.authlib.GameProfile fillProfileProperties(com.mojang.authlib.GameProfile profile, boolean requireSecure) throws Throwable - Throws:
Throwable
-
findProfilesByNames
-
getBlockBreaker
public static BlockBreaker getBlockBreaker(Entity entity, Block targetBlock, BlockBreaker.BlockBreakerConfiguration config) -
getBossBar
-
getBoundingBox
-
getCollisionBox
-
getDestination
-
getFallDistance
-
getField
-
getField
-
getFieldsOfType
-
getFinalSetter
-
getFinalSetter
-
getFinalSetter
-
getFirstFinalSetter
-
getFirstGetter
-
getFirstMethodHandle
-
getFirstMethodHandleWithReturnType
public static MethodHandle getFirstMethodHandleWithReturnType(Class<?> clazz, boolean log, Class<?> returnType, Class<?>... params) -
getFirstSetter
-
getFirstStaticGetter
-
getGetter
-
getGetter
-
getHeadYaw
-
getHeight
-
getHorizontalMovement
-
getMethod
-
getMethodHandle
public static MethodHandle getMethodHandle(Class<?> clazz, String method, boolean log, Class<?>... params) -
getNBT
-
getNPC
-
getPacketTracker
-
getPassengers
-
getProfile
-
getProfile
-
getSetter
-
getSetter
-
getSoundPath
- Throws:
CommandException
-
getSource
-
getSpeedFor
-
getStepHeight
-
getVehicle
-
getVerticalMovement
-
getWidth
-
getYaw
-
giveReflectiveAccess
-
isLeashed
-
isOnGround
-
isSolid
-
isValid
-
load
-
loadBridge
- Throws:
Exception
-
look
-
look
-
look
-
mount
-
onPlayerInfoAdd
public static void onPlayerInfoAdd(Player player, Object source, Function<UUID, MirrorTrait> mirrorTraits) -
openAnvilInventory
-
openHorseScreen
-
playAnimation
-
playerTicker
-
registerEntityClass
-
remove
-
removeFromServerPlayerList
-
removeFromWorld
-
removeHookIfNecessary
-
replaceTracker
-
sendPositionUpdate
-
sendTabListAdd
-
sendTabListRemove
public static void sendTabListRemove(Player recipient, Collection<? extends SkinnableEntity> skinnableNPCs) -
sendTabListRemove
-
sendTeamPacket
-
setAggressive
-
setAllayDancing
-
setBodyYaw
-
setBoundingBox
-
setCamelPose
-
setCustomName
-
setDestination
-
setDimensions
-
setEndermanAngry
-
setHeadYaw
-
setKnockbackResistance
-
setLocationDirectly
-
setLyingDown
-
setNoGravity
-
setPandaSitting
-
setPeekShulker
-
setPiglinDancing
-
setPitch
-
setPolarBearRearing
-
setProfile
-
setShouldJump
-
setSitting
-
setSitting
-
setSneaking
-
setSnifferState
-
setStepHeight
-
setTeamNameTagVisible
-
setVerticalMovement
-
setWitherInvulnerable
-
shouldJump
-
shutdown
public static void shutdown() -
sleep
-
trySwim
-
trySwim
-
updateInventoryTitle
-
updateMountedInteractionHeight
-
updatePathfindingRange
-