Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.sparklearts.astralinfusion.procedures;
- import net.minecraft.world.entity.player.Player;
- import net.minecraft.world.entity.Entity;
- import net.minecraft.network.chat.Component;
- import net.minecraft.ChatFormatting;
- import api.sparklearts.astralinfusion.soul.SoulType;
- public class SoulCMDProcedure {
- public static void execute(Entity entity) {
- if (entity == null)
- return;
- if (entity instanceof Player player && !player.level().isClientSide()) {
- player.displayClientMessage(Component.literal("Registered Soul Types:"), false);
- for (SoulType soulType : SoulType.getSoulTypes()) {
- ChatFormatting rarityColor = switch (soulType.getRarity()) {
- case COMMON -> ChatFormatting.WHITE;
- case UNCOMMON -> ChatFormatting.GREEN;
- case RARE -> ChatFormatting.BLUE;
- case EPIC -> ChatFormatting.DARK_PURPLE;
- case LEGENDARY -> ChatFormatting.GOLD;
- };
- ChatFormatting resetColor = ChatFormatting.RESET;
- String message = String.format("- %s (ID: %s, Rarity: %s, Corruption: %.2f, Strength: %.2f)", soulType.getDisplayName(), soulType.getId(), rarityColor + soulType.getRarity().toString() + resetColor, soulType.getCorruption(),
- soulType.getStrength());
- player.displayClientMessage(Component.literal(message), false);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement