Package net.citizensnpcs.util
Class Util
java.lang.Object
net.citizensnpcs.util.Util
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcallCollisionEvent(NPC npc, Entity entity) static booleancallPistonPushEvent(NPC npc) static <T> TcallPossiblySync(Callable<T> callable, boolean sync) static VectorcallPushEvent(NPC npc, double x, double y, double z) static floatclamp(float angle) Clamps the rotation angle to [-180, 180]static floatclamp(float angle, float min, float max, float d) static intstatic ItemStackcreateItem(Material mat, String name) static ItemStackcreateItem(Material mat, String name, String description) static voidstatic voidfaceEntity(Entity entity, Entity to) static voidfaceLocation(Entity entity, Location to) static voidfaceLocation(Entity entity, Location to, boolean headOnly) static voidfaceLocation(Entity entity, Location to, boolean headOnly, boolean immediate) static AttributegetAttribute(String attribute) static LocationgetCenterLocation(Block block) static Scoreboardstatic Entitystatic LocationgetEyeLocation(Entity entity) static EntityTypegetFallbackEntityType(String first, String... second) static MaterialgetFallbackMaterial(String first, String... second) static Randomstatic <T extends Keyed>
TgetRegistryValue(Registry<T> registry, String... keyCandidates) static StringgetTeamName(UUID id) static floatgetYawFromVelocity(Entity entity, double motX, double motZ) Returns the yaw to face along the given velocity (corrected for dragon yaw i.e. facing backwards)static booleanstatic booleanisAlwaysFlyable(EntityType type) static booleanisBedrockName(String name) static booleanisEquippable(ItemStack stack, Equipment.EquipmentSlot slot) static booleanisHorse(EntityType type) static booleanstatic booleanstatic booleanisOffHand(PlayerInteractEvent event) listValuesPretty(Class<T> values) static StringlistValuesPretty(Object[] values) static <T extends Enum<?>>
Tstatic booleanmatchesItemInHand(Player player, String setting) static Set<EntityType> optionalEntitySet(String... types) static ColorparseColor(String string) static intparseTicks(String raw) static Stringstatic StringpossiblyStripBedrockPrefix(String name, UUID uuid) static StringprettyEnum(Enum<?> e) static Stringstatic voidrunCommand(NPC npc, Player clicker, String command, boolean op, boolean player) static voidsendBlockChanges(List<Block> blocks, Material type) static StringstripBedrockPrefix(String name) static voidtalk(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
-
getAttribute
-
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
-
listValuesPretty
-
matchEnum
-
matchesItemInHand
-
optionalEntitySet
-
parseColor
-
parseTicks
-
possiblyConvertToBedrockName
-
possiblyStripBedrockPrefix
-
prettyEnum
-
prettyPrintLocation
-
runCommand
-
sendBlockChanges
-
stripBedrockPrefix
-
talk
-
toTicks
-