Terraria.Recipe.useSand C# (CSharp) Method

useSand() public method

public useSand ( int invType, int reqType ) : bool
invType int
reqType int
return bool
        public bool useSand(int invType, int reqType)
        {
            return (reqType == 169 || reqType == 408 || (reqType == 1246 || reqType == 370) || reqType == 3272) && this.anySand && (invType == 169 || invType == 408 || (invType == 1246 || invType == 370) || invType == 3272);
        }

Usage Example

Exemplo n.º 1
0
        static KeyValuePair<ItemUnion, int>? UsesItem(Recipe r, int netID)
        {
            if (netID == 0)
                return null;

            if (r.P_GroupDef as RecipeDef != null)
            {
                var rd = (RecipeDef)r.P_GroupDef;

                foreach (var id in rd.RequiredItems)
                {
                    var e = RefEq(netID);

                    if (id.Key.Match(e, ig => ig.Any(e)))
                        return id;
                }
            }
            else
                for (int i = 0; i < r.requiredItem.Length && !r.requiredItem[i].IsEmpty(); i++)
                {
                    var it = r.requiredItem[i];

                    if (it.netID == netID ||
                            r.useWood         (netID, it.type) ||
                            r.useSand         (netID, it.type) ||
                            r.useIronBar      (netID, it.type) ||
                            r.useFragment     (netID, it.type) ||
                            r.usePressurePlate(netID, it.type))
                        return new KeyValuePair<ItemUnion, int>(ItemUnion.NewRight(ItemDef.Defs[it.netID]), it.stack);
                }

            return null;
        }
All Usage Examples Of Terraria.Recipe::useSand