Package me.deecaad.core.compatibility
Interface ICompatibility
public interface ICompatibility
This interface outlines a version dependant api, where there is an implementing class for each
minecraft protocol version.
-
Method Summary
Modifier and TypeMethodDescription@NotNull BlockCompatibilityReturns this version's loadedBlockCompatibility.@NotNull EntityCompatibilityReturns this version's loadedEntityCompatibility.@NotNull ObjectgetEntityPlayer(@NotNull org.bukkit.entity.Player player) Returns the nms EntityPlayer wrapped by the given bukkitPlayer.@NotNull NBTCompatibilityReturns this version's loadedNBTCompatibility.voidsendPackets(org.bukkit.entity.Player player, Object packet) Overloaded version ofsendPackets(Player, Object...)which does not need to instantiate a new array of packets every time 1 packet needs to be sent.voidsendPackets(org.bukkit.entity.Player player, Object... packets) Sends the givenpacketsto the givenplayer.
-
Method Details
-
getEntityPlayer
Returns the nms EntityPlayer wrapped by the given bukkitPlayer.- Parameters:
player- The non-null bukkit player.- Returns:
- The non-null nms player.
-
sendPackets
Overloaded version ofsendPackets(Player, Object...)which does not need to instantiate a new array of packets every time 1 packet needs to be sent.- Parameters:
player- The non-null player to send the packet to.packet- The non-null packet to send to the player.
-
sendPackets
Sends the givenpacketsto the givenplayer. This can be run asynchronously- Parameters:
player- The non-null player to send the packet to.packets- The non-null array of non-null packets to send to the player.
-
getNBTCompatibility
Returns this version's loadedNBTCompatibility. The classes for each version can be found in the nbt package.- Returns:
- This version's non-null nbt compatibility.
- Throws:
UnsupportedOperationException- In minecraft protocol versions 1_13_R2 and higher.
-
getEntityCompatibility
Returns this version's loadedEntityCompatibility. The classes for each version can be found in the entity package.- Returns:
- This version's non-null entity compatibility.
-
getBlockCompatibility
Returns this version's loadedBlockCompatibility. The classes for each version can be found in the block package.- Returns:
- This version's non-null block compatibility.
-