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 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 Scoreboard
static Entity
static Location
getEyeLocation
(Entity entity) static EntityType
getFallbackEntityType
(String first, String... second) static Material
getFallbackMaterial
(String first, String... second) static Random
static <T extends Keyed>
TgetRegistryValue
(Registry<T> registry, String... keyCandidates) static String
getTeamName
(UUID id) static float
getYawFromVelocity
(Entity entity, double motX, double motZ) Returns the yaw to face along the given velocity (corrected for dragon yaw i.e.static boolean
static boolean
isAlwaysFlyable
(EntityType type) static boolean
isBedrockName
(String name) static boolean
isEquippable
(ItemStack stack, Equipment.EquipmentSlot slot) static boolean
isHorse
(EntityType type) static boolean
static boolean
static boolean
isOffHand
(PlayerInteractEvent event) static String
listValuesPretty
(Object[] values) static <T extends Enum<?>>
Tstatic boolean
matchesItemInHand
(Player player, String setting) static Set
<EntityType> optionalEntitySet
(String... types) static Color
parseColor
(String string) static ItemStack
parseItemStack
(ItemStack stack, String item) static int
parseTicks
(String raw) static String
static String
possiblyStripBedrockPrefix
(String name, UUID uuid) static String
prettyEnum
(Enum<?> e) static String
static void
runCommand
(NPC npc, Player clicker, String command, boolean op, boolean player) static void
sendBlockChanges
(List<Block> blocks, Material type) static String
stripBedrockPrefix
(String name) 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
-
face
-
faceEntity
-
faceLocation
-
faceLocation
-
faceLocation
-
getCenterLocation
-
getDummyScoreboard
-
getEntity
-
getEyeLocation
-
getFallbackEntityType
-
getFallbackMaterial
-
getFastRandom
-
getRegistryValue
-
getTeamName
-
getYawFromVelocity
Returns the yaw to face along the given velocity (corrected for dragon yaw i.e. facing backwards) -
inBlock
-
isAlwaysFlyable
-
isBedrockName
-
isEquippable
-
isHorse
-
isLoaded
-
isOffHand
-
isOffHand
-
listValuesPretty
-
matchEnum
-
matchesItemInHand
-
optionalEntitySet
-
parseColor
-
parseItemStack
-
parseTicks
-
possiblyConvertToBedrockName
-
possiblyStripBedrockPrefix
-
prettyEnum
-
prettyPrintLocation
-
runCommand
-
sendBlockChanges
-
stripBedrockPrefix
-
talk
-
toTicks
-