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 boolean
callPistonPushEvent
(NPC npc) static <T> T
callPossiblySync
(Callable<T> callable, boolean sync) 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 int
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 Entity
static Location
getEyeLocation
(Entity entity) static Material
getFallbackMaterial
(String first, String... second) static Random
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 ItemStack
parseItemStack
(ItemStack stack, String item) static int
parseTicks
(String raw) static String
prettyEnum
(Enum<?> e) static String
static String
static void
runCommand
(NPC npc, Player clicker, String command, boolean op, boolean player) static void
sendBlockChanges
(List<Block> blocks, Material type) static void
talk
(SpeechContext context) static int
-
Method Details
-
callCollisionEvent
-
callPistonPushEvent
-
callPossiblySync
-
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) -
convert
-
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
-
getEntity
-
getEyeLocation
-
getFallbackMaterial
-
getFastRandom
-
getTeamName
-
inBlock
-
isAlwaysFlyable
-
isHorse
-
isLoaded
-
isOffHand
-
isOffHand
-
listValuesPretty
-
locationWithinRange
-
matchEnum
-
matchesItemInHand
-
optionalEntitySet
-
parseItemStack
-
parseTicks
-
prettyEnum
-
prettyPrintLocation
-
rawtype
-
runCommand
-
sendBlockChanges
-
talk
-
toTicks
-