Class SpigotConversionUtil

java.lang.Object
io.github.retrooper.packetevents.util.SpigotConversionUtil

public class SpigotConversionUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState
    fromBukkitBlockData(org.bukkit.block.data.BlockData blockData)
     
    static com.github.retrooper.packetevents.protocol.entity.type.EntityType
    fromBukkitEntityType(org.bukkit.entity.EntityType entityType)
     
    static com.github.retrooper.packetevents.protocol.player.GameMode
    fromBukkitGameMode(org.bukkit.GameMode gameMode)
     
    static com.github.retrooper.packetevents.protocol.item.type.ItemType
    fromBukkitItemMaterial(org.bukkit.Material material)
     
    static com.github.retrooper.packetevents.protocol.item.ItemStack
    fromBukkitItemStack(org.bukkit.inventory.ItemStack itemStack)
     
    static com.github.retrooper.packetevents.protocol.world.Location
    fromBukkitLocation(org.bukkit.Location location)
     
    static com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState
    fromBukkitMaterialData(org.bukkit.material.MaterialData materialData)
    Converts a Bukkit MaterialData object to a WrappedBlockState object.
    static com.github.retrooper.packetevents.protocol.particle.type.ParticleType<?>
    fromBukkitParticle(Enum<?> particle)
     
    static com.github.retrooper.packetevents.protocol.entity.pose.EntityPose
    fromBukkitPose(org.bukkit.entity.Pose pose)
     
    static com.github.retrooper.packetevents.protocol.potion.PotionType
    fromBukkitPotionEffectType(org.bukkit.potion.PotionEffectType potionEffectType)
     
    static com.github.retrooper.packetevents.protocol.world.Dimension
    fromBukkitWorld(org.bukkit.World world)
    Deprecated.
    static @Nullable org.bukkit.entity.Entity
    getEntityById(@Nullable org.bukkit.World world, int entityId)
    WARNING: This is not a safe operation, avoid usage of this method if possible!
    static org.bukkit.block.data.BlockData
    toBukkitBlockData(com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState blockState)
     
    static org.bukkit.entity.EntityType
    toBukkitEntityType(com.github.retrooper.packetevents.protocol.entity.type.EntityType entityType)
     
    static org.bukkit.GameMode
    toBukkitGameMode(com.github.retrooper.packetevents.protocol.player.GameMode gameMode)
     
    static org.bukkit.inventory.MainHand
    toBukkitHand(com.github.retrooper.packetevents.protocol.player.HumanoidArm arm)
     
    static org.bukkit.Material
    toBukkitItemMaterial(com.github.retrooper.packetevents.protocol.item.type.ItemType itemType)
     
    static org.bukkit.inventory.ItemStack
    toBukkitItemStack(com.github.retrooper.packetevents.protocol.item.ItemStack itemStack)
     
    static org.bukkit.Location
    toBukkitLocation(org.bukkit.World world, com.github.retrooper.packetevents.protocol.world.Location location)
     
    static org.bukkit.material.MaterialData
    toBukkitMaterialData(com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState state)
    Converts a WrappedBlockState object to a Bukkit MaterialData object.
    static Enum<?>
    toBukkitParticle(com.github.retrooper.packetevents.protocol.particle.type.ParticleType<?> particle)
     
    static org.bukkit.entity.Pose
    toBukkitPose(com.github.retrooper.packetevents.protocol.entity.pose.EntityPose pose)
     
    static org.bukkit.potion.PotionEffectType
    toBukkitPotionEffectType(com.github.retrooper.packetevents.protocol.potion.PotionType potionType)
     
    static com.github.retrooper.packetevents.protocol.world.dimension.DimensionType
    typeFromBukkitWorld(org.bukkit.World world)
     

    Methods inherited from class java.lang.Object

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

    • SpigotConversionUtil

      public SpigotConversionUtil()
  • Method Details

    • fromBukkitLocation

      public static com.github.retrooper.packetevents.protocol.world.Location fromBukkitLocation(org.bukkit.Location location)
    • toBukkitLocation

      public static org.bukkit.Location toBukkitLocation(org.bukkit.World world, com.github.retrooper.packetevents.protocol.world.Location location)
    • fromBukkitPotionEffectType

      public static com.github.retrooper.packetevents.protocol.potion.PotionType fromBukkitPotionEffectType(org.bukkit.potion.PotionEffectType potionEffectType)
    • toBukkitPotionEffectType

      public static org.bukkit.potion.PotionEffectType toBukkitPotionEffectType(com.github.retrooper.packetevents.protocol.potion.PotionType potionType)
    • fromBukkitGameMode

      public static com.github.retrooper.packetevents.protocol.player.GameMode fromBukkitGameMode(org.bukkit.GameMode gameMode)
    • toBukkitGameMode

      public static org.bukkit.GameMode toBukkitGameMode(com.github.retrooper.packetevents.protocol.player.GameMode gameMode)
    • fromBukkitBlockData

      public static com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState fromBukkitBlockData(org.bukkit.block.data.BlockData blockData)
    • toBukkitBlockData

      public static org.bukkit.block.data.BlockData toBukkitBlockData(com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState blockState)
    • fromBukkitEntityType

      public static com.github.retrooper.packetevents.protocol.entity.type.EntityType fromBukkitEntityType(org.bukkit.entity.EntityType entityType)
    • toBukkitEntityType

      public static org.bukkit.entity.EntityType toBukkitEntityType(com.github.retrooper.packetevents.protocol.entity.type.EntityType entityType)
    • fromBukkitItemMaterial

      public static com.github.retrooper.packetevents.protocol.item.type.ItemType fromBukkitItemMaterial(org.bukkit.Material material)
    • toBukkitItemMaterial

      public static org.bukkit.Material toBukkitItemMaterial(com.github.retrooper.packetevents.protocol.item.type.ItemType itemType)
    • fromBukkitMaterialData

      public static com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState fromBukkitMaterialData(org.bukkit.material.MaterialData materialData)
      Converts a Bukkit MaterialData object to a WrappedBlockState object.

      This method is compatible with Minecraft versions from 1.8.8 to 1.12.2.

      Parameters:
      materialData - The Bukkit MaterialData object to convert.
      Returns:
      The corresponding WrappedBlockState object.
    • toBukkitMaterialData

      public static org.bukkit.material.MaterialData toBukkitMaterialData(com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState state)
      Converts a WrappedBlockState object to a Bukkit MaterialData object.
      Parameters:
      state - The WrappedBlockState object to convert.
      Returns:
      The corresponding Bukkit MaterialData object.
    • fromBukkitItemStack

      public static com.github.retrooper.packetevents.protocol.item.ItemStack fromBukkitItemStack(org.bukkit.inventory.ItemStack itemStack)
    • toBukkitItemStack

      public static org.bukkit.inventory.ItemStack toBukkitItemStack(com.github.retrooper.packetevents.protocol.item.ItemStack itemStack)
    • typeFromBukkitWorld

      public static com.github.retrooper.packetevents.protocol.world.dimension.DimensionType typeFromBukkitWorld(org.bukkit.World world)
    • fromBukkitWorld

      @Deprecated public static com.github.retrooper.packetevents.protocol.world.Dimension fromBukkitWorld(org.bukkit.World world)
      Deprecated.
    • fromBukkitParticle

      public static com.github.retrooper.packetevents.protocol.particle.type.ParticleType<?> fromBukkitParticle(Enum<?> particle)
    • toBukkitParticle

      public static Enum<?> toBukkitParticle(com.github.retrooper.packetevents.protocol.particle.type.ParticleType<?> particle)
    • getEntityById

      public static @Nullable org.bukkit.entity.Entity getEntityById(@Nullable @Nullable org.bukkit.World world, int entityId)
      WARNING: This is not a safe operation, avoid usage of this method if possible!

      Access the Bukkit Entity associated to the Entity ID.

      Parameters:
      world - The world they are in. This field is optional, but is recommended as it could boost performance.
      entityId - The associated Entity ID
      Returns:
      The Bukkit Entity
    • toBukkitPose

      public static org.bukkit.entity.Pose toBukkitPose(com.github.retrooper.packetevents.protocol.entity.pose.EntityPose pose)
    • fromBukkitPose

      public static com.github.retrooper.packetevents.protocol.entity.pose.EntityPose fromBukkitPose(org.bukkit.entity.Pose pose)
    • toBukkitHand

      public static org.bukkit.inventory.MainHand toBukkitHand(com.github.retrooper.packetevents.protocol.player.HumanoidArm arm)