Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update src/com/untamedears/PrisonPearl/PrisonPearlManager.java #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/com/untamedears/PrisonPearl/PrisonPearlManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,25 @@ public boolean imprisonPlayer(String imprisonedname, Player imprisoner) {
pearls.deletePearl(pp);
return false;
}

// START OF 'TinieSnipah' EDIT - MORE PEARL TWEAKS

ItemStack is = new ItemStack(Material.ENDER_PEARL, 1);// create pearl
ItemMeta im = is.getItemMeta();
im.setDisplayName(pp.getImprisonedName);// rename pearl to that of imprisoned player
ArrayList<String> lore = new ArrayList<String>();
lore.add(pp.getImprisonedName + "is held within this pearl");// gives pearl lore that says more info when hovered over
im.addEnchant(Enchantment.DURABILITY, 1);// given enchantment effect (durability used because it doesn't affect pearl behaviour)
im.setLore(lore);// lore set
is.setItemMeta(im);// meta data set
pp.getID().getInventory().addItem(is);// given to imprisoner

inv.setItem(pearlnum, new ItemStack(Material.ENDER_PEARL, 1, pp.getID())); // give it to the imprisoner
// Previous line:
// inv.setItem(pearlnum, new ItemStack(Material.ENDER_PEARL, 1, pp.getID())); // give it to the imprisoner

// Reason for edit: Gives pearl enchantment effect (distinguishable, unstackable) Gives name of prisoner in inventory.

// END OF 'TinieSnipah' EDIT - MORE PEARL TWEAKS

if (getConfig().getBoolean("prison_resetbed")) {
Player imprisoned = Bukkit.getPlayerExact(imprisonedname);
Expand Down