Skip to content

Commit

Permalink
add lore for easier identification
Browse files Browse the repository at this point in the history
  • Loading branch information
crashdemons committed Sep 9, 2018
1 parent 5ab6412 commit 4c03e2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.shininet.bukkit</groupId>
<artifactId>PlayerHeads</artifactId>
<packaging>jar</packaging>
<version>4.1.0-alpha</version>
<version>4.1.1-alpha</version>
<name>PlayerHeads</name>

<organization>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;

Expand All @@ -27,6 +28,15 @@
* @author x7aSv
*/
public class SkullManager {

private static void applyLore(SkullMeta headMeta,String extra){
ArrayList<String> lore = new ArrayList<String>();
lore.add(" ");
lore.add(ChatColor.BLUE+""+ChatColor.ITALIC+"PlayerHeads");
if(!extra.isEmpty()) lore.add(extra);
headMeta.setLore(lore);
}

private static void applyOwningPlayer(SkullMeta headMeta,OfflinePlayer owner){
headMeta.setOwningPlayer( owner );
}
Expand Down Expand Up @@ -58,7 +68,6 @@ public static ItemStack MobSkull(TexturedSkullType type,int quantity,boolean use


if(type.hasDedicatedItem()){
System.out.println(type.name()+" :: "+mat.name() + " :: "+useVanillaHeads);//TODO: remove
if(useVanillaHeads)
return new ItemStack(mat,quantity);
else mat=Material.PLAYER_HEAD;
Expand All @@ -70,6 +79,7 @@ public static ItemStack MobSkull(TexturedSkullType type,int quantity,boolean use
//applyOwningPlayer(headMeta,Bukkit.getOfflinePlayer(type.getOwner()));
applyTexture(headMeta,type.getOwner(),type.getTexture());
applyDisplayName(headMeta,ChatColor.RESET + "" + ChatColor.YELLOW + type.getDisplayName());
applyLore(headMeta,ChatColor.GREEN+"Mob Drop");
stack.setItemMeta(headMeta);
return stack;
}
Expand All @@ -86,6 +96,7 @@ private static ItemStack PlayerSkull(OfflinePlayer owner, int quantity){
}
if(name==null) name="Unknown";//only used for display purposes.
applyDisplayName(headMeta,ChatColor.RESET + "" + ChatColor.YELLOW + TexturedSkullType.getDisplayName(name));
applyLore(headMeta,ChatColor.RED+"Player Drop");
stack.setItemMeta(headMeta);
return stack;
}
Expand Down

0 comments on commit 4c03e2a

Please sign in to comment.