Skip to content

Commit

Permalink
Fix for Mithion#1218
Browse files Browse the repository at this point in the history
  • Loading branch information
DoomFruit committed Sep 12, 2015
1 parent e89a387 commit 1ffa493
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/main/java/am2/items/ItemJournal.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,13 @@ public ItemStack onItemRightClick(ItemStack journal, World world, EntityPlayer p
if (getOwner(journal) == null){
setOwner(journal, player);
}else if (!getOwner(journal).equals(player.getCommandSenderName())){
player.addChatMessage(new ChatComponentText("am2.tooltip.notYourJournal"));
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("am2.tooltip.notYourJournal")));
return super.onItemRightClick(journal, world, player);
}

if (player.isSneaking()){
try{
int amt = Math.min(player.experienceTotal, 10);
if (amt > 0){
EntityUtilities.deductXP(amt, player);
addXPToJournal(journal, amt);
}
}catch (Throwable t){
t.printStackTrace();
}
int removedXP = EntityUtilities.deductXP(10, player);
addXPToJournal(journal, removedXP);
}else{
int amt = Math.min(getXPInJournal(journal), 10);
if (amt > 0){
Expand Down

0 comments on commit 1ffa493

Please sign in to comment.