public class BukkitConverters extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BukkitConverters.IgnoreNullConverter<TType>
Represents a typical equivalence converter.
|
| Constructor and Description |
|---|
BukkitConverters() |
| Modifier and Type | Method and Description |
|---|---|
static PacketConstructor.Unwrapper |
asUnwrapper(Class<?> nativeType,
EquivalentConverter<Object> converter)
Retrieve an equivalent unwrapper for the converter.
|
static <T> EquivalentConverter<Iterable<? extends T>> |
getArrayConverter(Class<?> genericItemType,
EquivalentConverter<T> itemConverter)
Retrieve an equivalent converter for an array of generic items.
|
static EquivalentConverter<org.bukkit.Material> |
getBlockConverter()
Retrieve a converter for block instances.
|
static EquivalentConverter<Integer> |
getBlockIDConverter()
Deprecated.
ID's are deprecated
|
static Map<Class<?>,EquivalentConverter<Object>> |
getConvertersForGeneric()
Retrieve every converter that is associated with a generic class.
|
static Map<Class<?>,EquivalentConverter<Object>> |
getConvertersForSpecific()
Retrieve every converter that is associated with a specific class.
|
static EquivalentConverter<WrappedDataWatcher> |
getDataWatcherConverter()
Retrieve a converter for the NMS DataWatcher class and our wrapper.
|
static EquivalentConverter<org.bukkit.potion.PotionEffectType> |
getEffectTypeConverter() |
static EquivalentConverter<org.bukkit.entity.Entity> |
getEntityConverter(org.bukkit.World world)
Retrieve a converter for NMS entities and Bukkit entities.
|
static <TType> EquivalentConverter<TType> |
getIgnoreNull(EquivalentConverter<TType> delegate)
Wraps a given equivalent converter in NULL checks, ensuring that such values are ignored.
|
static EquivalentConverter<org.bukkit.inventory.ItemStack> |
getItemStackConverter()
Retrieve the converter used to convert NMS ItemStacks to Bukkit's ItemStack.
|
static <T> EquivalentConverter<List<T>> |
getListConverter(Class<?> genericItemType,
EquivalentConverter<T> itemConverter)
Retrieve an equivalent converter for a list of generic items.
|
static <T,U> EquivalentConverter<Map<T,U>> |
getMapConverter(Class<?> genericKeyType,
EquivalentConverter<T> keyConverter)
Retrieve an equivalent converter for a map of generic keys and primitive values.
|
static EquivalentConverter<NbtBase<?>> |
getNbtConverter()
Retrieve an equivalent converter for net.minecraft.server NBT classes and their wrappers.
|
static EquivalentConverter<org.bukkit.potion.PotionEffect> |
getPotionEffectConverter()
Retrieve the converter used to convert between a PotionEffect and the equivalent NMS Mobeffect.
|
static <T> EquivalentConverter<Set<T>> |
getSetConverter(Class<?> genericItemType,
EquivalentConverter<T> itemConverter)
Retrieve an equivalent converter for a set of generic items.
|
static EquivalentConverter<org.bukkit.Sound> |
getSoundConverter() |
static List<PacketConstructor.Unwrapper> |
getUnwrappers()
Retrieve every NMS to/from Bukkit converter as unwrappers.
|
static EquivalentConverter<org.bukkit.util.Vector> |
getVectorConverter()
Retrieve the converter used to convert between a Vector and the equivalent NMS Vec3d.
|
static EquivalentConverter<WrappedWatchableObject> |
getWatchableObjectConverter()
Retrieve a converter for watchable objects and the respective wrapper.
|
static EquivalentConverter<org.bukkit.World> |
getWorldConverter()
Retrieve the converter used to convert between a NMS World and a Bukkit world.
|
static EquivalentConverter<org.bukkit.WorldType> |
getWorldTypeConverter()
Retrieve a converter for Bukkit's world type enum and the NMS equivalent.
|
static EquivalentConverter<WrappedAttribute> |
getWrappedAttributeConverter()
Retrieve a converter for wrapped attribute snapshots.
|
static EquivalentConverter<WrappedBlockData> |
getWrappedBlockDataConverter()
Retrieve a converter for wrapped block data.
|
static EquivalentConverter<WrappedChatComponent> |
getWrappedChatComponentConverter()
Retrieve a converter for wrapped chat components.
|
static EquivalentConverter<WrappedGameProfile> |
getWrappedGameProfileConverter()
Retrieve a converter for wrapped attribute snapshots.
|
static EquivalentConverter<WrappedServerPing> |
getWrappedServerPingConverter()
Retrieve the converter for the ServerPing packet in
PacketType.Status.Server#OUT_SERVER_INFO. |
static EquivalentConverter<WrappedStatistic> |
getWrappedStatisticConverter()
Retrieve the converter for a statistic.
|
public static <T,U> EquivalentConverter<Map<T,U>> getMapConverter(Class<?> genericKeyType, EquivalentConverter<T> keyConverter)
T - Key typeU - Value typegenericKeyType - - the generic key type.keyConverter - - an equivalent converter for the generic type.public static <T> EquivalentConverter<List<T>> getListConverter(Class<?> genericItemType, EquivalentConverter<T> itemConverter)
T - TypegenericItemType - - the generic item type.itemConverter - - an equivalent converter for the generic type.public static <T> EquivalentConverter<Set<T>> getSetConverter(Class<?> genericItemType, EquivalentConverter<T> itemConverter)
T - TypegenericItemType - - the generic item type.itemConverter - - an equivalent converter for the generic type.public static <T> EquivalentConverter<Iterable<? extends T>> getArrayConverter(Class<?> genericItemType, EquivalentConverter<T> itemConverter)
T - Type
The array is wrapped in a list.
genericItemType - - the generic item type.itemConverter - - an equivalent converter for the generic type.public static EquivalentConverter<WrappedGameProfile> getWrappedGameProfileConverter()
public static EquivalentConverter<WrappedChatComponent> getWrappedChatComponentConverter()
public static EquivalentConverter<WrappedBlockData> getWrappedBlockDataConverter()
public static EquivalentConverter<WrappedAttribute> getWrappedAttributeConverter()
public static EquivalentConverter<WrappedWatchableObject> getWatchableObjectConverter()
public static EquivalentConverter<WrappedDataWatcher> getDataWatcherConverter()
public static EquivalentConverter<org.bukkit.WorldType> getWorldTypeConverter()
public static EquivalentConverter<NbtBase<?>> getNbtConverter()
public static EquivalentConverter<org.bukkit.entity.Entity> getEntityConverter(org.bukkit.World world)
world - - the current world.public static EquivalentConverter<org.bukkit.inventory.ItemStack> getItemStackConverter()
public static EquivalentConverter<WrappedServerPing> getWrappedServerPingConverter()
PacketType.Status.Server#OUT_SERVER_INFO.public static EquivalentConverter<WrappedStatistic> getWrappedStatisticConverter()
public static EquivalentConverter<org.bukkit.Material> getBlockConverter()
@Deprecated public static EquivalentConverter<Integer> getBlockIDConverter()
public static EquivalentConverter<org.bukkit.World> getWorldConverter()
public static EquivalentConverter<org.bukkit.potion.PotionEffect> getPotionEffectConverter()
public static EquivalentConverter<org.bukkit.util.Vector> getVectorConverter()
public static EquivalentConverter<org.bukkit.Sound> getSoundConverter()
public static <TType> EquivalentConverter<TType> getIgnoreNull(EquivalentConverter<TType> delegate)
TType - Typedelegate - - the underlying equivalent converter.public static PacketConstructor.Unwrapper asUnwrapper(Class<?> nativeType, EquivalentConverter<Object> converter)
nativeType - - the native NMS type the converter produces.converter - - the converter.public static Map<Class<?>,EquivalentConverter<Object>> getConvertersForSpecific()
public static Map<Class<?>,EquivalentConverter<Object>> getConvertersForGeneric()
public static List<PacketConstructor.Unwrapper> getUnwrappers()
public static EquivalentConverter<org.bukkit.potion.PotionEffectType> getEffectTypeConverter()
Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.