Class v1_7_R3

java.lang.Object
fr.xxathyx.mediaplayer.map.util.v1_7_R3
All Implemented Interfaces:
MapUtil

public class v1_7_R3 extends Object implements MapUtil
The v1_7_R3 class implements MapUtil, it can only be defined once if the server is running under this version, see MapUtilVersion.
Since:
2021-08-23
Version:
1.0.0
Author:
Xxathyx
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getMapId(org.bukkit.map.MapView mapView)
    Gets an map-id according to a MapView.
    org.bukkit.map.MapView
    getMapView(int id)
    Gets a MapView according to the server running version.
    void
    update(org.bukkit.entity.Player player, int id, byte[] buffer)
    Performs a map-id update for a certain player.

    Methods inherited from class java.lang.Object

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

    • v1_7_R3

      public v1_7_R3()
  • Method Details

    • update

      public void update(org.bukkit.entity.Player player, int id, byte[] buffer)
      Description copied from interface: MapUtil
      Performs a map-id update for a certain player.
      Specified by:
      update in interface MapUtil
      Parameters:
      player - The player who will receive the update.
      id - The map-id to be updated.
      buffer - The new map-pixels.
    • getMapView

      public org.bukkit.map.MapView getMapView(int id)
      Description copied from interface: MapUtil
      Gets a MapView according to the server running version.

      Note: The API isn't used directly, its because

      invalid @link
      Bukkit#getMap(int)
      in later Minecraft versions (1.13+) only accepts Integer parameter and not Short, while compiling with latest version of the API may results in a NoSuchMethodError for org.bukkit.Bukkit.getMap(I)Lorg/bukkit/map/MapView} in older versions, thats why this method is used instead to support older ones.
      Specified by:
      getMapView in interface MapUtil
      Parameters:
      id - The targeted map-id to obtain an MapView.
      Returns:
      The corresponding MapView to the given id.
    • getMapId

      public int getMapId(org.bukkit.map.MapView mapView)
      Description copied from interface: MapUtil
      Gets an map-id according to a MapView.

      This getter do the opposite of MapUtil.getMapView(int).

      Note: The API isn't used directly, its because

      invalid @link
      Bukkit#getMap(int)
      in later Minecraft versions (1.13+) only accepts Integer parameter and not Short, while compiling with latest version of the API may results in a NoSuchMethodError for org.bukkit.Bukkit.getMap(I)Lorg/bukkit/map/MapView} in older versions, thats why this method is used instead to support older ones.
      Specified by:
      getMapId in interface MapUtil
      Parameters:
      mapView - The targeted MapView to obtain an map-id.
      Returns:
      The corresponding id to the given MapView.