1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

[Ci skip] Some small changes

This commit is contained in:
TheBusyBiscuit 2019-12-08 10:07:51 +01:00
parent e5da69eb30
commit d12253c2f2
2 changed files with 21 additions and 9 deletions

View File

@ -1,9 +1,7 @@
package me.mrCookieSlime.Slimefun.Lists; package me.mrCookieSlime.Slimefun.Lists;
import org.bukkit.Color;
import org.bukkit.Material; import org.bukkit.Material;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomArmor;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.LockedCategory; import me.mrCookieSlime.Slimefun.Objects.LockedCategory;
@ -23,18 +21,18 @@ public final class Categories {
private static final String LORE = "&a> Click to open"; private static final String LORE = "&a> Click to open";
public static final Category WEAPONS = new Category(new CustomItem(Material.GOLDEN_SWORD, "&7Weapons", "", LORE), 1); public static final Category WEAPONS = new Category(new CustomItem(SlimefunItems.SWORD_OF_BEHEADING, "&7Weapons", "", LORE), 1);
public static final Category TOOLS = new Category(new CustomItem(Material.GOLDEN_PICKAXE, "&7Tools", "", LORE), 1); public static final Category TOOLS = new Category(new CustomItem(SlimefunItems.AUTO_SMELT_PICKAXE, "&7Tools", "", LORE), 1);
public static final Category PORTABLE = new Category(new CustomItem(SlimefunItems.BACKPACK_MEDIUM, "&7Items", "", LORE), 1); public static final Category PORTABLE = new Category(new CustomItem(SlimefunItems.BACKPACK_MEDIUM, "&7Items", "", LORE), 1);
public static final Category FOOD = new Category(new CustomItem(SlimefunItems.FORTUNE_COOKIE, "&7Food", "", LORE), 2); public static final Category FOOD = new Category(new CustomItem(SlimefunItems.FORTUNE_COOKIE, "&7Food", "", LORE), 2);
public static final Category MACHINES_1 = new Category(new CustomItem(Material.SMITHING_TABLE, "&7Basic Machines", "", LORE), 1); public static final Category MACHINES_1 = new Category(new CustomItem(Material.SMITHING_TABLE, "&7Basic Machines", "", LORE), 1);
public static final LockedCategory ELECTRICITY = new LockedCategory(new CustomItem(SlimefunItems.NUCLEAR_REACTOR, "&bEnergy and Electricity", "", LORE), 4, MACHINES_1); public static final LockedCategory ELECTRICITY = new LockedCategory(new CustomItem(SlimefunItems.NUCLEAR_REACTOR, "&bEnergy and Electricity", "", LORE), 4, MACHINES_1);
public static final LockedCategory GPS = new LockedCategory(new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&bGPS-based Machines", "", LORE), 4, MACHINES_1); public static final LockedCategory GPS = new LockedCategory(new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&bGPS-based Machines", "", LORE), 4, MACHINES_1);
public static final Category ARMOR = new Category(new CustomItem(Material.IRON_CHESTPLATE, "&7Armor", "", LORE), 2); public static final Category ARMOR = new Category(new CustomItem(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, "&7Armor", "", LORE), 2);
public static final Category LUMPS_AND_MAGIC = new Category(new CustomItem(SlimefunItems.RUNE_ENDER, "&7Magical Items", "", LORE), 2); public static final Category LUMPS_AND_MAGIC = new Category(new CustomItem(SlimefunItems.RUNE_ENDER, "&7Magical Items", "", LORE), 2);
public static final Category MAGIC = new Category(new CustomItem(SlimefunItems.INFUSED_ELYTRA, "&7Magical Gadgets", "", LORE), 3); public static final Category MAGIC = new Category(new CustomItem(SlimefunItems.INFUSED_ELYTRA, "&7Magical Gadgets", "", LORE), 3);
public static final Category MISC = new Category(new CustomItem(SlimefunItems.CAN, "&7Miscellaneous", "", LORE), 2); public static final Category MISC = new Category(new CustomItem(SlimefunItems.CAN, "&7Miscellaneous", "", LORE), 2);
public static final Category TECH = new Category(new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&7Technical Gadgets", "", LORE), Color.SILVER), 3); public static final Category TECH = new Category(new CustomItem(SlimefunItems.STEEL_JETPACK, "&7Technical Gadgets", "", LORE), 3);
public static final Category RESOURCES = new Category(new CustomItem(SlimefunItems.SYNTHETIC_SAPPHIRE, "&7Resources", "", LORE), 1); public static final Category RESOURCES = new Category(new CustomItem(SlimefunItems.SYNTHETIC_SAPPHIRE, "&7Resources", "", LORE), 1);
public static final Category CARGO = new LockedCategory(new CustomItem(SlimefunItems.CARGO_MANAGER, "&cCargo Management", "", LORE), 4, MACHINES_1); public static final Category CARGO = new LockedCategory(new CustomItem(SlimefunItems.CARGO_MANAGER, "&cCargo Management", "", LORE), 4, MACHINES_1);
public static final Category TECH_MISC = new Category(new CustomItem(SlimefunItems.HEATING_COIL, "&7Technical Components", "", LORE), 2); public static final Category TECH_MISC = new Category(new CustomItem(SlimefunItems.HEATING_COIL, "&7Technical Components", "", LORE), 2);

View File

@ -17,9 +17,13 @@ public class Contributor {
private final String ghName; private final String ghName;
private final String mcName; private final String mcName;
private String profileLink; private String profileLink;
private Optional<String> headTexture;
private final ConcurrentMap<String, Integer> contributions = new ConcurrentHashMap<>(); private final ConcurrentMap<String, Integer> contributions = new ConcurrentHashMap<>();
// This field is nullable.
// null = "Texture was not pulled yet or failed to pull, it will try again next time"
// empty Optional = "No Texture could be found for this person.
private Optional<String> headTexture;
public Contributor(String name, String profile) { public Contributor(String name, String profile) {
this.ghName = profile.substring(profile.lastIndexOf('/') + 1); this.ghName = profile.substring(profile.lastIndexOf('/') + 1);
this.mcName = name; this.mcName = name;
@ -41,7 +45,8 @@ public class Contributor {
} }
/** /**
* Returns the MC name of the contributor. This may be the same as {@link #getName()}. * Returns the MC name of the contributor.
* This may be the same as {@link #getName()}.
* *
* @return The MC username of this contributor. * @return The MC username of this contributor.
*/ */
@ -64,7 +69,10 @@ public class Contributor {
} }
/** /**
* Returns this Creator's head texture * Returns this Creator's head texture.
* If no texture could be found, or it hasn't been pulled yet,
* then it will return a placeholder texture.
*
* @return A Base64-Head Texture * @return A Base64-Head Texture
*/ */
public String getTexture() { public String getTexture() {
@ -76,6 +84,12 @@ public class Contributor {
} }
} }
/**
* This method will return whether this instance of {@link Contributor} has
* pulled a texture yet.
*
* @return Whether this {@link Contributor} has been assigned a texture yet
*/
public boolean hasTexture() { public boolean hasTexture() {
return headTexture != null; return headTexture != null;
} }