Class PylonUtils

java.lang.Object
io.github.pylonmc.pylon.util.PylonUtils

public final class PylonUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.bukkit.Color
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    animate(@Nullable org.bukkit.entity.ItemDisplay display, int delay, int duration, org.joml.Matrix4f matrix)
     
    static void
    animate(@Nullable org.bukkit.entity.ItemDisplay display, int duration, org.joml.Matrix4f matrix)
     
    static @NotNull org.bukkit.Color
    colorFromTemperature(double celsius)
     
    static @NotNull net.kyori.adventure.text.format.TextColor
    colorToTextColor(@NonNull org.bukkit.Color color)
     
    static @NotNull net.kyori.adventure.text.Component
    createBar(double proportion, int bars, net.kyori.adventure.text.format.TextColor color)
     
    static @NotNull net.kyori.adventure.text.Component
    createDiscreteProgressBar(int stage, int maxStage, net.kyori.adventure.text.format.TextColor color)
     
    static @NotNull net.kyori.adventure.text.Component
    createFluidAmountBar(double amount, double capacity, int bars, net.kyori.adventure.text.format.TextColor fluidColor)
     
    static @NotNull net.kyori.adventure.text.Component
    createProgressBar(double amount, double max, int bars, net.kyori.adventure.text.format.TextColor color)
     
    static @NotNull net.kyori.adventure.text.Component
    createProgressBar(double progress, int bars, net.kyori.adventure.text.format.TextColor color)
     
    static void
    drawParticleLine(org.bukkit.Location start, @NotNull org.bukkit.Location end, double spacing, Consumer<org.bukkit.Location> spawnParticle)
     
    static @NotNull org.joml.Vector3d
    getDirection(@NotNull org.bukkit.Location source, @NotNull org.bukkit.Location target)
     
    static @NotNull org.joml.Vector3d
    getDisplacement(@NotNull org.bukkit.Location source, @NotNull org.bukkit.Location target)
     
    static boolean
    handleFluidTankRightClick(@NotNull io.github.pylonmc.rebar.block.base.RebarFluidTank tank, @NotNull org.bukkit.event.player.PlayerInteractEvent event, @NotNull org.bukkit.event.EventPriority priority)
    Handles players right clicking with bottles, water buckets, etc Returns true if the function attempted to process the item used (i.e.
    static boolean
    isPotion(org.bukkit.Material material)
     
    static org.bukkit.inventory.ItemStack
    itemFromKey(org.bukkit.NamespacedKey key)
    Returns an item representing the key.
    static @NotNull org.bukkit.NamespacedKey
    pylonKey(@NotNull String key)
     
    static boolean
    shouldBreakBlockUsingTool(@NotNull org.bukkit.block.Block block, @NotNull org.bukkit.inventory.ItemStack tool)
     
    static @NotNull org.bukkit.entity.TextDisplay
    spawnUnitSquareTextDisplay(@NotNull org.bukkit.Location location, @NotNull org.bukkit.Color color)
     
    static @NotNull org.bukkit.entity.TextDisplay
    spawnUnitSquareTextDisplay(@NotNull org.bukkit.Location location, @NotNull org.bukkit.Color color, Consumer<org.bukkit.entity.TextDisplay> initializer)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • METAL_GRAY

      public static final org.bukkit.Color METAL_GRAY
  • Method Details

    • pylonKey

      @NotNull public static @NotNull org.bukkit.NamespacedKey pylonKey(@NotNull @NotNull String key)
    • drawParticleLine

      public static void drawParticleLine(org.bukkit.Location start, @NotNull @NotNull org.bukkit.Location end, double spacing, Consumer<org.bukkit.Location> spawnParticle)
    • colorFromTemperature

      @NotNull public static @NotNull org.bukkit.Color colorFromTemperature(double celsius)
    • colorToTextColor

      @NotNull public static @NotNull net.kyori.adventure.text.format.TextColor colorToTextColor(@NonNull org.bukkit.Color color)
    • spawnUnitSquareTextDisplay

      @NotNull public static @NotNull org.bukkit.entity.TextDisplay spawnUnitSquareTextDisplay(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull org.bukkit.Color color)
    • spawnUnitSquareTextDisplay

      @NotNull public static @NotNull org.bukkit.entity.TextDisplay spawnUnitSquareTextDisplay(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull org.bukkit.Color color, Consumer<org.bukkit.entity.TextDisplay> initializer)
    • getDisplacement

      @NotNull public static @NotNull org.joml.Vector3d getDisplacement(@NotNull @NotNull org.bukkit.Location source, @NotNull @NotNull org.bukkit.Location target)
    • getDirection

      @NotNull public static @NotNull org.joml.Vector3d getDirection(@NotNull @NotNull org.bukkit.Location source, @NotNull @NotNull org.bukkit.Location target)
    • createBar

      @NotNull public static @NotNull net.kyori.adventure.text.Component createBar(double proportion, int bars, net.kyori.adventure.text.format.TextColor color)
    • createProgressBar

      @NotNull public static @NotNull net.kyori.adventure.text.Component createProgressBar(double progress, int bars, net.kyori.adventure.text.format.TextColor color)
    • createDiscreteProgressBar

      @NotNull public static @NotNull net.kyori.adventure.text.Component createDiscreteProgressBar(int stage, int maxStage, net.kyori.adventure.text.format.TextColor color)
    • createProgressBar

      @NotNull public static @NotNull net.kyori.adventure.text.Component createProgressBar(double amount, double max, int bars, net.kyori.adventure.text.format.TextColor color)
    • createFluidAmountBar

      @NotNull public static @NotNull net.kyori.adventure.text.Component createFluidAmountBar(double amount, double capacity, int bars, net.kyori.adventure.text.format.TextColor fluidColor)
    • animate

      public static void animate(@Nullable @Nullable org.bukkit.entity.ItemDisplay display, int delay, int duration, org.joml.Matrix4f matrix)
      Parameters:
      display - if null nothing gets done
    • animate

      public static void animate(@Nullable @Nullable org.bukkit.entity.ItemDisplay display, int duration, org.joml.Matrix4f matrix)
      Parameters:
      display - if null nothing gets done
    • shouldBreakBlockUsingTool

      public static boolean shouldBreakBlockUsingTool(@NotNull @NotNull org.bukkit.block.Block block, @NotNull @NotNull org.bukkit.inventory.ItemStack tool)
    • itemFromKey

      public static org.bukkit.inventory.ItemStack itemFromKey(org.bukkit.NamespacedKey key)
      Returns an item representing the key. If no representative item exists (e.g. fire) a fallback for that item will be used (if one exists)
    • isPotion

      public static boolean isPotion(org.bukkit.Material material)
    • handleFluidTankRightClick

      public static boolean handleFluidTankRightClick(@NotNull @NotNull io.github.pylonmc.rebar.block.base.RebarFluidTank tank, @NotNull @NotNull org.bukkit.event.player.PlayerInteractEvent event, @NotNull @NotNull org.bukkit.event.EventPriority priority)
      Handles players right clicking with bottles, water buckets, etc Returns true if the function attempted to process the item used (i.e. if it's a water bucket, bottle, etc)