Skip to content

Location Wrapping

Julian Weinelt edited this page Jun 13, 2025 · 1 revision

Location wrapping is really useful for data storage, such as map instances for minigames.

⚙️ How to use

CodeLib contains 2 different types of LocationWrappers:

  • LocationWrapper: Full location storage
  • LocationWrapperReduced: Location storage without world reference

To convert between Bukkit's Location and the LocationWrappers, you need to use LocUtil. Examples:

// Convert org.bukkit.Location to LocationWrapper
LocationWrapper wrapper = LocUtil.fromBukkit(location);

// Convert to org.bukkit.Location from LocationWrapper
Location location = LocUtil.fromWrapper(wrapper);

Clone this wiki locally