Skip to content

Commit

Permalink
Added a couple new category icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTas committed May 26, 2024
1 parent 2cc470e commit e9c8c09
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/main/java/dev/stardust/util/StardustUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.enchantment.Enchantments;
import io.netty.util.internal.ThreadLocalRandom;


/**
* @author Tas [@0xTas] <[email protected]>
**/
Expand Down Expand Up @@ -75,13 +74,14 @@ public enum TextFormat {

/** Random Color-Code */
public static String rCC() {
String color = "§7";
TextColor[] colors = TextColor.values();
int luckyIndex = ThreadLocalRandom.current().nextInt(colors.length);

String color = colors[luckyIndex].label;

// Omit gray, light_gray, and black from accent colors.
if (color.equals("§0") || color.equals("§8") || color.equals("§7")) color = "§e";
while (color.equals("§0") || color.equals("§8") || color.equals("§7")) {
int luckyIndex = ThreadLocalRandom.current().nextInt(colors.length);
color = colors[luckyIndex].label;
}

return color;
}
Expand Down Expand Up @@ -126,7 +126,6 @@ public static ItemStack chooseMenuIcon() {
private static final ItemStack[] menuIcons = {
Items.CAKE.getDefaultStack(),
Items.BEDROCK.getDefaultStack(),
Items.BARRIER.getDefaultStack(),
Items.GOAT_HORN.getDefaultStack(),
Items.DRAGON_EGG.getDefaultStack(),
Items.FILLED_MAP.getDefaultStack(),
Expand Down Expand Up @@ -188,8 +187,14 @@ private static ItemStack[] getCustomIcons() {
g.addEnchantment(Enchantments.MENDING, 1);
}

ItemStack cgiElytra = new ItemStack(Items.ELYTRA);
cgiElytra.addEnchantment(Enchantments.MENDING, 420);

ItemStack ripTridentFly = new ItemStack(Items.TRIDENT);
ripTridentFly.addEnchantment(Enchantments.RIPTIDE, 3);

return new ItemStack[] {
enchantedPick, sword32k, illegalBow, bindingPumpkin,
enchantedPick, sword32k, illegalBow, bindingPumpkin, cgiElytra, ripTridentFly,
enchantedGlass[ThreadLocalRandom.current().nextInt(enchantedGlass.length)]
};
}
Expand Down

0 comments on commit e9c8c09

Please sign in to comment.