Interface BlockCompatibility
public interface BlockCompatibility
This interface outlines a version dependant api that return values based on different
Block inputs. There should be an implementing class for each minecraft protocol version.
For methods that return packets, in order for those packets to be visible to players, the packets
need to be sent to the players. See ICompatibility.sendPackets(Player, Object).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AtomicIntegerThreadsafe method to get unique ids for block cracking. -
Method Summary
Modifier and TypeMethodDescription@NotNull ObjectgetCrackPacket(@NotNull org.bukkit.block.Block block, int crack) Returns a block break animation packet for the givenblockandcrack.@NotNull ObjectgetCrackPacket(@NotNull org.bukkit.block.Block block, int crack, int id) Returns a block break animation packet for the givenblockandcrack.
-
Field Details
-
IDS
Threadsafe method to get unique ids for block cracking.- See Also:
-
-
Method Details
-
getCrackPacket
Returns a block break animation packet for the givenblockandcrack. This should probably not be used for transparent blocks. This method is a shorthand forgetCrackPacket(Block, int, int).For more information, please see the protocol wiki.
- Parameters:
block- The non-null block to display the cracking animation over.crack- The cracking amount, between 0 and 9 inclusively. Higher values are more visibly cracked.- Returns:
- The non-null animation packet.
-
getCrackPacket
@NotNull @NotNull Object getCrackPacket(@NotNull @NotNull org.bukkit.block.Block block, int crack, int id) Returns a block break animation packet for the givenblockandcrack. This should probably not be used for transparent blocks. Theidis a unique to each packet, and sending a new packet with the same id will cause the previous one to be overwritten.For more information, please see the protocol wiki.
- Parameters:
block- The non-null block to display the cracking animation over.crack- The cracking amount, between 0 and 9 inclusively. Higher values are more visibly cracked.id- The unique id. If you do not want to override the previous packet, usegetCrackPacket(Block, int)}.- Returns:
- The non-null animation packet.
-