What is the Extent interface for Location


#1

Hello there, I’ve been looking for a while at the SpongeDocs and the JavaDocs of Sponge with no results so I came here in order to understand how should I create a new location.

For Location(E, Vector3d) what is the proper way of instantiation? Isn’t it the right way of referring to a point in the world? Thank you in advance!


#2

The E in that is an Extent, World is a subclass of Extent which means you can put a World in there.

World world = ...;
Location<World> loc = new Location(world, new Vector3d(10, 21, 20));

Location itself has many methods(add, sub, setPosition, getRelative, …) to manipulate an already given Location, like the player location.


#3

Thanks! Sponge works quite different from Spigot. I will get used to it soon but I didn’t understand what the JavaDocs meant.

I like how Sponge plays with the builder pattern and the factory pattern, gotta fix it!