From d12253c2f27ed42a8f1e4950f2aa979d14b30864 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 8 Dec 2019 10:07:51 +0100 Subject: [PATCH] [Ci skip] Some small changes --- .../Slimefun/Lists/Categories.java | 10 ++++------ .../Slimefun/hooks/github/Contributor.java | 20 ++++++++++++++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Lists/Categories.java b/src/main/java/me/mrCookieSlime/Slimefun/Lists/Categories.java index 7d1f826c6..0fb6e497e 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Lists/Categories.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Lists/Categories.java @@ -1,9 +1,7 @@ package me.mrCookieSlime.Slimefun.Lists; -import org.bukkit.Color; import org.bukkit.Material; -import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomArmor; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.LockedCategory; @@ -23,18 +21,18 @@ public final class Categories { 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 TOOLS = new Category(new CustomItem(Material.GOLDEN_PICKAXE, "&7Tools", "", 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(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 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 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 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 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 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 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); diff --git a/src/main/java/me/mrCookieSlime/Slimefun/hooks/github/Contributor.java b/src/main/java/me/mrCookieSlime/Slimefun/hooks/github/Contributor.java index 4fc5b58c7..9c6ff464c 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/hooks/github/Contributor.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/hooks/github/Contributor.java @@ -17,9 +17,13 @@ public class Contributor { private final String ghName; private final String mcName; private String profileLink; - private Optional headTexture; private final ConcurrentMap 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 headTexture; + public Contributor(String name, String profile) { this.ghName = profile.substring(profile.lastIndexOf('/') + 1); 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. */ @@ -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 */ 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() { return headTexture != null; }