Package net.citizensnpcs.util
Class NMS
java.lang.Object
net.citizensnpcs.util.NMS
-
Nested Class Summary
-
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) static boolean
canNavigateTo
(Entity entity, Location dest, NavigatorParameters params) static void
clearCustomNBT
(ItemMeta meta) 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 double
getBoundingBoxHeight
(Entity entity) static BoundingBox
getCollisionBox
(Block block) static BoundingBox
getCollisionBox
(BlockData blockdata) getComponentMap
(ItemStack item) 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 <T> T
getFirstStaticObject
(Class<?> clazz, Class<?> type) static float
getForwardBackwardMovement
(Entity bukkitEntity) static MethodHandle
static MethodHandle
static float
getHeadYaw
(Entity entity) static float
getJumpPower
(NPC npc, float original) static MethodHandle
getMethodHandle
(Class<?> clazz, String method, boolean log, Class<?>... params) static EntityPacketTracker
getPacketTracker
(Entity entity) static EntityPacketTracker
getPacketTrackerDirectly
(Entity entity) getPassengers
(Entity entity) static com.mojang.authlib.GameProfile
getProfile
(Player player) static com.mojang.authlib.GameProfile
getProfile
(SkullMeta meta) static float
getRidingHeightOffset
(Entity entity, Entity mount) static MethodHandle
static MethodHandle
static Collection
<MethodHandle> getSettersOfType
(Class<?> clazz, Class<?> fieldType) static String
getSoundPath
(Sound flag) static Entity
getSource
(BlockCommandSender sender) static float
getSpeedFor
(NPC npc) static <T> T
getStaticObject
(Class<?> clazz, String name) 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 Collection
<Player> getViewingPlayers
(Entity entity) static double
static float
getXZMovement
(Entity bukkitEntity) static float
static void
giveReflectiveAccess
(Class<?> from, Class<?> to) static boolean
static boolean
isOnGround
(Entity entity) static boolean
isSneaking
(Entity entity) static boolean
static boolean
static void
load
(CommandManager commands) static void
loadBridge
(String rev) static void
static void
static void
static void
markPoseDirty
(Entity tracker) 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, Iterable<Player> to) static Runnable
playerTicker
(Player entity) static void
positionInteractionText
(Player player, Entity interaction, Entity mount, double height) static void
registerEntityClass
(Class<?> clazz, Object type) 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, Collection<Player> to, boolean position) static void
sendPositionUpdate
(Entity from, Collection<Player> to, boolean position, Float bodyYaw, Float pitch, Float headYaw) static void
sendPositionUpdateNearby
(Entity from, boolean position) static void
sendPositionUpdateNearby
(Entity from, boolean position, Float bodyYaw, Float pitch, Float headYaw) static boolean
sendTabListAdd
(Player recipient, Player listPlayer) static void
sendTabListRemove
(Player recipient, Collection<Player> players) 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
setArmadilloState
(Entity entity, ArmadilloTrait.ArmadilloState state) 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
setHeadAndBodyYaw
(Entity entity, float yaw) 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
setNavigationType
(Entity entity, NMS.MinecraftNavigationType type) static void
setNoGravity
(Entity entity, boolean nogravity) static void
setOpWithoutSaving
(Player player, boolean op) 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
setPose
(Entity entity, EntityPoseTrait.EntityPose pose) 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
setTextDisplayComponent
(Entity entity, Object component) static void
setVerticalMovement
(Entity bukkitEntity, double d) static void
setWardenPose
(Entity entity, Object pose) static void
setWitherInvulnerableTicks
(Wither wither, int ticks) static boolean
shouldBroadcastToPlayer
(NPC npc, Supplier<Boolean> defaultResponse) static boolean
shouldJump
(Entity entity) static void
shutdown()
static void
static void
static void
static void
updateInventoryTitle
(Player player, SpigotUtil.InventoryViewAPI view, String newTitle) 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
-
clearCustomNBT
-
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
-
getBoundingBoxHeight
-
getCollisionBox
-
getCollisionBox
-
getComponentMap
-
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
-
getFirstStaticObject
-
getForwardBackwardMovement
-
getGetter
-
getGetter
-
getHeadYaw
-
getJumpPower
-
getMethodHandle
public static MethodHandle getMethodHandle(Class<?> clazz, String method, boolean log, Class<?>... params) -
getPacketTracker
-
getPacketTrackerDirectly
-
getPassengers
-
getProfile
-
getProfile
-
getRidingHeightOffset
-
getSetter
-
getSetter
-
getSettersOfType
-
getSoundPath
- Throws:
CommandException
-
getSource
-
getSpeedFor
-
getStaticObject
-
getStepHeight
-
getVehicle
-
getViewingPlayers
-
getWidth
-
getXZMovement
-
getYaw
-
giveReflectiveAccess
-
isLeashed
-
isOnGround
-
isSneaking
-
isSolid
-
isValid
-
load
-
loadBridge
- Throws:
Exception
-
look
-
look
-
look
-
markPoseDirty
-
mount
-
onPlayerInfoAdd
public static void onPlayerInfoAdd(Player player, Object source, Function<UUID, MirrorTrait> mirrorTraits) -
openAnvilInventory
-
openHorseScreen
-
playAnimation
-
playerTicker
-
positionInteractionText
-
registerEntityClass
-
remove
-
removeFromServerPlayerList
-
removeFromWorld
-
removeHookIfNecessary
-
replaceTracker
-
sendPositionUpdate
-
sendPositionUpdate
-
sendPositionUpdateNearby
-
sendPositionUpdateNearby
-
sendTabListAdd
-
sendTabListRemove
-
sendTabListRemove
-
sendTeamPacket
-
setAggressive
-
setAllayDancing
-
setArmadilloState
-
setBodyYaw
-
setBoundingBox
-
setCamelPose
-
setCustomName
-
setDestination
-
setDimensions
-
setEndermanAngry
-
setHeadAndBodyYaw
-
setHeadYaw
-
setKnockbackResistance
-
setLocationDirectly
-
setLyingDown
-
setNoGravity
-
setOpWithoutSaving
-
setPandaSitting
-
setPeekShulker
-
setPiglinDancing
-
setPitch
-
setPolarBearRearing
-
setPose
-
setProfile
-
setShouldJump
-
setSitting
-
setSitting
-
setSneaking
-
setSnifferState
-
setStepHeight
-
setTeamNameTagVisible
-
setTextDisplayComponent
-
setVerticalMovement
-
setWardenPose
-
setWitherInvulnerableTicks
-
shouldBroadcastToPlayer
-
shouldJump
-
shutdown
public static void shutdown() -
sleep
-
trySwim
-
trySwim
-
updateInventoryTitle
public static void updateInventoryTitle(Player player, SpigotUtil.InventoryViewAPI view, String newTitle) -
updatePathfindingRange
-