Class Util

java.lang.Object
net.citizensnpcs.util.Util

public class Util extends Object
  • Method Details

    • callCollisionEvent

      public static void callCollisionEvent(NPC npc, Entity entity)
    • callPushEvent

      public static Vector callPushEvent(NPC npc, double x, double y, double z)
    • 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

      public static ItemStack createItem(Material mat, String name)
    • createItem

      public static ItemStack createItem(Material mat, String name, String description)
    • editTitle

      public static ItemStack editTitle(ItemStack item, Function<String,String> transform)
    • face

      public static void face(Entity entity, float yaw, float pitch)
    • faceEntity

      public static void faceEntity(Entity entity, Entity to)
    • faceLocation

      public static void faceLocation(Entity entity, Location to)
    • faceLocation

      public static void faceLocation(Entity entity, Location to, boolean headOnly)
    • faceLocation

      public static void faceLocation(Entity entity, Location to, boolean headOnly, boolean immediate)
    • getCenterLocation

      public static Location getCenterLocation(Block block)
    • getDragonYaw

      public static float getDragonYaw(Entity entity, double motX, double motZ)
      Returns the yaw to face along the given velocity (corrected for dragon yaw i.e. facing backwards)
    • getDummyScoreboard

      public static Scoreboard getDummyScoreboard()
    • getEyeLocation

      public static Location getEyeLocation(Entity entity)
    • getFallbackMaterial

      public static Material getFallbackMaterial(String first, String second)
    • getFastRandom

      public static Random getFastRandom()
    • getMinecraftRevision

      public static String getMinecraftRevision()
    • getTeamName

      public static String getTeamName(UUID id)
    • inBlock

      public static boolean inBlock(Entity entity)
    • isAlwaysFlyable

      public static boolean isAlwaysFlyable(EntityType type)
    • isHorse

      public static boolean isHorse(EntityType type)
    • isLoaded

      public static boolean isLoaded(Location location)
    • isOffHand

      public static boolean isOffHand(PlayerInteractEntityEvent event)
    • isOffHand

      public static boolean isOffHand(PlayerInteractEvent event)
    • listValuesPretty

      public static String listValuesPretty(Enum<?>[] values)
    • locationWithinRange

      public static boolean locationWithinRange(Location current, Location target, double range)
    • matchEntityType

      public static EntityType matchEntityType(String toMatch)
    • matchEnum

      public static <T extends Enum<?>> T matchEnum(T[] values, String toMatch)
    • matchesItemInHand

      public static boolean matchesItemInHand(Player player, String setting)
    • optionalEntitySet

      public static Set<EntityType> optionalEntitySet(String... types)
    • prettyEnum

      public static String prettyEnum(Enum<?> e)
    • prettyPrintLocation

      public static String prettyPrintLocation(Location to)
    • requiresNettyChannelMetadata

      public static boolean requiresNettyChannelMetadata()
    • setRotation

      public static void setRotation(Entity entity, float yaw, float pitch)
      Sets the entity's yaw and pitch directly including head yaw.