-
Notifications
You must be signed in to change notification settings - Fork 3
Coordinates
Coordinates are very similar to Bukkit's Location class. You specify the Menu, X, and Y values.
Think of the Menu like the World in a Location. Remember, when comparing Coordinates with different menu values, you might get an exception. Never create a new Menu just for coordinates!
Also see: Menu.
X is an int variable. This is how many spaces from the top left to the top right your object is at. Refer to the diagram below.
Same as X, except this is how many spaces from the top left to the bottom left your object is at. Coupled with X, this forms a location. Refer to the diagram below.
This is an example of a 9 x 6 (54-slot) inventory. Like all inventories, the X max is always constant. The Y max may vary from size to size.
Coordinates(Menu menu, int x, int y);
menu: The menu acociated with the coordinates. x: The X position, from the top left to top right. Minimum value is 1, maximum value is 9. y: The Y position, from the top left to the bottom left. Minimum value is 1, maximum value will depend on the size of the inventory. You can figure out the maximum size by using this equasion: inventorysize / 9
Coordinates(Menu menu, int slot);
menu: The menu acociated with the coordinates. slot: The inventory slot number. Ranges from 0 to the size of the inventory minus 1.
Return type: int
Modifiers: public
Returns the X coordinate.
Return type: int
Modifiers: public
Returns the Y coordinate.
Return type: Menu
Modifiers: public
Returns the Menu that the coordinates are mapped on.
Return type: int
Modifiers: public
Converts the X and Y coordinates into an inventory index/slot number.