mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-16 01:54:40 +00:00
Removed redundant function from backpack API. All checks for item validity now use IBackpackDefinition.isItemValid() resulting in more consistent behaivor.
This commit is contained in:
1 parent
38ed2fec51
commit
54146d29b9
6 files changed
+19
-25
No files matched your search
@@ -20,6 +20,7 @@ import forestry.core.config.Defaults;
|
||||
import forestry.core.utils.StringUtil;
|
||||
|
||||
public class BackpackDefinition implements IBackpackDefinition {
|
||||
|
||||
final String name;
|
||||
|
||||
final int primaryColor; // - c03384
|
||||
@@ -64,12 +65,10 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
|
||||
@Override
|
||||
public void addValidItem(ItemStack validItem) {
|
||||
if (validItem.getItem() != null) {
|
||||
if (validItem.getItem() != null)
|
||||
this.validItems.add(validItem);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getValidItems(EntityPlayer player) {
|
||||
return validItems;
|
||||
}
|
||||
@@ -77,13 +76,12 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
@Override
|
||||
public boolean isValidItem(EntityPlayer player, ItemStack itemstack) {
|
||||
for (ItemStack stack : getValidItems(player))
|
||||
if (stack != null && stack.getItem() != null ) {
|
||||
if (stack != null && stack.getItem() != null)
|
||||
if (stack.getItemDamage() == Defaults.WILDCARD) {
|
||||
if (stack.getItem() == itemstack.getItem())
|
||||
return true;
|
||||
} else if (stack.isItemEqual(itemstack))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user