This repository has been archived on 2024-10-31. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
LibZontreck/src/main/java/dev/zontreck/libzontreck/util/heads/CreditsEntry.java
Aria c6ff1afbdc Upgrade back to 1.19.4
Increment API version
+ LibAC
- Lightmans Currency
- Parchment (Temporary)
2023-04-21 03:44:40 -07:00

55 lines
1.7 KiB
Java

package dev.zontreck.libzontreck.util.heads;
import dev.zontreck.libzontreck.chat.ChatColor;
import dev.zontreck.libzontreck.lore.LoreContainer;
import dev.zontreck.libzontreck.lore.LoreEntry;
import dev.zontreck.libzontreck.util.heads.HeadCache.HeadCacheItem;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
public class CreditsEntry {
public HeadCacheItem player;
public String name;
public String role;
public String description;
public CreditsEntry(HeadCacheItem item, String name, String role, String descript){
player=item;
this.name=name;
this.role=role;
this.description=descript;
}
/**
* Compiles all the information into the head item, then applies the Lore Entry with the role the person has played, and a description
* @return
*/
public ItemStack compile()
{
ItemStack stack = player.getAsItem();
stack.setHoverName(Component.literal(name));
LoreContainer contain = new LoreContainer(stack);
LoreEntry entry = new LoreEntry();
entry.text = ChatColor.doColors("!Dark_Purple!Role: "+role);
entry.bold=true;
entry.italic=true;
contain.miscData.LoreData.add(entry);
entry = new LoreEntry();
entry.text = ChatColor.doColors("!White!About: !Dark_Green!"+description);
entry.italic=true;
contain.miscData.LoreData.add(entry);
contain.commitLore();
return stack;
}
/**
* Generates a written book that can serve as an about-page about the person being creditted.
* @return
*/
public ItemStack compileInfosBook()
{
// Will return a patchouli book
return null;
}
}