api compiles, bump version

This commit is contained in:
Vincent Lee committed 2017-01-04 23:45:48 -06:00
1 parent e730c2154d
commit c0811f5a78
11 files changed
+20 -25

No files matched your search

@@ -694,7 +694,7 @@ public final class BotaniaAPI {
}
private static String getMagnetKey(ItemStack stack) {
if(stack == null)
if(stack.isEmpty())
return "";
return "i_" + stack.getItem().getUnlocalizedName() + "@" + stack.getItemDamage();
@@ -142,7 +142,7 @@ public final class CorporeaHelper {
* Bridge for requestItem() using an ItemStack.
*/
public static List<ItemStack> requestItem(ItemStack stack, ICorporeaSpark spark, boolean checkNBT, boolean doit) {
return requestItem(stack, stack.stackSize, spark, checkNBT, doit);
return requestItem(stack, stack.getCount(), spark, checkNBT, doit);
}
/**
@@ -232,14 +232,14 @@ public final class CorporeaHelper {
* Gets if two stacks match.
*/
public static boolean stacksMatch(ItemStack stack1, ItemStack stack2, boolean checkNBT) {
return stack1 != null && stack2 != null && stack1.isItemEqual(stack2) && (!checkNBT || ItemStack.areItemStackTagsEqual(stack1, stack2));
return !stack1.isEmpty() && !stack2.isEmpty() && stack1.isItemEqual(stack2) && (!checkNBT || ItemStack.areItemStackTagsEqual(stack1, stack2));
}
/**
* Gets if the name of a stack matches the string passed in.
*/
public static boolean stacksMatch(ItemStack stack, String s) {
if(stack == null)
if(stack.isEmpty())
return false;
boolean contains = false;
@@ -84,12 +84,12 @@ public class Multiblock {
}
private void addStack(ItemStack stack) {
if(stack == null)
if(stack.isEmpty())
return;
for(ItemStack oStack : materials)
if(oStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(oStack, stack)) {
oStack.stackSize += stack.stackSize;
oStack.grow(stack.getCount());
return;
}
@@ -44,7 +44,7 @@ public final class ManaItemHandler {
for(int slot = 0; slot < size; slot++) {
ItemStack stackInSlot = mainInv.getStackInSlot(slot);
if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) {
if(!stackInSlot.isEmpty() && stackInSlot.getItem() instanceof IManaItem) {
toReturn.add(stackInSlot);
}
}
@@ -74,7 +74,7 @@ public final class ManaItemHandler {
for(int slot = 0; slot < size; slot++) {
ItemStack stackInSlot = baublesInv.getStackInSlot(slot);
if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) {
if(!stackInSlot.isEmpty() && stackInSlot.getItem() instanceof IManaItem) {
toReturn.put(slot, stackInSlot);
}
}
@@ -328,11 +328,11 @@ public final class ManaItemHandler {
* Gets the sum of all the discounts on IManaDiscountArmor items equipped
* on the player passed in. This discount can vary based on what the passed tool is.
*/
public static float getFullDiscountForTools(EntityPlayer player, @Nullable ItemStack tool) {
public static float getFullDiscountForTools(EntityPlayer player, ItemStack tool) {
float discount = 0F;
for(int i = 0; i < player.inventory.armorInventory.length; i++) {
ItemStack armor = player.inventory.armorInventory[i];
if(armor != null && armor.getItem() instanceof IManaDiscountArmor)
for(int i = 0; i < player.inventory.armorInventory.size(); i++) {
ItemStack armor = player.inventory.armorInventory.get(i);
if(!armor.isEmpty() && armor.getItem() instanceof IManaDiscountArmor)
discount += ((IManaDiscountArmor) armor.getItem()).getDiscount(armor, i, player, tool);
}
@@ -10,10 +10,6 @@
*/
package vazkii.botania.api.mana;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Event;
@@ -24,7 +20,7 @@ public class ManaProficiencyEvent extends Event {
private ItemStack rod;
private boolean proficient;
public ManaProficiencyEvent(EntityPlayer entityPlayer, @Nullable ItemStack rod, boolean proficient) {
public ManaProficiencyEvent(EntityPlayer entityPlayer, ItemStack rod, boolean proficient) {
this.entityPlayer = entityPlayer;
this.rod = rod;
this.proficient = proficient;
@@ -34,7 +30,6 @@ public class ManaProficiencyEvent extends Event {
return entityPlayer;
}
@Nullable
public ItemStack getRod() {
return rod;
}
@@ -1,4 +1,4 @@
@API(owner = "Botania", apiVersion = "85", provides = "BotaniaAPI")
@API(owner = "Botania", apiVersion = "86", provides = "BotaniaAPI")
package vazkii.botania.api;
import net.minecraftforge.fml.common.API;
@@ -45,7 +45,7 @@ public class RecipeBrew {
for(int i = 0; i < inv.getSlots(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if(stack == null)
if(stack.isEmpty())
break;
if(stack.getItem() instanceof IBrewContainer)
@@ -31,7 +31,7 @@ public class RecipeElvenTrade {
List<ItemStack> stacksToRemove = new ArrayList<>();
for(ItemStack stack : stacks) {
if(stack == null) {
if(stack.isEmpty()) {
continue;
}
if(inputsMissing.isEmpty())
@@ -42,7 +42,7 @@ public class RecipePetals {
for(int i = 0; i < inv.getSlots(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if(stack == null)
if(stack.isEmpty())
break;
int stackIndex = -1, oredictIndex = -1;
@@ -59,7 +59,7 @@ public class RecipePureDaisy {
}
private boolean isOreDict(ItemStack stack, String entry) {
if(stack == null || stack.getItem() == null)
if(stack.isEmpty())
return false;
List<ItemStack> ores;
@@ -53,10 +53,10 @@ public class SimpleWikiProvider implements IWikiProvider {
ItemStack stack = state.getBlock().getPickBlock(state, pos, world, bPos, player);
if(stack == null || stack.getItem() == null)
if(stack.isEmpty())
stack = new ItemStack(state.getBlock(), 1, state.getBlock().damageDropped(state));
if(stack.getItem() == null)
if(stack.isEmpty())
return null;
String name = stack.getDisplayName();