Package net.citizensnpcs.util
Class Util
java.lang.Object
net.citizensnpcs.util.Util
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
callCollisionEvent
(NPC npc, Entity entity) static Vector
callPushEvent
(NPC npc, double x, double y, double z) static float
clamp
(float angle) Clamps the rotation angle to [-180, 180]static float
clamp
(float angle, float min, float max, float d) static ItemStack
createItem
(Material mat, String name) static ItemStack
createItem
(Material mat, String name, String description) static ItemStack
static void
static void
faceEntity
(Entity entity, Entity to) static void
faceLocation
(Entity entity, Location to) static void
faceLocation
(Entity entity, Location to, boolean headOnly) static void
faceLocation
(Entity entity, Location to, boolean headOnly, boolean immediate) static Location
getCenterLocation
(Block block) static float
getDragonYaw
(Entity entity, double motX, double motZ) Returns the yaw to face along the given velocity (corrected for dragon yaw i.e.static Scoreboard
static Location
getEyeLocation
(Entity entity) static Material
getFallbackMaterial
(String first, String second) static Random
static String
static String
getTeamName
(UUID id) static boolean
static boolean
isAlwaysFlyable
(EntityType type) static boolean
isHorse
(EntityType type) static boolean
static boolean
static boolean
isOffHand
(PlayerInteractEvent event) static String
listValuesPretty
(Enum<?>[] values) static boolean
locationWithinRange
(Location current, Location target, double range) static <T extends Enum<?>>
Tstatic boolean
matchesItemInHand
(Player player, String setting) static Set<EntityType>
optionalEntitySet
(String... types) static String
prettyEnum
(Enum<?> e) static String
static void
runCommand
(NPC npc, Player clicker, String command, boolean op, boolean player) static void
setRotation
(Entity entity, float yaw, float pitch) Sets the entity's yaw and pitch directly including head yaw.
-
Method Details
-
callCollisionEvent
-
callPushEvent
-
clamp
public static float clamp(float angle) Clamps the rotation angle to [-180, 180] -
clamp
public static float clamp(float angle, float min, float max, float d) -
createItem
-
createItem
-
editTitle
-
face
-
faceEntity
-
faceLocation
-
faceLocation
-
faceLocation
-
getCenterLocation
-
getDragonYaw
Returns the yaw to face along the given velocity (corrected for dragon yaw i.e. facing backwards) -
getDummyScoreboard
-
getEyeLocation
-
getFallbackMaterial
-
getFastRandom
-
getMinecraftRevision
-
getTeamName
-
inBlock
-
isAlwaysFlyable
-
isHorse
-
isLoaded
-
isOffHand
-
isOffHand
-
listValuesPretty
-
locationWithinRange
-
matchEnum
-
matchesItemInHand
-
optionalEntitySet
-
prettyEnum
-
prettyPrintLocation
-
runCommand
-
setRotation
Sets the entity's yaw and pitch directly including head yaw.
-