@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( ( this.fluid == null ) ? 0 : this.fluid.hashCode() ); result = prime * result + ( ( this.tagCompound == null ) ? 0 : this.tagCompound.hashCode() ); return result; }
@Override public int hashCode() { int result = parent != null ? parent.hashCode() : 0; result = 31 * result + (data != null ? data.hashCode() : 0); return result; } }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (ammoItem != null ? ammoItem.hashCode() : 0); result = 31 * result + (ammoData != null ? ammoData.hashCode() : 0); result = 31 * result + ammoMeta; return result; } }
@Override public int hashCode() { int result = 0; if(stack != null) { result = stack.getItem().hashCode(); result = 31 * result + (stack.getCount()); result = 31 * result + (stack.getTagCompound() != null ? stack.getTagCompound().hashCode() : 0); } result = 31 * result + (x != +0.0f ? Float.floatToIntBits(x) : 0); result = 31 * result + (y != +0.0f ? Float.floatToIntBits(y) : 0); result = 31 * result + (z != +0.0f ? Float.floatToIntBits(z) : 0); result = 31 * result + (s != +0.0f ? Float.floatToIntBits(s) : 0); result = 31 * result + (r != +0.0f ? Float.floatToIntBits(r) : 0); return result; } }
@Override public int compareTo( final AEFluidStack other ) { if( this.fluid != other.fluid ) { return this.fluid.getName().compareTo( other.fluid.getName() ); } if( Platform.itemComparisons().isNbtTagEqual( this.tagCompound, other.tagCompound ) ) { return 0; } return this.tagCompound.hashCode() - other.tagCompound.hashCode(); }
private static int computeComplexHash(int itemID, int meta, NBTTagCompound nbt) { int hash = ((itemID * 257) ^ meta) * 17; if (nbt != null) { hash ^= nbt.hashCode(); } return hash; }
@Override public int hashCode() { return itemTag.hashCode(); }
public FinalNBTTagCompound(NBTTagCompound base) { super(); tagMap.putAll(base.tagMap); //TODO Does this work as intended ??? hashcode = super.hashCode(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Float.floatToIntBits(defaultlevel); result = prime * result + tag.hashCode(); result = prime * result + unlocalizedName.hashCode(); return result; }
@Override public int hashCode() { return getType().hashCode() + value.hashCode(); } }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (tag != null ? tag.hashCode() : 0); return result; } }
@Override public int hashCode() { int code = this.wildcard ? Block.getIdFromBlock(this.blockState.getBlock()) : this.blockState.hashCode(); if (this.nbt != null) code ^= nbt.hashCode(); return code; }
public static int hashStack(@Nonnull ItemStack stack) { int hash = stack.getItem().hashCode() * 31 + stack.getItemDamage(); if (stack.hasTagCompound()) hash = hash * 31 + stack.getTagCompound().hashCode(); return hash; }
@Override public int hashCode() { int result = state.hashCode(); result = 31 * result + endProduct.writeToNBT(new NBTTagCompound()).hashCode(); result = 31 * result + recipeId; return result; }
/** * Check if the structureBuilder requires a certain ItemStack for the current construction. * * @param stack the stack to test. * @return true if so. */ public boolean requiresResourceForBuilding(final ItemStack stack) { final int hashCode = stack.hasTagCompound() ? stack.getTagCompound().hashCode() : 0; return neededResources.containsKey(stack.getTranslationKey() + ":" + stack.getItemDamage() + "-" + hashCode); }
private static String stackToString(ItemStack stack) { if (stack == null) return "null"; String string = stack.getItem().getRegistryName().toString().replace(":", "_"); if (stack.getItemDamage() != 0) string = string + "_" + stack.getItemDamage(); if (stack.getTagCompound() != null) string = string + "_" + stack.getTagCompound().hashCode(); return string; }
@Override public void registerBlockAsNeeded(final ItemStack stack) { final int hashCode = stack.hasTagCompound() ? stack.getTagCompound().hashCode() : 0; if (getOwnBuilding(AbstractBuildingStructureBuilder.class) .getNeededResources() .get(stack.getTranslationKey() + ":" + stack.getItemDamage() + "-" + hashCode) == null) { getOwnBuilding(AbstractBuildingStructureBuilder.class).addNeededResource(stack, 1); } }
@Override public int getTotalRequiredAmount(final ItemStack deliveredItemStack) { if (ItemStackUtils.isEmpty(deliveredItemStack)) { return 0; } final int hashCode = deliveredItemStack.hasTagCompound() ? deliveredItemStack.getTagCompound().hashCode() : 0; final BuildingBuilderResource resource = getOwnBuilding(AbstractBuildingStructureBuilder.class) .getNeededResources() .get(deliveredItemStack.getTranslationKey() + ":" + deliveredItemStack.getItemDamage() + "-" + hashCode); if (resource != null) { return resource.getAmount(); } return super.getTotalRequiredAmount(deliveredItemStack); }
@Override public void readFromNBT(@NotNull final NBTTagCompound compound) { super.readFromNBT(compound); final NBTTagList neededResTagList = compound.getTagList(TAG_RESOURCE_LIST, net.minecraftforge.common.util.Constants.NBT.TAG_COMPOUND); for (int i = 0; i < neededResTagList.tagCount(); ++i) { final NBTTagCompound neededRes = neededResTagList.getCompoundTagAt(i); final ItemStack stack = new ItemStack(neededRes); final BuildingBuilderResource resource = new BuildingBuilderResource(stack, ItemStackUtils.getSize(stack)); final int hashCode = stack.hasTagCompound() ? stack.getTagCompound().hashCode() : 0; neededResources.put(stack.getTranslationKey() + ":" + stack.getItemDamage() + "-" + hashCode, resource); } if (compound.hasKey(TAG_PROGRESS_POS)) { progressPos = BlockPosUtil.readFromNBT(compound, TAG_PROGRESS_POS); progressStage = Structure.Stage.values()[compound.getInteger(TAG_PROGRESS_STAGE)]; } }
@Override public String toString() { final int itemId = Item.getIdFromItem(getItem()); final int hashCode = getItemStack().hasTagCompound() ? getItemStack().getTagCompound().hashCode() : 0; return getName() + "(p:" + amountPlayer + " a:" + amountAvailable + " n:" + getAmount() + " id=" + itemId + " damage=" + getDamageValue() + "-" + hashCode + ") => " + getAvailabilityStatus().name(); }