1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Merge pull request #569 from Poslovitch/documentation

Documentation fixes and improvements
This commit is contained in:
TheBusyBiscuit 2018-01-07 20:48:12 +01:00 committed by GitHub
commit 0a6f54ec8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 80 deletions

View File

@ -22,7 +22,7 @@ public class Contributor {
* Returns the name of this contributor.
*
* @return the name of this contributor
* @since 4.2.0
* @since 4.1.13
*/
public String getName() { return this.name; }
@ -31,7 +31,7 @@ public class Contributor {
* It can be {@code Author} or {@code Head Artist}.
*
* @return the job of this contributor
* @since 4.2.0
* @since 4.1.13
*/
public String getJob() { return this.job; }
@ -39,7 +39,7 @@ public class Contributor {
* Returns the link to the GitHub profile of this contributor.
*
* @return the GitHub profile of this contributor.
* @since 4.2.0
* @since 4.1.13
*/
public String getProfile() { return this.profile; }
@ -47,7 +47,7 @@ public class Contributor {
* Returns the number of commits to the Slimefun4's repository of this contributor.
*
* @return the number of commits of this contributor.
* @since 4.2.0
* @since 4.1.13
*/
public int getCommits() { return this.commits; }
@ -56,7 +56,7 @@ public class Contributor {
*
* @param profile the link to the GitHub profile of this contributor
*
* @since 4.2.0
* @since 4.1.13
*/
protected void setProfile(String profile) {
this.profile = profile;

View File

@ -15,22 +15,19 @@ import me.mrCookieSlime.Slimefun.api.Slimefun;
import org.bukkit.inventory.ItemStack;
/**
* Statically handles categories. Represents a category, which structure
* multiple {@link SlimefunItem} in the Slimefun Guide.
* <p>
* See {@link #Category(ItemStack)} to create a category.
* Statically handles categories.
* Represents a category, which structure multiple {@link SlimefunItem} in the guide.
* <p>
* See {@link Categories} for the built-in categories.
*
* @author TheBusyBiscuit
*
* @since 4.0
*
*
* @see LockedCategory
* @see SeasonCategory
*/
public class Category {
/**
* Contains all the registered Categories.
* List of the registered Categories.
* @since 4.0
* @see Categories
*/
@ -42,24 +39,12 @@ public class Category {
private int tier;
/**
* The basic constructor for a Category.
* <p>
* Create a new category by calling {@link #Category(ItemStack)}.
* <br>
* The display item can be created using {@link ItemStack}, however using CSCoreLib's
* {@link CustomItem} or even {@link MenuItem} is highly recommended.
* <br>
* Instead of {@link #Category(ItemStack, int)}, where the tier is customizable,
* it will here automatically be set to 3.
* <p>
* Major part of category declaration is handled by Slimefun itself.
* <br>
* See {@link #add(SlimefunItem)} and {@link #register()} for more information.
* Constructs a Category with the given display item.
* The tier is set to a default value of {@code 3}.
*
* @param item The display item for this category
* @param item the display item for this category
*
* @since 4.0
* @see #Category(ItemStack, int)
*/
public Category(ItemStack item) {
this.item = item;
@ -69,25 +54,14 @@ public class Category {
}
/**
* The constructor for a Category.
* <p>
* Create a new category by calling {@link #Category(ItemStack, int)}.
* <br>
* The display item can be created using {@link ItemStack}, however using CSCoreLib's
* {@link CustomItem} or even {@link MenuItem} is highly recommended.
* <br>
* The tier defines where the category will be displayed in the Slimefun Guide.
* A lower tier will display the category first.
* <p>
* Major part of category declaration is handled by Slimefun itself.
* <br>
* See {@link #add(SlimefunItem)} and {@link #register()} for more information.
* Constructs a Category with the given display item and the provided tier.
* </br>
* A lower tier results in this category being displayed first.
*
* @param item The display item for this category
* @param tier The tier of this category
* @param item the display item for this category
* @param tier the tier for this category
*
* @since 4.0
* @see #Category(ItemStack)
*/
public Category(ItemStack item, int tier) {
this.item = item;
@ -97,12 +71,9 @@ public class Category {
}
/**
* Registers the category.
* Registers this category.
* <p>
* By default, the category gets automatically registered when a {@link SlimefunItem}
* is bound to it.
* <br>
* See {@link SlimefunItem#register(boolean)} for more details.
* By default, a category is automatically registered when a {@link SlimefunItem} is bound to it.
*
* @since 4.0
*/
@ -118,9 +89,9 @@ public class Category {
}
/**
* Gets the list of all registered categories.
* Gets the list of the registered categories.
*
* @return the list of registered categories
* @return the list of the registered categories
*
* @since 4.0
* @see Categories
@ -130,27 +101,21 @@ public class Category {
}
/**
* Bounds a {@link SlimefunItem} to the category.
* <p>
* By default, a SlimefunItem gets automatically bound to a Category when it gets
* registered.
* <br>
* See {@link SlimefunItem#register(boolean)} for more information.
* Bounds the provided {@link SlimefunItem} to this category.
*
* @param item SlimefunItem to bound to this category
* @param item the SlimefunItem to bound to this category
*
* @since 4.0
* @see #getItems()
*/
public void add(SlimefunItem item) {
items.add(item);
}
/**
* Gets the display item of the category.
*
* @return the category's display item
* Returns the display item of this category.
*
* @return the display item of this category
*
* @since 4.0
*/
public ItemStack getItem() {
@ -158,10 +123,10 @@ public class Category {
}
/**
* Gets the list of all items bound to the category.
*
* @return the list of all items bound to this category
* Returns the list of SlimefunItems bound to this category.
*
* @return the list of SlimefunItems bound to this category
*
* @since 4.0
*/
public List<SlimefunItem> getItems() {
@ -171,7 +136,7 @@ public class Category {
/**
* Attempts to get the category with the given display item.
*
* @param item Display item of the category to get
* @param item the display item of the category to get
* @return Category if found, or null
*
* @since 4.0
@ -184,21 +149,20 @@ public class Category {
}
/**
* Gets the URID of the category.
* Returns the {@link URID} of this category.
*
* @return the category's URID
* @return the URID of this category
*
* @since 4.0
* @see URID
*/
public URID getURID() {
return urid;
}
/**
* Gets the tier of the category.
* Returns the tier of this category.
*
* @return the category's tier
* @return the tier of this category
*
* @since 4.0
*/
@ -207,21 +171,16 @@ public class Category {
}
/**
* /!\ Documentation needed here.
*
* @author TheBusyBiscuit
* @since 4.0
*/
class CategorySorter implements Comparator<Category> {
/**
* /!\ Documentation needed here.
*
* @since 4.0
*/
@Override
public int compare(Category c1, Category c2) {
return c1.getTier() > c2.getTier() ? 1: c1.getTier() == c2.getTier() ? 0: -1;
return Integer.compare(c1.getTier(), c2.getTier());
}
}

View File

@ -7,7 +7,7 @@ import me.mrCookieSlime.Slimefun.Objects.Category;
import org.bukkit.inventory.ItemStack;
/**
* Represents an alloy, obtainable using the {@code SMELTERY}.
* Represents an alloy, a {@link SlimefunItem} obtainable using the {@code SMELTERY}.
* <p>
* An alloy is generally made up of several minerals.
* As an example, {@code BRASS_INGOT} is made up of {@code COPPER_DUST}, {@code ZINC_DUST} and {@code COPPER_INGOT}.
@ -17,7 +17,7 @@ import org.bukkit.inventory.ItemStack;
public class Alloy extends SlimefunItem {
/**
* Constructs an Alloy automatically bound to {@code Categories.RESOURCES}.
* Constructs an Alloy bound to {@code Categories.RESOURCES}.
*
* @param item the item corresponding to this Alloy
* @param id the id of this Alloy

View File

@ -66,7 +66,7 @@ public class SlimefunGuide {
public static int forks = 0;
/**
* Represents the number of stars on the Slimefun4 GitHub repository.
* @since 4.2.0
* @since 4.1.13
*/
public static int stars = 0;
public static int code_bytes = 0;