mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-24 22:04:49 +00:00
Merging with other computer
This commit is contained in:
1 parent
db5588ddb9
commit
8996b499e3
59 files changed
+998
-637
No files matched your search
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) SpaceToad, 2011-2012
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.api.core;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author CovertJaguar <http://www.railcraft.info/>
|
||||
*/
|
||||
public class StackWrapper {
|
||||
|
||||
public final ItemStack stack;
|
||||
|
||||
public StackWrapper(ItemStack stack) {
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 67 * hash + stack.itemID;
|
||||
hash = 67 * hash + stack.getItemDamage();
|
||||
if (stack.stackTagCompound != null)
|
||||
hash = 67 * hash + stack.stackTagCompound.hashCode();
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
final StackWrapper other = (StackWrapper) obj;
|
||||
if (stack.itemID != other.stack.itemID)
|
||||
return false;
|
||||
if (stack.getHasSubtypes() && stack.getItemDamage() != other.stack.getItemDamage())
|
||||
return false;
|
||||
if (stack.stackTagCompound != null && !stack.stackTagCompound.equals(other.stack.stackTagCompound))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user