Remove unnecessary empty itemstack checks, see comments on d0fda72

This commit is contained in:
Electroblob
2018-02-16 22:28:00 +00:00
parent bec52edce4
commit 3be254a247
11 changed files with 98 additions and 141 deletions
@@ -70,7 +70,7 @@ public interface Imbuement {
// Still not sure if it's better to set stacks in slots or modify the itemstack list directly, but I would
// imagine it's the former.
for(Slot slot : event.getContainer().inventorySlots){
if(!slot.getStack().isEmpty() && slot.getStack().getItem() instanceof ItemEnchantedBook){
if(slot.getStack().getItem() instanceof ItemEnchantedBook){
// We don't care about the level of the enchantments
Map<Enchantment, Integer> enchantments = EnchantmentHelper.getEnchantments(slot.getStack());
// Removes all imbuements
@@ -104,9 +104,9 @@ public interface Imbuement {
ItemStack bow = archer.getHeldItemMainhand();
if(bow.isEmpty() || !(bow.getItem() instanceof ItemBow)){
if(!(bow.getItem() instanceof ItemBow)){
bow = archer.getHeldItemOffhand();
if(bow.isEmpty() || !(bow.getItem() instanceof ItemBow)) return;
if(!(bow.getItem() instanceof ItemBow)) return;
}
// Taken directly from ItemBow, so it works exactly the same as the power enchantment.