Class CoordAdapter

java.lang.Object
com.fren_gor.ultimateAdvancementAPI.util.CoordAdapter

public final class CoordAdapter extends Object
The CoordAdapter class adds support for advancement negative coordinates.

Note that the x-axis points to the right (as usual), whereas the y-axis points downward.

An example usage is shown below:

 // Keys of the advancements to create
 var advKey1 = new AdvancementKey(myPlugin, "first_advancement");
 var advKey2 = new AdvancementKey(myPlugin, "second_advancement");
 var advKey3 = new AdvancementKey(myPlugin, "third_advancement");

 // Create the CoordAdapter instance
 CoordAdapter adapter = CoordAdapter.builder()
         .add(advKey1, 0, 0)  // Will become (0, 1)
         .add(advKey2, 1, -1) // Will become (1, 0)
         .add(advKey3, 1, 1)  // Will become (1, 2)
         .build();

 // Create the AdvancementDisplays
 var advDisplay1 = new AdvancementDisplay.Builder(Material.GRASS_BLOCK, "Title1").coords(adapter, advKey1).build();
 var advDisplay2 = new AdvancementDisplay.Builder(Material.GRASS_BLOCK, "Title2").coords(adapter, advKey2).build();
 var advDisplay3 = new AdvancementDisplay.Builder(Material.GRASS_BLOCK, "Title3").coords(adapter, advKey3).build();

 // Create the advancements
 var adv1 = new RootAdvancement(myTab, advKey1.getKey(), advDisplay1, "textures/block/stone.png");
 var adv2 = new BaseAdvancement(advKey2.getKey(), advDisplay2, adv1);
 var adv3 = new BaseAdvancement(advKey3.getKey(), advDisplay3, adv1, 5);
Since:
2.1.0