Skip to content

Commit

Permalink
more bug fixing wow
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Jul 4, 2018
1 parent ed10d3c commit 82a8b23
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ private boolean isAcceptingTeleports(EntityPlayer player) {
for(int i = 0; i < baubles.getSlots(); i++) {
ItemStack stackInSlot = baubles.getStackInSlot(i);
if (!stackInSlot.isEmpty()) {
FBLog.info(i);
return baubles.getStackInSlot(i).getItem().equals(FRIENDSHIP_BRACELET);
if (baubles.getStackInSlot(i).getItem().equals(FRIENDSHIP_BRACELET)) return true;
}
}
return false;
Expand All @@ -143,23 +142,14 @@ private void equipBauble(World world, EntityPlayer player, EnumHand hand) {
for(int i = 0; i < baubles.getSlots(); i++) {
if(baubles.isItemValidForSlot(i, toEquip, player)) {
ItemStack stackInSlot = baubles.getStackInSlot(i);
if(stackInSlot.isEmpty() || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, player)) {
// If toEquip and stackInSlot are stacks with equal value but not identity, ItemStackHandler.setStackInSlot actually does nothing >.>
if(stackInSlot.isEmpty()) {
// Prevent it from trying to be overly smart by going through empty first
baubles.setStackInSlot(i, ItemStack.EMPTY);

baubles.setStackInSlot(i, toEquip);
((IBauble) toEquip.getItem()).onEquipped(toEquip, player);

stack.shrink(1);

if(!stackInSlot.isEmpty()) {
((IBauble) stackInSlot.getItem()).onUnequipped(stackInSlot, player);

if(stack.isEmpty()) return; else {
ItemHandlerHelper.giveItemToPlayer(player, stackInSlot);
}
}
player.playSound(SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 1f, 1f);
return;
}
Expand Down

0 comments on commit 82a8b23

Please sign in to comment.